com.ibm.as400.security.auth
Interface ProfileHandleImpl

All Known Implementing Classes:
ProfileHandleImplNative

public interface ProfileHandleImpl

The ProfileHandleImpl interface provides the template for classes implementing behavior delegated by a ProfileHandleCredential.


Method Summary
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 system services or performing related actions.
 void refresh()
          Updates or extends the validity period for the credential.
 void setCredential(AS400Credential credential)
          Sets the credential delegating behavior to the implementation object.
 AS400Credential swap(boolean genRtnCr)
          Attempts to swap the thread identity based on this credential.
 

Method Detail

getCurrentHandle

byte[] getCurrentHandle()
                        throws RetrieveFailedException
Generates and returns a profile handle based on the current thread identity.

Returns:
The handle bytes.
Throws:
RetrieveFailedException - If errors occur while generating the handle.

destroy

void destroy()
             throws DestroyFailedException
Destroy or clear sensitive information maintained by the credential implementation.

Subsequent requests may result in a NullPointerException.

Throws:
DestroyFailedException - If errors occur while destroying or clearing credential implementation data.

getTimeToExpiration

int getTimeToExpiration()
                        throws RetrieveFailedException
Returns the number of seconds before the credential is due to expire.

Returns:
The number of seconds before expiration; zero (0) if already expired.
Throws:
RetrieveFailedException - If errors occur while retrieving timeout information.

getVersion

int getVersion()
Returns the version number for the implementation.

Used to ensure the implementation is valid for specific functions.

Returns:
The version number.

isCurrent

boolean isCurrent()
Indicates if the credential is still considered valid for authenticating to associated system services or performing related actions.

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).

Returns:
true if valid; false if not valid or if the operation fails.

refresh

void refresh()
             throws RefreshFailedException
Updates or extends the validity period for the credential.

Throws:
RefreshFailedException - If errors occur during refresh.

setCredential

void setCredential(AS400Credential credential)
Sets the credential delegating behavior to the implementation object.

Parameters:
credential - The associated credential.

swap

AS400Credential swap(boolean genRtnCr)
                     throws SwapFailedException
Attempts to swap the thread identity based on this credential.

Parameters:
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.
Returns:
A credential capable of swapping back to the original identity; classes not supporting this capability will return null. This value will also be null if genRtnCr is false.
Throws:
SwapFailedException - If errors occur while swapping thread identity.
SecurityException - If the caller does not have permission to modify the OS thread identity.