public class UserImpl extends Object implements User
Modifier and Type | Field and Description |
---|---|
static String |
AUTHORIZABLES_PATH |
static String |
GROUP_ADMIN_GROUP_NAME
Configuration key and default value for the the name of the
'GroupAdmin' group-principal
|
static String |
GROUPS_PATH |
static Name |
MIX_REP_IMPERSONATABLE |
static Name |
N_MEMBERS |
static NameFactory |
NF |
static Name |
NT_REP_AUTHORIZABLE |
static Name |
NT_REP_AUTHORIZABLE_FOLDER |
static Name |
NT_REP_GROUP |
static Name |
NT_REP_MEMBERS |
static Name |
NT_REP_USER |
static Name |
P_DISABLED |
static Name |
P_GROUPS
Deprecated.
As of 2.0 group membership is stored with the group node.
|
static Name |
P_IMPERSONATORS
Name of the user property containing the principal names of those allowed
to impersonate.
|
static Name |
P_MEMBERS |
static Name |
P_PASSWORD |
static Name |
P_PRINCIPAL_NAME |
static Name |
P_USERID
Deprecated.
As of 2.0 the id-hash is stored with the jcr:uuid making the
rep:userId property redundant. It has been removed from the node type
definition.
|
static String |
SECURITY_ROOT_PATH
root-path to security related content e.g.
|
static String |
USER_ADMIN_GROUP_NAME
Configuration key and default value for the the name of the
'UserAdmin' group-principal.
|
static String |
USERS_PATH |
Modifier | Constructor and Description |
---|---|
protected |
UserImpl(NodeImpl node,
UserManagerImpl userManager) |
Modifier and Type | Method and Description |
---|---|
void |
changePassword(String password)
Change the password of this user.
|
void |
changePassword(String password,
String oldPassword)
Change the password of this user.
|
Iterator<Group> |
declaredMemberOf() |
void |
disable(String reason)
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) . |
boolean |
equals(Object obj) |
javax.jcr.Credentials |
getCredentials()
Returns the internal
Credentials representation for this
user. |
String |
getDisabledReason()
|
String |
getID()
Returns the unescaped name of the node that defines this
Authorizable . |
Impersonation |
getImpersonation() |
String |
getPath()
Returns a JCR path if this authorizable instance is associated with an
item that can be accessed by the editing
Session . |
Principal |
getPrincipal() |
javax.jcr.Value[] |
getProperty(String relPath)
Returns the values for the properties with the specified name or
null . |
Iterator<String> |
getPropertyNames()
Returns the names of properties present with
this
Authorizable not taking possible relative paths into consideration. |
Iterator<String> |
getPropertyNames(String relPath)
Returns the names of properties present with
this
Authorizable at the specified relative path. |
int |
hashCode() |
boolean |
hasProperty(String relPath)
Tests if a the property with specified name exists.
|
boolean |
isAdmin() |
boolean |
isDisabled()
Returns
true if this user is disabled, false
otherwise. |
boolean |
isGroup() |
boolean |
isSystemUser() |
Iterator<Group> |
memberOf() |
void |
remove()
Removes this
Authorizable , if the session has sufficient
permissions. |
boolean |
removeProperty(String relPath)
Removes the property with the given name.
|
void |
setProperty(String relPath,
javax.jcr.Value value)
Sets the Value for the given name.
|
void |
setProperty(String relPath,
javax.jcr.Value[] values)
Sets the Value[] for the given name.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
declaredMemberOf, getID, getPath, getProperty, getPropertyNames, getPropertyNames, hasProperty, memberOf, remove, removeProperty, setProperty, setProperty
public static final NameFactory NF
public static final String SECURITY_ROOT_PATH
public static final String AUTHORIZABLES_PATH
public static final String USERS_PATH
public static final String GROUPS_PATH
public static final String USER_ADMIN_GROUP_NAME
public static final String GROUP_ADMIN_GROUP_NAME
public static final Name P_PRINCIPAL_NAME
public static final Name P_USERID
public static final Name P_PASSWORD
public static final Name P_DISABLED
public static final Name P_GROUPS
P_MEMBERS
public static final Name P_MEMBERS
public static final Name N_MEMBERS
public static final Name P_IMPERSONATORS
public static final Name NT_REP_AUTHORIZABLE
public static final Name NT_REP_AUTHORIZABLE_FOLDER
public static final Name NT_REP_USER
public static final Name NT_REP_GROUP
public static final Name NT_REP_MEMBERS
public static final Name MIX_REP_IMPERSONATABLE
protected UserImpl(NodeImpl node, UserManagerImpl userManager)
public boolean isGroup()
isGroup
in interface Authorizable
Group
Authorizable.isGroup()
public Principal getPrincipal() throws javax.jcr.RepositoryException
getPrincipal
in interface Authorizable
javax.jcr.RepositoryException
- If an error occurs.Authorizable.getPrincipal()
public boolean isAdmin()
isAdmin
in interface User
User.isAdmin()
public boolean isSystemUser()
isSystemUser
in interface User
public javax.jcr.Credentials getCredentials() throws javax.jcr.RepositoryException
User
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)
.getCredentials
in interface User
Credentials
for this user.javax.jcr.RepositoryException
- If an error occurs.User.getCredentials()
public Impersonation getImpersonation() throws javax.jcr.RepositoryException
getImpersonation
in interface User
Impersonation
for this User
.javax.jcr.RepositoryException
- If an error occurs.User.getImpersonation()
public void changePassword(String password) throws javax.jcr.RepositoryException
User
changePassword
in interface User
password
- The new password.javax.jcr.RepositoryException
- If an error occurs.User.changePassword(String)
public void changePassword(String password, String oldPassword) throws javax.jcr.RepositoryException
User
changePassword
in interface User
password
- The new password.oldPassword
- The old password.javax.jcr.RepositoryException
- If the old password doesn't match or if
an error occurs.User.changePassword(String, String)
public void disable(String reason) throws javax.jcr.RepositoryException
User
reason
is a non-null String.UserManager.getAuthorizable(java.lang.String)
.disable
in interface User
reason
- String describing the reason for disable this user or
null
if the user account should be enabled again.javax.jcr.RepositoryException
- If an error occurs.User.disable(String)
public boolean isDisabled() throws javax.jcr.RepositoryException
User
true
if this user is disabled, false
otherwise.isDisabled
in interface User
true
if this user is disabled, false
otherwise.javax.jcr.RepositoryException
- If an error occurs.User.isDisabled()
public String getDisabledReason() throws javax.jcr.RepositoryException
User
getDisabledReason
in interface User
null
if this user is not disabled.javax.jcr.RepositoryException
- If an error occurs.User.getDisabledReason()
public String getID() throws javax.jcr.RepositoryException
Authorizable
.getID
in interface Authorizable
Authorizable
.javax.jcr.RepositoryException
- if an error occurs.Authorizable.getID()
public Iterator<Group> declaredMemberOf() throws javax.jcr.RepositoryException
declaredMemberOf
in interface Authorizable
Group
s, this Authorizable is declared member of.javax.jcr.RepositoryException
- If an error occurs.Authorizable.declaredMemberOf()
public Iterator<Group> memberOf() throws javax.jcr.RepositoryException
memberOf
in interface Authorizable
Group
s, this Authorizable is member of included
indirect group membership.javax.jcr.RepositoryException
- If an error occurs.Authorizable.memberOf()
public Iterator<String> getPropertyNames() throws javax.jcr.RepositoryException
Authorizable
this
Authorizable not taking possible relative paths into consideration.
Same as Authorizable.getPropertyNames(String)
where the specified string
is ".".getPropertyNames
in interface Authorizable
javax.jcr.RepositoryException
- If an error occurs.Authorizable.getPropertyNames()
public Iterator<String> getPropertyNames(String relPath) throws javax.jcr.RepositoryException
Authorizable
this
Authorizable at the specified relative path.getPropertyNames
in interface Authorizable
relPath
- A relative path.javax.jcr.RepositoryException
- If an error occurs.Authorizable.getPropertyNames(String)
public boolean hasProperty(String relPath) throws javax.jcr.RepositoryException
Authorizable
hasProperty
in interface Authorizable
relPath
- The relative path to the property to be tested.true
if a property with the given name exists.javax.jcr.RepositoryException
- If an error occurs.getProperty(String)
public javax.jcr.Value[] getProperty(String relPath) throws javax.jcr.RepositoryException
Authorizable
null
.getProperty
in interface Authorizable
relPath
- Relative path of the property to be retrieved.null
if no such property exists.javax.jcr.RepositoryException
- If an error occurs.hasProperty(String)
,
Authorizable.getProperty(String)
public void setProperty(String relPath, javax.jcr.Value value) throws javax.jcr.RepositoryException
setProperty
in interface Authorizable
relPath
- The relative path to the property or the property name.value
- The property value.javax.jcr.RepositoryException
- If the specified name defines a property
that needs to be modified by this user API or setting the corresponding
JCR property fails.Authorizable.setProperty(String, Value)
public void setProperty(String relPath, javax.jcr.Value[] values) throws javax.jcr.RepositoryException
setProperty
in interface Authorizable
relPath
- The relative path to the property or the property name.values
- The property values.javax.jcr.RepositoryException
- If the specified name defines a property
that needs to be modified by this user API or setting the corresponding
JCR property fails.Authorizable.setProperty(String, Value[])
public boolean removeProperty(String relPath) throws javax.jcr.RepositoryException
Authorizable
removeProperty
in interface Authorizable
relPath
- Relative path (or name) of the property to be removed.javax.jcr.RepositoryException
- If an error occurs.Authorizable.removeProperty(String)
public void remove() throws javax.jcr.RepositoryException
Authorizable
Authorizable
, if the session has sufficient
permissions. Note, that removing an Authorizable
even
if it listed as member of a Group or if still has members (this is
a Group itself).remove
in interface Authorizable
javax.jcr.RepositoryException
- If an error occurred and the
Authorizable
could not be removed.Authorizable.remove()
public String getPath() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
Authorizable
Session
.
Throws UnsupportedRepositoryOperationException
if this
method is not supported or if there is no item associated with this
authorizable that is accessible by the editing Session
.
Throws RepositoryException
if another error occurs while
retrieving the path.
getPath
in interface Authorizable
Item
that corresponds to this
Authorizable
.javax.jcr.UnsupportedRepositoryOperationException
- If this method is not
supported or if there exists no accessible item associated with this
Authorizable
instance.javax.jcr.RepositoryException
- If an error occurs while retrieving the
Item
path.Authorizable.getPath()
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.