org.alfresco.repo.security.authentication
Class DefaultMutableAuthenticationDao

java.lang.Object
  extended by org.alfresco.repo.security.authentication.DefaultMutableAuthenticationDao
All Implemented Interfaces:
net.sf.acegisecurity.providers.dao.AuthenticationDao, net.sf.acegisecurity.providers.dao.SaltSource, MutableAuthenticationDao

public class DefaultMutableAuthenticationDao
extends java.lang.Object
implements MutableAuthenticationDao

An authority DAO that has no implementation. By default it will throw an exception if any method is called. Any of the getter/setter methods can be enabled with a no action implementation. This can support deleting users via the UI for LDAP and NTLM. The Alfresco person object is deleted from the UI. The call to delete the user will return with no action. The following methods will always fail. getMD4HashedPassword(String userName) loadUserByUsername(String arg0) getSalt(UserDetails user)


Constructor Summary
DefaultMutableAuthenticationDao()
           
 
Method Summary
 void createUser(java.lang.String userName, char[] rawPassword)
          Create a user with the given userName and password If enabled does nothing.
 void deleteUser(java.lang.String userName)
          Delete a user.
 boolean getAccountExpires(java.lang.String userName)
          Does the account expire? If enabled returns false.
 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? If enabled returns false.
 boolean getAccountlocked(java.lang.String userName)
          Is the account locked? If enabled returns false.
 boolean getCredentialsExpire(java.lang.String userName)
          Do the credentials for the user expire? If enabled returns false.
 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? If enabled returns false.
 boolean getEnabled(java.lang.String userName)
          Getter for user enabled If enabled returns true.
 java.lang.String getMD4HashedPassword(java.lang.String userName)
          Get the MD4 password hash Always throws an exception.
 java.lang.Object getSalt(net.sf.acegisecurity.UserDetails user)
          Return salt for user Always throws an exception.
 net.sf.acegisecurity.UserDetails loadUserByUsername(java.lang.String arg0)
          Return the user details for the specified user Always throws an exception.
 void setAccountExpires(java.lang.String userName, boolean expires)
          Set if the account should expire If enabled does nothing.
 void setAccountExpiryDate(java.lang.String userName, java.util.Date exipryDate)
          Set the date on which the account expires If enabled does nothing.
 void setAllowCreateUser(boolean allowCreateUser)
           
 void setAllowDeleteUser(boolean allowDeleteUser)
           
 void setAllowGetAccountExpiryDate(boolean allowGetAccountExpiryDate)
           
 void setAllowGetAccountHasExpired(boolean allowGetAccountHasExpired)
           
 void setAllowGetAccountLocked(boolean allowGetAccountLocked)
           
 void setAllowGetCredentialsExpire(boolean allowGetCredentialsExpire)
           
 void setAllowGetCredentialsExpiryDate(boolean allowGetCredentialsExpiryDate)
           
 void setAllowGetCredentialsHaveExpired(boolean allowGetCredentialsHaveExpired)
           
 void setAllowGetEnabled(boolean allowGetEnabled)
           
 void setAllowSetAccountExpires(boolean allowSetAccountExpires)
           
 void setAllowSetAccountExpiryDate(boolean allowSetAccountExpiryDate)
           
 void setAllowSetAccountLocked(boolean allowSetAccountLocked)
           
 void setAllowSetCredentialsExpire(boolean allowSetCredentialsExpire)
           
 void setAllowSetCredentialsExpiryDate(boolean allowSetCredentialsExpiryDate)
           
 void setAllowSetEnabled(boolean allowSetEnabled)
           
 void setAllowUpdateUser(boolean allowUpdateUser)
           
 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 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

DefaultMutableAuthenticationDao

public DefaultMutableAuthenticationDao()
Method Detail

createUser

public void createUser(java.lang.String userName,
                       char[] rawPassword)
                throws org.alfresco.repo.security.authentication.AuthenticationException
Create a user with the given userName and password If enabled does nothing.

Specified by:
createUser in interface MutableAuthenticationDao
Parameters:
userName -
rawPassword -
Throws:
AuthenticationException

updateUser

public void updateUser(java.lang.String userName,
                       char[] rawPassword)
                throws org.alfresco.repo.security.authentication.AuthenticationException
Update a user's password. If enabled does nothing.

Specified by:
updateUser in interface MutableAuthenticationDao
Parameters:
userName -
rawPassword -
Throws:
AuthenticationException

deleteUser

public void deleteUser(java.lang.String userName)
                throws org.alfresco.repo.security.authentication.AuthenticationException
Delete a user. If enabled does nothing.

Specified by:
deleteUser in interface MutableAuthenticationDao
Parameters:
userName -
Throws:
AuthenticationException

userExists

public boolean userExists(java.lang.String userName)
Check is a user exists. If enabled returns true.

Specified by:
userExists in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

setEnabled

public void setEnabled(java.lang.String userName,
                       boolean enabled)
Enable/disable a user. If enabled does nothing.

Specified by:
setEnabled in interface MutableAuthenticationDao
Parameters:
userName -
enabled -

getEnabled

public boolean getEnabled(java.lang.String userName)
Getter for user enabled If enabled returns true.

Specified by:
getEnabled in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

setAccountExpires

public void setAccountExpires(java.lang.String userName,
                              boolean expires)
Set if the account should expire If enabled does nothing.

Specified by:
setAccountExpires in interface MutableAuthenticationDao
Parameters:
userName -
expires -

