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