org.apache.jetspeed.security.spi.impl
Class DefaultCredentialHandler

java.lang.Object
  extended by org.apache.jetspeed.security.spi.impl.DefaultCredentialHandler
All Implemented Interfaces:
CredentialHandler

public class DefaultCredentialHandler
extends java.lang.Object
implements CredentialHandler

Author:
David Le Strat
See Also:
CredentialHandler

Constructor Summary
DefaultCredentialHandler(SecurityAccess securityAccess, PasswordCredentialProvider pcProvider, InternalPasswordCredentialInterceptor ipcInterceptor)
           
 
Method Summary
 boolean authenticate(java.lang.String userName, java.lang.String password)
           Authenticate a user.
 java.util.Set getPrivateCredentials(java.lang.String username)
           Gets the private credentials for the user.
 java.util.Set getPublicCredentials(java.lang.String username)
           Gets the public credentials for the user.
 void importPassword(java.lang.String userName, java.lang.String newPassword)
           Adds or updates a private password credential.
Note that there is no checking of the oldPassword and the provided password is assumed to be encoded.
 void setPassword(java.lang.String userName, java.lang.String oldPassword, java.lang.String newPassword)
           Adds or updates a private password credential.
If oldPassword is not null, the oldPassword will first be checked (authenticated).
protected  void setPassword(java.lang.String userName, java.lang.String oldPassword, java.lang.String newPassword, boolean raw)
           
 void setPasswordEnabled(java.lang.String userName, boolean enabled)
           Set the enabled state of the user password credential.
 void setPasswordExpiration(java.lang.String userName, java.sql.Date expirationDate)
           Set the expiration date and the expired flag of the password credential.
 void setPasswordUpdateRequired(java.lang.String userName, boolean updateRequired)
           Set the update required state of the user password credential.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCredentialHandler

public DefaultCredentialHandler(SecurityAccess securityAccess,
                                PasswordCredentialProvider pcProvider,
                                InternalPasswordCredentialInterceptor ipcInterceptor)
Method Detail

getPrivateCredentials

public java.util.Set getPrivateCredentials(java.lang.String username)
Description copied from interface: CredentialHandler

Gets the private credentials for the user.

Specified by:
getPrivateCredentials in interface CredentialHandler
Parameters:
username - The username.
Returns:
The set of private credentials.
See Also:
CredentialHandler.getPrivateCredentials(java.lang.String)

getPublicCredentials

public java.util.Set getPublicCredentials(java.lang.String username)
Description copied from interface: CredentialHandler

Gets the public credentials for the user.

Specified by:
getPublicCredentials in interface CredentialHandler
Parameters:
username - The username.
Returns:
The set of public credentials.
See Also:
CredentialHandler.getPublicCredentials(java.lang.String)

setPassword

public void setPassword(java.lang.String userName,
                        java.lang.String oldPassword,
                        java.lang.String newPassword)
                 throws SecurityException
Description copied from interface: CredentialHandler

Adds or updates a private password credential.
If oldPassword is not null, the oldPassword will first be checked (authenticated).

Specified by:
setPassword in interface CredentialHandler
oldPassword - The old password.
newPassword - The new password.
Throws:
SecurityException - Throws a SecurityException.
See Also:
CredentialHandler.setPassword(java.lang.String,java.lang.String,java.lang.String)

importPassword

public void importPassword(java.lang.String userName,
                           java.lang.String newPassword)
                    throws SecurityException
Description copied from interface: CredentialHandler

Adds or updates a private password credential.
Note that there is no checking of the oldPassword and the provided password is assumed to be encoded. Hence no encoding will take place.

Specified by:
importPassword in interface CredentialHandler
newPassword - The new password.
Throws:
SecurityException - Throws a SecurityException.
See Also:
CredentialHandler.importPassword(java.lang.String,java.lang.String)

setPassword

protected void setPassword(java.lang.String userName,
                           java.lang.String oldPassword,
                           java.lang.String newPassword,
                           boolean raw)
                    throws SecurityException
Throws:
SecurityException
See Also:
org.apache.jetspeed.security.spi.CredentialHandler#setPassword(java.lang.String,java.lang.String,java.lang.String, boolean)

setPasswordEnabled

public void setPasswordEnabled(java.lang.String userName,
                               boolean enabled)
                        throws SecurityException
Description copied from interface: CredentialHandler

Set the enabled state of the user password credential.

Specified by:
setPasswordEnabled in interface CredentialHandler
Parameters:
userName - The user name.
enabled - The enabled state.
Throws:
SecurityException
See Also:
CredentialHandler.setPasswordEnabled(java.lang.String, boolean)

setPasswordUpdateRequired

public void setPasswordUpdateRequired(java.lang.String userName,
                                      boolean updateRequired)
                               throws SecurityException
Description copied from interface: CredentialHandler

Set the update required state of the user password credential.

Specified by:
setPasswordUpdateRequired in interface CredentialHandler
Parameters:
userName - The user name.
updateRequired - The update required state.
Throws:
SecurityException
See Also:
CredentialHandler.setPasswordUpdateRequired(java.lang.String, boolean)

setPasswordExpiration

public void setPasswordExpiration(java.lang.String userName,
                                  java.sql.Date expirationDate)
                           throws SecurityException
Description copied from interface: CredentialHandler

Set the expiration date and the expired flag of the password credential.

If a date equal or before the current date is provided, the expired flag will be set to true, otherwise to false.

Specified by:
setPasswordExpiration in interface CredentialHandler
Parameters:
userName - The user name.
expirationDate - The expiration date to set.
Throws:
SecurityException
See Also:
CredentialHandler.setPasswordExpiration(java.lang.String, java.sql.Date)

authenticate

public boolean authenticate(java.lang.String userName,
                            java.lang.String password)
                     throws SecurityException
Description copied from interface: CredentialHandler

Authenticate a user.

Specified by:
authenticate in interface CredentialHandler
Parameters:
userName - The user name.
password - The user password.
Returns:
Whether or not a user is authenticated.
Throws:
SecurityException
See Also:
CredentialHandler.authenticate(java.lang.String, java.lang.String)


Copyright © 1999-2010 Apache Software Foundation. All Rights Reserved.