getAccountExpires

public boolean getAccountExpires(java.lang.String userName)
Does the account expire? If enabled returns false.

Specified by:
getAccountExpires in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

getAccountHasExpired

public boolean getAccountHasExpired(java.lang.String userName)
Has the account expired? If enabled returns false.

Specified by:
getAccountHasExpired in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

setCredentialsExpire

public void setCredentialsExpire(java.lang.String userName,
                                 boolean expires)
Set if the password expires. If enabled does nothing.

Specified by:
setCredentialsExpire in interface MutableAuthenticationDao
Parameters:
userName -
expires -

getCredentialsExpire

public boolean getCredentialsExpire(java.lang.String userName)
Do the credentials for the user expire? If enabled returns false.

Specified by:
getCredentialsExpire in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

getCredentialsHaveExpired

public boolean getCredentialsHaveExpired(java.lang.String userName)
Have the credentials for the user expired? If enabled returns false.

Specified by:
getCredentialsHaveExpired in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

setLocked

public void setLocked(java.lang.String userName,
                      boolean locked)
Set if the account is locked. If enabled does nothing.

Specified by:
setLocked in interface MutableAuthenticationDao
Parameters:
userName -
locked -

getAccountlocked

public boolean getAccountlocked(java.lang.String userName)
Is the account locked? If enabled returns false.

Specified by:
getAccountlocked in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

setAccountExpiryDate

public void setAccountExpiryDate(java.lang.String userName,
                                 java.util.Date exipryDate)
Set the date on which the account expires If enabled does nothing.

Specified by:
setAccountExpiryDate in interface MutableAuthenticationDao
Parameters:
userName -
exipryDate -

getAccountExpiryDate

public java.util.Date getAccountExpiryDate(java.lang.String userName)
Get the date when this account expires. If enabled returns null.

Specified by:
getAccountExpiryDate in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

setCredentialsExpiryDate

public void setCredentialsExpiryDate(java.lang.String userName,
                                     java.util.Date exipryDate)
Set the date when credentials expire. If enabled does nothing.

Specified by:
setCredentialsExpiryDate in interface MutableAuthenticationDao
Parameters:
userName -
exipryDate -

getCredentialsExpiryDate

public java.util.Date getCredentialsExpiryDate(java.lang.String userName)
Get the date when the credentials/password expire. If enabled returns null.

Specified by:
getCredentialsExpiryDate in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

getMD4HashedPassword

public java.lang.String getMD4HashedPassword(java.lang.String userName)
Get the MD4 password hash Always throws an exception.

Specified by:
getMD4HashedPassword in interface MutableAuthenticationDao
Parameters:
userName -
Returns:

loadUserByUsername

public net.sf.acegisecurity.UserDetails loadUserByUsername(java.lang.String arg0)
                                                    throws net.sf.acegisecurity.providers.dao.UsernameNotFoundException,
                                                           org.springframework.dao.DataAccessException
Return the user details for the specified user Always throws an exception.

Specified by:
loadUserByUsername in interface net.sf.acegisecurity.providers.dao.AuthenticationDao
Parameters:
user - String
Returns:
UserDetails
Throws:
net.sf.acegisecurity.providers.dao.UsernameNotFoundException
org.springframework.dao.DataAccessException

getSalt

public java.lang.Object getSalt(net.sf.acegisecurity.UserDetails user)
Return salt for user Always throws an exception.

Specified by:
getSalt in interface net.sf.acegisecurity.providers.dao.SaltSource
Parameters:
user - UserDetails
Returns:
Object

setAllowCreateUser

public void setAllowCreateUser(boolean allowCreateUser)

setAllowDeleteUser

public void setAllowDeleteUser(boolean allowDeleteUser)

setAllowGetAccountExpiryDate

public void setAllowGetAccountExpiryDate(boolean allowGetAccountExpiryDate)

setAllowGetAccountHasExpired

public void setAllowGetAccountHasExpired(boolean allowGetAccountHasExpired)

setAllowGetAccountLocked

public void setAllowGetAccountLocked(boolean allowGetAccountLocked)

setAllowGetCredentialsExpire

public void setAllowGetCredentialsExpire(boolean allowGetCredentialsExpire)

setAllowGetCredentialsExpiryDate

public void setAllowGetCredentialsExpiryDate(boolean allowGetCredentialsExpiryDate)

setAllowGetCredentialsHaveExpired

public void setAllowGetCredentialsHaveExpired(boolean allowGetCredentialsHaveExpired)

setAllowGetEnabled

public void setAllowGetEnabled(boolean allowGetEnabled)

setAllowSetAccountExpires

public void setAllowSetAccountExpires(boolean allowSetAccountExpires)

setAllowSetAccountExpiryDate

public void setAllowSetAccountExpiryDate(boolean allowSetAccountExpiryDate)

setAllowSetAccountLocked

public void setAllowSetAccountLocked(boolean allowSetAccountLocked)

setAllowSetCredentialsExpire

public void setAllowSetCredentialsExpire(boolean allowSetCredentialsExpire)

setAllowSetCredentialsExpiryDate

public void setAllowSetCredentialsExpiryDate(boolean allowSetCredentialsExpiryDate)

setAllowSetEnabled

public void setAllowSetEnabled(boolean allowSetEnabled)

setAllowUpdateUser

public void setAllowUpdateUser(boolean allowUpdateUser)


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