public final class TrustedSessionCredential extends Object implements Credential
A LibrarySession can always construct a TrustedSessionCredential for its own user or for "guest". For any other user, the LibrarySession must be in administration mode to construct the TrustedSessionCredential; in other words, it must be a "trusted session".
Unlike TokenCredential, a TrustedSessionCredential can only be used to create a session in the same Java VM in which it was constructed.
After being used to create a single session, a TrustedSessionCredential is invalid; it cannot be re-used.
Constructor and Description |
---|
TrustedSessionCredential(LibrarySession session)
Constructs a TrustedSessionCredential.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Gets the name of the user.
|
void |
invalidate()
Invalidates this TrustedSessionCredential.
|
void |
setName(String name)
Sets the name of the user.
|
void |
verifyValid()
Verifies this TrustedSessionCredential is valid.
|
public TrustedSessionCredential(LibrarySession session) throws IfsException
By default, the TrustedSessionCredential is for the same user as the
specified session. Call setName
to specify the name
of a different user.
session
- the requesting sessionIfsException
- if the operation failspublic String getName() throws IfsException
getName
in interface Credential
IfsException
- (IFS-10187) if the operation failspublic void setName(String name) throws IfsException
setName
in interface Credential
name
- the name of the userIfsException
- (IFS-10188) if the operation failspublic void verifyValid() throws IfsException
IfsException
- if the operation failspublic void invalidate() throws IfsException
IfsException
- if the operation failsCopyright © 2023. All rights reserved.