public class ExternalUserManager extends Object implements UserManager
ANONYMOUS_USER, SYSTEM_PSWD, SYSTEM_USER
Constructor and Description |
---|
ExternalUserManager() |
Modifier and Type | Method and Description |
---|---|
User |
addGroup(User user,
String groupName)
Adds user to a group.
|
User |
addRole(User user,
String roleName)
Grants user role.
|
User |
changePassword(User user,
String newPassword)
Sets a new password.
|
User |
createUser(String name,
String pw)
Creates a user without security restrictions.
|
User |
createUser(String path,
String name,
String pw)
Creates a user on given path.
|
Map<String,ACL> |
getACLs(User user) |
Collection<User> |
getAllUsers()
Get all users.
|
User |
getAnonymousUser()
SystemUserManager does this.
|
int |
getLockTimePeriod()
Gets a time period for account lock.
|
int |
getMaxFailedLoginAttempts()
Gets a number of failed attempts before locking account.
|
User |
getSystemUser()
SystemUserManager does this.
|
User |
getUser(Map<String,String> properties,
GroupList groupList,
RoleList roleList) |
User |
getUser(String name)
Find a specific user.
|
User |
getUser(Subject subject)
Initialize new user using JAAS authenticated/authorized subject.
|
User |
getUserById(String id)
Find a specific user.
|
Collection<String> |
getUsersWithGroup(String groupName)
Default implementation for external userManagers.
|
Collection<String> |
getUsersWithGroup(String groupName,
boolean transitive)
Returns all users which are in the provided group.
|
Collection<String> |
getUsersWithRole(String roleName)
Default implementation for external userManagers.
|
boolean |
hasAny(String name,
String roleName,
String nodeRoles) |
User |
removeGroup(User user,
String groupName)
Removes user from a group.
|
User |
removeRole(User user,
String roleName)
Removes role from a user.
|
void |
setLockTimePeriod(int lockTimePeriod)
Sets a time period for account lock.
|
void |
setMaxFailedLoginAttempts(int maxFailedLoginAttempts)
Sets a number of failed attempts before locking account.
|
User |
setProperty(User user,
String propertyName,
String propertyValue)
Sets given property for the user and returns updated user object with new value of the property.
|
User |
setProperty(User user,
String propertyName,
javax.jcr.Value propertyValue)
Sets given property for the user.
|
void |
updateLastAccessTimestamp(User user)
Updates last access timestamp for the user.
|
public User getUser(String name) throws UnsupportedOperationException
UserManager
getUser
in interface UserManager
name
- the name of the userUnsupportedOperationException
public User getUserById(String id) throws UnsupportedOperationException
UserManager
getUserById
in interface UserManager
id
- user identifierUnsupportedOperationException
public User getUser(Subject subject) throws UnsupportedOperationException
getUser
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic Collection<User> getAllUsers() throws UnsupportedOperationException
UserManager
getAllUsers
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User createUser(String name, String pw) throws UnsupportedOperationException
UserManager
createUser
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User createUser(String path, String name, String pw) throws UnsupportedOperationException
UserManager
createUser
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User changePassword(User user, String newPassword) throws UnsupportedOperationException
UserManager
changePassword
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User getSystemUser() throws UnsupportedOperationException
getSystemUser
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic User getAnonymousUser() throws UnsupportedOperationException
getAnonymousUser
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic void updateLastAccessTimestamp(User user) throws UnsupportedOperationException
UserManager
updateLastAccessTimestamp
in interface UserManager
UnsupportedOperationException
- if the current implementation doesn't support this operationpublic boolean hasAny(String name, String roleName, String nodeRoles) throws UnsupportedOperationException
hasAny
in interface UserManager
name
- name of the principalroleName
- either group or role namenodeRoles
- either group or role seeUnsupportedOperationException
public Map<String,ACL> getACLs(User user)
getACLs
in interface UserManager
public User addRole(User user, String roleName)
UserManager
addRole
in interface UserManager
public User addGroup(User user, String groupName)
UserManager
addGroup
in interface UserManager
public int getLockTimePeriod()
UserManager
getLockTimePeriod
in interface UserManager
public int getMaxFailedLoginAttempts()
UserManager
getMaxFailedLoginAttempts
in interface UserManager
public void setLockTimePeriod(int lockTimePeriod)
UserManager
setLockTimePeriod
in interface UserManager
public void setMaxFailedLoginAttempts(int maxFailedLoginAttempts)
UserManager
setMaxFailedLoginAttempts
in interface UserManager
public User setProperty(User user, String propertyName, javax.jcr.Value propertyValue)
UserManager
setProperty
in interface UserManager
user
- User to be updated. If property doesn't exist yet, it will be created. If the value is null, property will be removed if existing.propertyName
- Name of the property.propertyValue
- Value of the property. Use org.apache.jackrabbit.value.ValueFactoryImpl to convert type to Value.public User setProperty(User user, String propertyName, String propertyValue)
UserManager
setProperty
in interface UserManager
public User removeGroup(User user, String groupName)
UserManager
removeGroup
in interface UserManager
public User removeRole(User user, String roleName)
UserManager
removeRole
in interface UserManager
public Collection<String> getUsersWithGroup(String groupName, boolean transitive)
UserManager
getUsersWithGroup
in interface UserManager
groupName
- name of the grouptransitive
- whether the method should return also users which are in transitive groups of the given group.public Collection<String> getUsersWithGroup(String groupName)
getUsersWithGroup
in interface UserManager
groupName
- name of the grouppublic Collection<String> getUsersWithRole(String roleName)
getUsersWithRole
in interface UserManager
Copyright © 2003–2015 Magnolia International Ltd.. All rights reserved.