public class AnonymousCredentials extends Object implements Credentials
Credentials
implementation that can be used to represent anonymous users when ModeShape is configured to allow
anonymous users.
Note that this implementation supports attributes.
Constructor and Description |
---|
AnonymousCredentials()
Create a new instance of the anonymous credentials.
|
AnonymousCredentials(String attributeName,
Object attributeValue)
Create a new instance of the anonymous credentials, with the supplied attributes.
|
AnonymousCredentials(String attribute1Name,
Object attribute1Value,
String attribute2Name,
Object attribute2Value)
Create a new instance of the anonymous credentials, with the supplied attributes.
|
AnonymousCredentials(String attribute1Name,
Object attribute1Value,
String attribute2Name,
Object attribute2Value,
String attribute3Name,
Object attribute3Value)
Create a new instance of the anonymous credentials, with the supplied attributes.
|
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String name)
Returns the value of the named attribute as an
Object , or null if no attribute of the given name
exists. |
String[] |
getAttributeNames()
Returns the names of the attributes available to this credentials instance.
|
Map<String,Object> |
getAttributes() |
void |
removeAttribute(String name)
Removes an attribute from this credentials instance.
|
void |
setAttribute(String name,
Object value)
Stores an attribute in this credentials instance.
|
public AnonymousCredentials()
public AnonymousCredentials(String attributeName, Object attributeValue)
attributeName
- the name of the attribute; may not be nullattributeValue
- the value of the attributepublic AnonymousCredentials(String attribute1Name, Object attribute1Value, String attribute2Name, Object attribute2Value)
attribute1Name
- the name of the attribute; may not be nullattribute1Value
- the value of the attributeattribute2Name
- the name of the attribute; may not be nullattribute2Value
- the value of the attributepublic AnonymousCredentials(String attribute1Name, Object attribute1Value, String attribute2Name, Object attribute2Value, String attribute3Name, Object attribute3Value)
attribute1Name
- the name of the attribute; may not be nullattribute1Value
- the value of the attributeattribute2Name
- the name of the attribute; may not be nullattribute2Value
- the value of the attributeattribute3Name
- the name of the attribute; may not be nullattribute3Value
- the value of the attributepublic void setAttribute(String name, Object value)
name
- a String
specifying the name of the attributevalue
- the Object
to be storedpublic Object getAttribute(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(String name)
name
- a String
specifying the name of the attribute to removepublic String[] getAttributeNames()
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.