org.alfresco.repo.security.authentication
Class RepositoryAuthenticationDao

java.lang.Object
  extended by org.alfresco.repo.security.authentication.RepositoryAuthenticationDao
All Implemented Interfaces:
net.sf.acegisecurity.providers.dao.AuthenticationDao, net.sf.acegisecurity.providers.dao.SaltSource, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, ClassPolicy, Policy, MutableAuthenticationDao, org.springframework.beans.factory.InitializingBean

public class RepositoryAuthenticationDao
extends java.lang.Object
implements MutableAuthenticationDao, org.springframework.beans.factory.InitializingBean, NodeServicePolicies.OnUpdatePropertiesPolicy, NodeServicePolicies.BeforeDeleteNodePolicy

Component to provide authentication using native Alfresco authentication

Since:
1.2

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Field Summary
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAME
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
RepositoryAuthenticationDao()
           
 
Method Summary
 void afterPropertiesSet()
           
 void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Called before a node is deleted.
 void createUser(java.lang.String caseSensitiveUserName, char[] rawPassword)
          Create a user with the given userName and password
 void deleteUser(java.lang.String userName)
          Delete a user.
 boolean getAccountExpires(java.lang.String userName)
          Does the account expire?
 java.util.Date getAccountExpiryDate(java.lang.String userName)
          Get the date when this account expires.
 boolean getAccountHasExpired(java.lang.String userName)
          Has the account expired?
 boolean getAccountlocked(java.lang.String userName)
          Is the account locked?
 boolean getCredentialsExpire(java.lang.String userName)
          Do the credentials for the user expire?
 java.util.Date getCredentialsExpiryDate(java.lang.String userName)
          Get the date when the credentials/password expire.
 boolean getCredentialsHaveExpired(java.lang.String userName)
          Have the credentials for the user expired?
 boolean getEnabled(java.lang.String userName)
          Getter for user enabled
 boolean getLocked(java.lang.String userName)
          Check if the account is locked
 java.lang.String getMD4HashedPassword(java.lang.String userName)
          Get the MD4 password hash
 java.lang.Object getSalt(net.sf.acegisecurity.UserDetails userDetails)
           
 org.alfresco.service.cmr.repository.NodeRef getUserOrNull(java.lang.String searchUserName)
           
 net.sf.acegisecurity.UserDetails loadUserByUsername(java.lang.String incomingUserName)
           
 void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Map before, java.util.Map after)
          Called after a node's properties have been changed.
 void setAccountExpires(java.lang.String userName, boolean expires)
          Set if the account should expire
 void setAccountExpiryDate(java.lang.String userName, java.util.Date exipryDate)
          Set the date on which the account expires
 void setAuthenticationCache(org.alfresco.repo.cache.SimpleCache authenticationCache)
           
 void setAuthorityService(AuthorityService authorityService)
           
 void setCredentialsExpire(java.lang.String userName, boolean expires)
          Set if the password expires.
 void setCredentialsExpiryDate(java.lang.String userName, java.util.Date exipryDate)
          Set the date when credentials expire.
 void setEnabled(java.lang.String userName, boolean enabled)
          Enable/disable a user.
 void setLocked(java.lang.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 setPasswordEncoder(net.sf.acegisecurity.providers.encoding.PasswordEncoder passwordEncoder)
           
 void setPolicyComponent(PolicyComponent policyComponent)
           
 void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
           
 void updateUser(java.lang.String userName, char[] rawPassword)
          Update a user's password.
 boolean userExists(java.lang.String userName)
          Check is a user exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryAuthenticationDao

public RepositoryAuthenticationDao()
Method Detail

setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)

setAuthorityService

public void setAuthorityService(AuthorityService authorityService)

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)

setTenantService

public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)

setPasswordEncoder

public void setPasswordEncoder(net.sf.acegisecurity.providers.encoding.PasswordEncoder passwordEncoder)

setPolicyComponent

public void setPolicyComponent(PolicyComponent policyComponent)

setAuthenticationCache

public void setAuthenticationCache(org.alfresco.repo.cache.SimpleCache authenticationCache)

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

loadUserByUsername

public net.sf.acegisecurity.UserDetails loadUserByUsername(java.lang.String incomingUserName)
                                                    throws net.sf.acegisecurity.providers.dao.UsernameNotFoundException,
                                                           org.springframework.dao.DataAccessException
Specified by:
loadUserByUsername in interface net.sf.acegisecurity.providers.dao.AuthenticationDao
Throws:
net.sf.acegisecurity.providers.dao.UsernameNotFoundException
org.springframework.dao.DataAccessException

getUserOrNull

public org.alfresco.service.cmr.repository.NodeRef getUserOrNull(java.lang.String searchUserName)

createUser

public void createUser(java.lang.String caseSensitiveUserName,
                       char[] rawPassword)
                throws org.alfresco.repo.security.authentication.AuthenticationException
Description copied from interface: MutableAuthenticationDao
Create a user with the given userName and password

