Class AbstractCredentials
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authentication.credentials.AbstractCredentials
-
- All Implemented Interfaces:
java.io.Serializable
,Credentials
public abstract class AbstractCredentials extends java.lang.Object implements Credentials
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractCredentials(@NotNull java.lang.String userId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.lang.Object
getAttribute(@NotNull java.lang.String name)
Returns the value of the named attribute as anObject
, ornull
if no attribute of the given name exists.@NotNull java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
@NotNull java.lang.String
getUserId()
Returns the userId.void
removeAttribute(@NotNull java.lang.String name)
Removes an attribute from this credentials instance.void
setAttribute(@NotNull java.lang.String name, @Nullable java.lang.Object value)
Stores an attribute in this credentials instance.void
setAttributes(@NotNull java.util.Map<java.lang.String,java.lang.Object> attributes)
Stores the attributes in this credentials instance.
-
-
-
Method Detail
-
getUserId
@NotNull public @NotNull java.lang.String getUserId()
Returns the userId.- Returns:
- the userId.
-
setAttribute
public void setAttribute(@NotNull @NotNull java.lang.String name, @Nullable @Nullable java.lang.Object value)
Stores an attribute in this credentials instance. If the specifiedvalue
isnull
the attribute will be removed.- Parameters:
name
- aString
specifying the name of the attributevalue
- theObject
to be stored
-
getAttribute
@Nullable public @Nullable java.lang.Object getAttribute(@NotNull @NotNull java.lang.String name)
Returns the value of the named attribute as anObject
, ornull
if no attribute of the given name exists.- Parameters:
name
- aString
specifying the name of the attribute- Returns:
- an
Object
containing the value of the attribute, ornull
if the attribute does not exist
-
removeAttribute
public void removeAttribute(@NotNull @NotNull java.lang.String name)
Removes an attribute from this credentials instance.- Parameters:
name
- aString
specifying the name of the attribute to remove
-
getAttributes
@NotNull public @NotNull java.util.Map<java.lang.String,java.lang.Object> getAttributes()
- Returns:
- an immutable map containing the attributes available to this credentials instance
-
setAttributes
public void setAttributes(@NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> attributes)
Stores the attributes in this credentials instance.- Parameters:
attributes
- The attributes to be stored
-
-