org.apache.jackrabbit.api.security.user
Interface User

All Superinterfaces:
Authorizable
All Known Implementing Classes:
UserImpl

public interface User
extends Authorizable

User is a special Authorizable that can be authenticated and impersonated.

See Also:
getCredentials(), getImpersonation()

Method Summary
 void changePassword(String password)
          Change the password of this user.
 void disable(String reason)
          Disable this user thus preventing future login if the reason is a non-null String.
 Credentials getCredentials()
          Returns the internal Credentials representation for this user.
 String getDisabledReason()
          Returns the String specified upon disabling this user or null if isDisabled() returns false.
 Impersonation getImpersonation()
           
 boolean isAdmin()
           
 boolean isDisabled()
          Returns true if this user is disabled, false otherwise.
 
Methods inherited from interface org.apache.jackrabbit.api.security.user.Authorizable
declaredMemberOf, getID, 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.

getCredentials

Credentials getCredentials()
                           throws RepositoryException
Returns the internal Credentials representation 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 for Repository.login(javax.jcr.Credentials, java.lang.String).

Returns:
Credentials for this user.
Throws:
RepositoryException - If an error occurs.

getImpersonation

Impersonation getImpersonation()
                               throws RepositoryException
Returns:
Impersonation for this User.
Throws:
RepositoryException - If an error occurs.

changePassword

void changePassword(String password)
                    throws RepositoryException
Change the password of this user.

Parameters:
password - The new password.
Throws:
RepositoryException - If an error occurs.

disable

void disable(String reason)
             throws RepositoryException
Disable this user thus preventing future login if the reason is a non-null String.
Note however, that this user will still be accessible by UserManager.getAuthorizable(java.lang.String).

Parameters:
reason - String describing the reason for disable this user or null if the user account should be enabled again.
Throws:
RepositoryException

isDisabled

boolean isDisabled()
                   throws RepositoryException
Returns true if this user is disabled, false otherwise.

Returns:
true if this user is disabled, false otherwise.
Throws:
RepositoryException

getDisabledReason

String getDisabledReason()
                         throws RepositoryException
Returns the String specified upon disabling this user or null if isDisabled() returns false.

Returns:
The reason specified upon disabling this user or null if this user is not disabled.
Throws:
RepositoryException


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.