Specified by:
createUser in interface MutableAuthenticationDao
Throws:
org.alfresco.repo.security.authentication.AuthenticationException

updateUser

public void updateUser(java.lang.String userName,
                       char[] rawPassword)
                throws org.alfresco.repo.security.authentication.AuthenticationException
Description copied from interface: MutableAuthenticationDao
Update a user's password.

Specified by:
updateUser in interface MutableAuthenticationDao
Throws:
org.alfresco.repo.security.authentication.AuthenticationException

deleteUser

public void deleteUser(java.lang.String userName)
                throws org.alfresco.repo.security.authentication.AuthenticationException
Description copied from interface: MutableAuthenticationDao
Delete a user.

Specified by:
deleteUser in interface MutableAuthenticationDao
Throws:
org.alfresco.repo.security.authentication.AuthenticationException

getSalt

public java.lang.Object getSalt(net.sf.acegisecurity.UserDetails userDetails)
Specified by:
getSalt in interface net.sf.acegisecurity.providers.dao.SaltSource

userExists

public boolean userExists(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Check is a user exists.

Specified by:
userExists in interface MutableAuthenticationDao

getAccountExpires

public boolean getAccountExpires(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Does the account expire?

Specified by:
getAccountExpires in interface MutableAuthenticationDao

getAccountExpiryDate

public java.util.Date getAccountExpiryDate(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Get the date when this account expires.

Specified by:
getAccountExpiryDate in interface MutableAuthenticationDao

getAccountHasExpired

public boolean getAccountHasExpired(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Has the account expired?

Specified by:
getAccountHasExpired in interface MutableAuthenticationDao

getLocked

public boolean getLocked(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Check if the account is locked

Specified by:
getLocked in interface MutableAuthenticationDao
Parameters:
userName - the username

getAccountlocked

public boolean getAccountlocked(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Is the account locked?

Specified by:
getAccountlocked in interface MutableAuthenticationDao

getCredentialsExpire

public boolean getCredentialsExpire(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Do the credentials for the user expire?

Specified by:
getCredentialsExpire in interface MutableAuthenticationDao

getCredentialsExpiryDate

public java.util.Date getCredentialsExpiryDate(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Get the date when the credentials/password expire.

Specified by:
getCredentialsExpiryDate in interface MutableAuthenticationDao

getCredentialsHaveExpired

public boolean getCredentialsHaveExpired(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Have the credentials for the user expired?

Specified by:
getCredentialsHaveExpired in interface MutableAuthenticationDao

getEnabled

public boolean getEnabled(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Getter for user enabled

Specified by:
getEnabled in interface MutableAuthenticationDao

setAccountExpires

public void setAccountExpires(java.lang.String userName,
                              boolean expires)
Description copied from interface: MutableAuthenticationDao
Set if the account should expire

Specified by:
setAccountExpires in interface MutableAuthenticationDao

setAccountExpiryDate

public void setAccountExpiryDate(java.lang.String userName,
                                 java.util.Date exipryDate)
Description copied from interface: MutableAuthenticationDao
Set the date on which the account expires

Specified by:
setAccountExpiryDate in interface MutableAuthenticationDao

setCredentialsExpire

public void setCredentialsExpire(java.lang.String userName,
                                 boolean expires)
Description copied from interface: MutableAuthenticationDao
Set if the password expires.

Specified by:
setCredentialsExpire in interface MutableAuthenticationDao

setCredentialsExpiryDate

public void setCredentialsExpiryDate(java.lang.String userName,
                                     java.util.Date exipryDate)
Description copied from interface: MutableAuthenticationDao
Set the date when credentials expire.

Specified by:
setCredentialsExpiryDate in interface MutableAuthenticationDao

setEnabled

public void setEnabled(java.lang.String userName,
                       boolean enabled)
Description copied from interface: MutableAuthenticationDao
Enable/disable a user.

Specified by:
setEnabled in interface MutableAuthenticationDao

setLocked

public void setLocked(java.lang.String userName,
                      boolean locked)
Description copied from interface: MutableAuthenticationDao
Set if the account is locked.

Specified by:
setLocked in interface MutableAuthenticationDao

getMD4HashedPassword

public java.lang.String getMD4HashedPassword(java.lang.String userName)
Description copied from interface: MutableAuthenticationDao
Get the MD4 password hash

Specified by:
getMD4HashedPassword in interface MutableAuthenticationDao

onUpdateProperties

public void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                               java.util.Map before,
                               java.util.Map after)
Description copied from interface: NodeServicePolicies.OnUpdatePropertiesPolicy
Called after a node's properties have been changed.

Specified by:
onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
Parameters:
nodeRef - reference to the updated node
before - the node's properties before the change
after - the node's properties after the change

beforeDeleteNode

public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: NodeServicePolicies.BeforeDeleteNodePolicy
Called before a node is deleted.

Specified by:
beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicy
Parameters:
nodeRef - the node reference


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.