public class ProfileHandleImplNative extends java.lang.Object implements ProfileHandleImpl
Constructor and Description |
---|
ProfileHandleImplNative() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy or clear sensitive information maintained by the credential implementation.
|
byte[] |
getCurrentHandle()
Generates and returns a profile handle based on the current thread identity.
|
int |
getTimeToExpiration()
Returns the number of seconds before the credential is due to expire.
|
int |
getVersion()
Returns the version number for the implementation.
|
boolean |
isCurrent()
Indicates if the credential is still considered valid for authenticating to associated services or performing related actions.
|
void |
refresh()
Updates or extends the validity period for the credential.
|
void |
releaseHandle(byte[] handle)
Releases OS resources for the given profile handle.
|
void |
setCredential(AS400Credential credential)
Sets the credential delegating behavior to the implementation object.
|
void |
setCurrentHandle(byte[] handle)
Sets the current thread identity based on the given profile handle.
|
AS400Credential |
swap(boolean genRtnCr)
Attempts to swap the thread identity based on this credential.
|
public void destroy() throws DestroyFailedException
Subsequent requests may result in a NullPointerException.
Subclasses should override as necessary to destroy or clear class-specific data.
DestroyFailedException
- If errors occur while destroying or clearing credential implementation data.public byte[] getCurrentHandle() throws RetrieveFailedException
getCurrentHandle
in interface ProfileHandleImpl
RetrieveFailedException
- If errors occur while generating the handle.public int getTimeToExpiration() throws RetrieveFailedException
Subclasses implementing timed credentials must override.
RetrieveFailedException
- If errors occur while retrieving timeout information.public int getVersion()
Used to ensure the implementation is valid for specific functions.
public boolean isCurrent()
An exception is not thrown on failure to remain consistent with the Refreshable interface (even though some credential classes currently avoid the dependency established by implementing the interface).
public void refresh() throws RefreshFailedException
RefreshFailedException
- If the refresh attempt fails.public void releaseHandle(byte[] handle) throws DestroyFailedException
handle
- The handle bytes.DestroyFailedException
- If errors occur while releasing the handle.public void setCredential(AS400Credential credential)
credential
- The associated credential.public void setCurrentHandle(byte[] handle) throws SwapFailedException
handle
- The handle bytes.SwapFailedException
- If errors occur while generating the handle.public AS400Credential swap(boolean genRtnCr) throws SwapFailedException
genRtnCr
- Indicates whether a return credential should be generated, even if supported. When appropriate, not generating a return credential can improve performance and avoid potential problems in creating the credential.SwapFailedException
- If errors occur while swapping thread identity.java.lang.SecurityException
- If the caller does not have permission to modify the OS thread identity.