All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.access.ProfileHandleImplNative
java.lang.Object
|
+----com.ibm.as400.access.ProfileHandleImplNative
- public class ProfileHandleImplNative
- extends Object
- implements ProfileHandleImpl
The ProfileHandleImplNative class provides an implementation for
behavior delegated by a ProfileHandleCredential object.
-
ProfileHandleImplNative()
-
-
destroy()
- Destroy or clear sensitive information maintained
by the credential implementation.
-
getCurrentHandle()
- Generates and returns a profile handle based on
the current OS/400 thread identity.
-
getTimeToExpiration()
- Returns the number of seconds before the
credential is due to expire.
-
getVersion()
- Returns the version number for the implementation.
-
isCurrent()
- Indicates if the credential is still considered valid
for authenticating to associated AS/400 services
or performing related actions.
-
refresh()
- Updates or extends the validity period for the
credential.
-
setCredential(AS400Credential)
- Sets the credential delegating behavior to
the implementation object.
-
setCurrentHandle(byte[])
- Sets the current OS/400 thread identity based
on the given profile handle.
-
swap(boolean)
- Attempts to swap the OS/400 thread identity based on this
credential.
ProfileHandleImplNative
public ProfileHandleImplNative()
destroy
public void destroy() throws DestroyFailedException
- Destroy or clear sensitive information maintained
by the credential implementation.
Subsequent requests may result in a NullPointerException.
Subclasses should override as necessary to
destroy or clear class-specific data.
- Throws: DestroyFailedException
- If errors occur while destroying or clearing
credential implementation data.
getCurrentHandle
public native byte[] getCurrentHandle() throws RetrieveFailedException
- Generates and returns a profile handle based on
the current OS/400 thread identity.
- Returns:
- The handle bytes.
- Throws: RetrieveFailedException
- If errors occur while generating the handle.
getTimeToExpiration
public int getTimeToExpiration() throws RetrieveFailedException
- Returns the number of seconds before the
credential is due to expire.
Subclasses implementing timed credentials
must override.
- Returns:
- The number of seconds before expiration;
zero (0) if already expired or if the
credential is not identified as expiring
based on time.
- Throws: RetrieveFailedException
- If errors occur while retrieving
timeout information.
getVersion
public int getVersion()
- Returns the version number for the implementation.
Used to ensure the implementation is valid for
specific functions.
- Returns:
- The version number.
isCurrent
public boolean isCurrent()
- Indicates if the credential is still considered valid
for authenticating to associated AS/400 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
public void refresh() throws RefreshFailedException
- Updates or extends the validity period for the
credential.
- Throws: RefreshFailedException
- If the refresh attempt fails.
setCredential
public void setCredential(AS400Credential credential)
- Sets the credential delegating behavior to
the implementation object.
- Parameters:
- credential
- The associated credential.
setCurrentHandle
public native void setCurrentHandle(byte handle[]) throws SwapFailedException
- Sets the current OS/400 thread identity based
on the given profile handle.
- Parameters:
- handle
- The handle bytes.
- Throws: SwapFailedException
- If errors occur while generating the handle.
swap
public AS400Credential swap(boolean genRtnCr) throws SwapFailedException
- Attempts to swap the OS/400 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.
- Throws: SecurityException
- If the caller does not have permission to
modify the OS thread identity.
All Packages Class Hierarchy This Package Previous Next Index