public final class TokenCredentials
extends java.lang.Object
TokenCredentials
implements the Credentials
interface and represents single token credentials. Similar to
javax.jcr.SimpleCredentials
this credentials implementation allows
to set additional attributes.Constructor and Description |
---|
TokenCredentials(java.lang.String token)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of the named attribute as an
Object , or
null if no attribute of the given name exists. |
java.lang.String[] |
getAttributeNames()
Returns the names of the attributes available to this credentials
instance.
|
java.lang.String |
getToken()
Returns the token this credentials are built from.
|
void |
removeAttribute(java.lang.String name)
Removes an attribute from this credentials instance.
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Stores an attribute in this credentials instance.
|
public TokenCredentials(java.lang.String token) throws java.lang.IllegalArgumentException
token
- A token string used to create this credentials instance.java.lang.IllegalArgumentException
- If the specified token is null
or empty string.public java.lang.String getToken()
public void setAttribute(java.lang.String name, java.lang.String value)
name
- a String
specifying the name of the attributevalue
- the Object
to be storedpublic java.lang.String getAttribute(java.lang.String name)
Object
, or
null
if no attribute of the given name exists.name
- a String
specifying the name of the attributeObject
containing the value of the attribute, or
null
if the attribute does not existpublic void removeAttribute(java.lang.String name)
name
- a String
specifying the name of the attribute to
removepublic java.lang.String[] getAttributeNames()
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"