Interface User
-
- All Superinterfaces:
Authorizable
@ProviderType public interface User extends Authorizable
User is a specialAuthorizablethat can be authenticated and impersonated.- See Also:
getCredentials(),getImpersonation()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidchangePassword(@Nullable java.lang.String password)Change the password of this user.voidchangePassword(@Nullable java.lang.String password, @NotNull java.lang.String oldPassword)Change the password of this user.voiddisable(@Nullable java.lang.String reason)Disable this user thus preventing future login if thereasonis a non-null String.
Note however, that this user will still be accessible byUserManager.getAuthorizable(java.lang.String).@NotNull javax.jcr.CredentialsgetCredentials()Returns the internalCredentialsrepresentation for this user.@Nullable java.lang.StringgetDisabledReason()@NotNull ImpersonationgetImpersonation()booleanisAdmin()booleanisDisabled()Returnstrueif this user is disabled,falseotherwise.booleanisSystemUser()-
Methods inherited from interface org.apache.jackrabbit.api.security.user.Authorizable
declaredMemberOf, getID, getPath, getPrincipal, getProperty, getPropertyNames, getPropertyNames, hasProperty, isGroup, memberOf, remove, removeProperty, setProperty, setProperty
-
-
-
-
Method Detail
-
isAdmin
boolean isAdmin()
- Returns:
- true if the current user represents the administrator.
-
isSystemUser
boolean isSystemUser()
- Returns:
- true if the current user represents a system user.
-
getCredentials
@NotNull @NotNull javax.jcr.Credentials getCredentials() throws javax.jcr.RepositoryExceptionReturns the internalCredentialsrepresentation for this user. This method is expected to be used for validation during the login process. However, the return value should neither be usable nor used forRepository.login(javax.jcr.Credentials, java.lang.String).- Returns:
Credentialsfor this user.- Throws:
javax.jcr.RepositoryException- If an error occurs.
-
getImpersonation
@NotNull @NotNull Impersonation getImpersonation() throws javax.jcr.RepositoryException
- Returns:
Impersonationfor thisUser.- Throws:
javax.jcr.RepositoryException- If an error occurs.
-
changePassword
void changePassword(@Nullable @Nullable java.lang.String password) throws javax.jcr.RepositoryExceptionChange the password of this user.- Parameters:
password- The new password.- Throws:
javax.jcr.RepositoryException- If an error occurs.
-
changePassword
void changePassword(@Nullable @Nullable java.lang.String password, @NotNull @NotNull java.lang.String oldPassword) throws javax.jcr.RepositoryExceptionChange the password of this user.- Parameters:
password- The new password.oldPassword- The old password.- Throws:
javax.jcr.RepositoryException- If the old password doesn't match or if an error occurs.
-
disable
void disable(@Nullable @Nullable java.lang.String reason) throws javax.jcr.RepositoryExceptionDisable this user thus preventing future login if thereasonis a non-null String.
Note however, that this user will still be accessible byUserManager.getAuthorizable(java.lang.String).- Parameters:
reason- String describing the reason for disable this user ornullif the user account should be enabled again.- Throws:
javax.jcr.RepositoryException- If an error occurs.
-
isDisabled
boolean isDisabled() throws javax.jcr.RepositoryExceptionReturnstrueif this user is disabled,falseotherwise.- Returns:
trueif this user is disabled,falseotherwise.- Throws:
javax.jcr.RepositoryException- If an error occurs.
-
getDisabledReason
@Nullable @Nullable java.lang.String getDisabledReason() throws javax.jcr.RepositoryException- Returns:
- The reason specified upon disabling this user or
nullif this user is not disabled. - Throws:
javax.jcr.RepositoryException- If an error occurs.
-
-