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

java.lang.Object
  extended by org.apache.jetspeed.security.spi.impl.DefaultPasswordCredentialImpl
All Implemented Interfaces:
java.io.Serializable, PasswordCredential

public class DefaultPasswordCredentialImpl
extends java.lang.Object
implements PasswordCredential, java.io.Serializable

Default Password credential implementation. Provides the same mechanism as J2EE javax.resource.spi.security.PasswordCredential.

Code borrowed from the Geronimo project.

Author:
David Le Strat
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.jetspeed.security.PasswordCredential
PASSWORD_CREDENTIAL_DAYS_VALID_REQUEST_ATTR_KEY
 
Constructor Summary
DefaultPasswordCredentialImpl(java.lang.String userName, char[] password)
           
DefaultPasswordCredentialImpl(java.lang.String userName, InternalCredential credential)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getAuthenticationFailures()
          Getter for the current number of authentication failures in a row.
 java.sql.Date getExpirationDate()
           
 java.sql.Timestamp getLastAuthenticationDate()
           
 char[] getPassword()
           
 java.sql.Timestamp getPreviousAuthenticationDate()
           
 java.lang.String getUserName()
           
 int hashCode()
           
 boolean isEnabled()
           
 boolean isExpired()
           
 boolean isUpdateRequired()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPasswordCredentialImpl

public DefaultPasswordCredentialImpl(java.lang.String userName,
                                     char[] password)
Parameters:
userName -
password -

DefaultPasswordCredentialImpl

public DefaultPasswordCredentialImpl(java.lang.String userName,
                                     InternalCredential credential)
Method Detail

getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface PasswordCredential
Returns:
The username.

getPassword

public char[] getPassword()
Specified by:
getPassword in interface PasswordCredential
Returns:
The password.

isUpdateRequired

public boolean isUpdateRequired()
Specified by:
isUpdateRequired in interface PasswordCredential
Returns:
true if update required.
See Also:
PasswordCredential.isUpdateRequired()

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface PasswordCredential
Returns:
true if enabled.
See Also:
PasswordCredential.isEnabled()

isExpired

public boolean isExpired()
Specified by:
isExpired in interface PasswordCredential
Returns:
true if expired.
See Also:
PasswordCredential.isExpired()

getExpirationDate

public java.sql.Date getExpirationDate()
Specified by:
getExpirationDate in interface PasswordCredential
Returns:
when the password is (going to be) expired.
See Also:
PasswordCredential.getExpirationDate()

getPreviousAuthenticationDate

public java.sql.Timestamp getPreviousAuthenticationDate()
Specified by:
getPreviousAuthenticationDate in interface PasswordCredential
Returns:
the previous time the user logged in
See Also:
PasswordCredential.getPreviousAuthenticationDate()

getLastAuthenticationDate

public java.sql.Timestamp getLastAuthenticationDate()
Specified by:
getLastAuthenticationDate in interface PasswordCredential
Returns:
the last time the user logged in
See Also:
PasswordCredential.getLastAuthenticationDate()

getAuthenticationFailures

public int getAuthenticationFailures()
Description copied from interface: PasswordCredential

Getter for the current number of authentication failures in a row.

Specified by:
getAuthenticationFailures in interface PasswordCredential
Returns:
The number of authentication failures
See Also:
PasswordCredential.getAuthenticationFailures()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()


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