public class RepositoryAuthenticationDao extends Object implements MutableAuthenticationDao, org.springframework.beans.factory.InitializingBean, NodeServicePolicies.OnUpdatePropertiesPolicy, NodeServicePolicies.BeforeDeleteNodePolicy
Policy.Arg| Modifier and Type | Field and Description |
|---|---|
protected AuthorityService |
authorityService |
protected CompositePasswordEncoder |
compositePasswordEncoder |
protected org.alfresco.service.namespace.NamespacePrefixResolver |
namespacePrefixResolver |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService |
protected PolicyComponent |
policyComponent |
protected org.alfresco.repo.tenant.TenantService |
tenantService |
ARG_0, ARG_1, ARG_2, QNAMEQNAME| Constructor and Description |
|---|
RepositoryAuthenticationDao() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Called before a node is deleted.
|
void |
createUser(String caseSensitiveUserName,
char[] rawPassword)
Create a user with the given userName and password
|
void |
createUser(String caseSensitiveUserName,
String hashedPassword,
char[] rawPassword)
Create a user with the given userName and password hash
If hashedPassword is passed in then this is used, otherwise it falls back to using the rawPassword.
|
void |
deleteUser(String userName)
Delete a user.
|
static org.alfresco.util.Pair<List<String>,String> |
determinePasswordHash(Map<org.alfresco.service.namespace.QName,Serializable> properties)
Retrieves the password hash for the given user properties.
|
boolean |
getAccountExpires(String userName)
Does the account expire?
|
Date |
getAccountExpiryDate(String userName)
Get the date when this account expires.
|
boolean |
getAccountHasExpired(String userName)
Has the account expired?
|
boolean |
getAccountlocked(String userName)
Is the account locked?
|
boolean |
getCredentialsExpire(String userName)
Do the credentials for the user expire?
|
protected boolean |
getCredentialsExpire(String userName,
Map<org.alfresco.service.namespace.QName,Serializable> properties) |
Date |
getCredentialsExpiryDate(String userName)
Get the date when the credentials/password expire.
|
boolean |
getCredentialsHaveExpired(String userName)
Have the credentials for the user expired?
|
protected boolean |
getCredentialsHaveExpired(String userName,
Map<org.alfresco.service.namespace.QName,Serializable> properties,
Boolean isAdminAuthority) |
boolean |
getEnabled(String userName)
Getter for user enabled
|
protected boolean |
getEnabled(String userName,
Map<org.alfresco.service.namespace.QName,Serializable> properties,
Boolean isAdminAuthority) |
protected boolean |
getHasExpired(String userName,
Map<org.alfresco.service.namespace.QName,Serializable> properties,
Boolean isAdminAuthority) |
boolean |
getLocked(String userName)
Check if the account is locked
|
protected boolean |
getLocked(String userName,
Map<org.alfresco.service.namespace.QName,Serializable> properties,
Boolean isAdminAuthority) |
String |
getMD4HashedPassword(String userName)
Get the MD4 password hash
|
Object |
getSalt(net.sf.acegisecurity.UserDetails userDetails) |
org.alfresco.service.cmr.repository.NodeRef |
getUserOrNull(String caseSensitiveSearchUserName) |
protected Map<org.alfresco.service.namespace.QName,Serializable> |
getUserProperties(String userName) |
net.sf.acegisecurity.UserDetails |
loadUserByUsername(String incomingUserName) |
void |
onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> after)
Called after a node's properties have been changed.
|
void |
onUpdateUserProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> after) |
void |
setAccountExpires(String userName,
boolean expires)
Set if the account should expire
|
void |
setAccountExpiryDate(String userName,
Date exipryDate)
Set the date on which the account expires
|
void |
setAuthenticationCache(org.alfresco.repo.cache.SimpleCache<String,org.alfresco.repo.security.authentication.RepositoryAuthenticationDao.CacheEntry> authenticationCache) |
void |
setAuthorityService(AuthorityService authorityService) |
void |
setCompositePasswordEncoder(CompositePasswordEncoder compositePasswordEncoder) |
void |
setCredentialsExpire(String userName,
boolean expires)
Set if the password expires.
|
void |
setCredentialsExpiryDate(String userName,
Date exipryDate)
Set the date when credentials expire.
|
void |
setEnabled(String userName,
boolean enabled)
Enable/disable a user.
|
void |
setLocked(String userName,
boolean locked)
Set if the account is locked.
|
void |
setNamespaceService(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setSingletonCache(org.alfresco.repo.cache.SimpleCache<String,org.alfresco.service.cmr.repository.NodeRef> singletonCache) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
setTransactionService(TransactionService transactionService) |
void |
updateUser(String userName,
char[] rawPassword)
Update a user's password.
|
boolean |
userExists(String userName)
Check is a user exists.
|
protected AuthorityService authorityService
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected org.alfresco.repo.tenant.TenantService tenantService
protected org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver
protected PolicyComponent policyComponent
protected CompositePasswordEncoder compositePasswordEncoder
public void setNamespaceService(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
public void setAuthorityService(AuthorityService authorityService)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public void setSingletonCache(org.alfresco.repo.cache.SimpleCache<String,org.alfresco.service.cmr.repository.NodeRef> singletonCache)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setAuthenticationCache(org.alfresco.repo.cache.SimpleCache<String,org.alfresco.repo.security.authentication.RepositoryAuthenticationDao.CacheEntry> authenticationCache)
public void setTransactionService(TransactionService transactionService)
public void setCompositePasswordEncoder(CompositePasswordEncoder compositePasswordEncoder)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic net.sf.acegisecurity.UserDetails loadUserByUsername(String incomingUserName) throws net.sf.acegisecurity.providers.dao.UsernameNotFoundException, org.springframework.dao.DataAccessException
loadUserByUsername in interface net.sf.acegisecurity.providers.dao.AuthenticationDaonet.sf.acegisecurity.providers.dao.UsernameNotFoundExceptionorg.springframework.dao.DataAccessExceptionpublic org.alfresco.service.cmr.repository.NodeRef getUserOrNull(String caseSensitiveSearchUserName)
caseSensitiveSearchUserName - case sensitive user namepublic static org.alfresco.util.Pair<List<String>,String> determinePasswordHash(Map<org.alfresco.service.namespace.QName,Serializable> properties)
properties - The properties of the user.public void createUser(String caseSensitiveUserName, char[] rawPassword) throws org.alfresco.repo.security.authentication.AuthenticationException
MutableAuthenticationDaocreateUser in interface MutableAuthenticationDaoorg.alfresco.repo.security.authentication.AuthenticationExceptionpublic void createUser(String caseSensitiveUserName, String hashedPassword, char[] rawPassword) throws org.alfresco.repo.security.authentication.AuthenticationException
MutableAuthenticationDaocreateUser in interface MutableAuthenticationDaoorg.alfresco.repo.security.authentication.AuthenticationExceptionpublic void updateUser(String userName, char[] rawPassword) throws org.alfresco.repo.security.authentication.AuthenticationException
MutableAuthenticationDaoupdateUser in interface MutableAuthenticationDaoorg.alfresco.repo.security.authentication.AuthenticationExceptionpublic void deleteUser(String userName) throws org.alfresco.repo.security.authentication.AuthenticationException
MutableAuthenticationDaodeleteUser in interface MutableAuthenticationDaoorg.alfresco.repo.security.authentication.AuthenticationExceptionpublic Object getSalt(net.sf.acegisecurity.UserDetails userDetails)
getSalt in interface net.sf.acegisecurity.providers.dao.SaltSourcepublic boolean userExists(String userName)
MutableAuthenticationDaouserExists in interface MutableAuthenticationDaoprotected Map<org.alfresco.service.namespace.QName,Serializable> getUserProperties(String userName)
public boolean getAccountExpires(String userName)
MutableAuthenticationDaogetAccountExpires in interface MutableAuthenticationDaopublic Date getAccountExpiryDate(String userName)
MutableAuthenticationDaogetAccountExpiryDate in interface MutableAuthenticationDaopublic boolean getAccountHasExpired(String userName)
MutableAuthenticationDaogetAccountHasExpired in interface MutableAuthenticationDaoprotected boolean getHasExpired(String userName, Map<org.alfresco.service.namespace.QName,Serializable> properties, Boolean isAdminAuthority)
userName - the usernameproperties - user properties or null to fetch thempublic boolean getLocked(String userName)
MutableAuthenticationDaogetLocked in interface MutableAuthenticationDaouserName - the usernamepublic boolean getAccountlocked(String userName)
MutableAuthenticationDaogetAccountlocked in interface MutableAuthenticationDaoprotected boolean getLocked(String userName, Map<org.alfresco.service.namespace.QName,Serializable> properties, Boolean isAdminAuthority)
userName - the usernameproperties - user properties or null to fetch thempublic boolean getCredentialsExpire(String userName)
MutableAuthenticationDaogetCredentialsExpire in interface MutableAuthenticationDaoprotected boolean getCredentialsExpire(String userName, Map<org.alfresco.service.namespace.QName,Serializable> properties)
userName - the usernameproperties - user properties or null to fetch thempublic Date getCredentialsExpiryDate(String userName)
MutableAuthenticationDaogetCredentialsExpiryDate in interface MutableAuthenticationDaopublic boolean getCredentialsHaveExpired(String userName)
MutableAuthenticationDaogetCredentialsHaveExpired in interface MutableAuthenticationDaoprotected boolean getCredentialsHaveExpired(String userName, Map<org.alfresco.service.namespace.QName,Serializable> properties, Boolean isAdminAuthority)
userName - the username (never nullproperties - the properties associated with the user or null to get themisAdminAuthority - is admin authoritypublic boolean getEnabled(String userName)
MutableAuthenticationDaogetEnabled in interface MutableAuthenticationDaoprotected boolean getEnabled(String userName, Map<org.alfresco.service.namespace.QName,Serializable> properties, Boolean isAdminAuthority)
userName - the usernameproperties - the user's properties or nullpublic void setAccountExpires(String userName, boolean expires)
MutableAuthenticationDaosetAccountExpires in interface MutableAuthenticationDaopublic void setAccountExpiryDate(String userName, Date exipryDate)
MutableAuthenticationDaosetAccountExpiryDate in interface MutableAuthenticationDaopublic void setCredentialsExpire(String userName, boolean expires)
MutableAuthenticationDaosetCredentialsExpire in interface MutableAuthenticationDaopublic void setCredentialsExpiryDate(String userName, Date exipryDate)
MutableAuthenticationDaosetCredentialsExpiryDate in interface MutableAuthenticationDaopublic void setEnabled(String userName, boolean enabled)
MutableAuthenticationDaosetEnabled in interface MutableAuthenticationDaopublic void setLocked(String userName, boolean locked)
MutableAuthenticationDaosetLocked in interface MutableAuthenticationDaopublic String getMD4HashedPassword(String userName)
MutableAuthenticationDaogetMD4HashedPassword in interface MutableAuthenticationDaopublic void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> after)
NodeServicePolicies.OnUpdatePropertiesPolicyonUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicynodeRef - reference to the updated nodebefore - the node's properties before the changeafter - the node's properties after the changepublic void onUpdateUserProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> after)
public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeServicePolicies.BeforeDeleteNodePolicybeforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicynodeRef - the node referenceCopyright © 2005–2018 Alfresco Software. All rights reserved.