org.apache.jetspeed.security.om
Interface InternalCredential

All Superinterfaces:
Cloneable, Serializable

public interface InternalCredential
extends Serializable, Cloneable

Interface representing a security credential.

The credential value represents the value of the credential such as a password.

For now, we do not have custom credentials classes and credentials support only 1 credential (i.e. 1 password).

The credential type represents whether a credential is private or public:

The credential classname represent the class of credential.

TODO Add multiple credentials support.

Version:
$Id: InternalCredential.java 516448 2007-03-09 16:25:47Z ate $
Author:
David Le Strat

Field Summary
static Date MAX_DATE
          Maximum allowed java.sql.Date value (according to the specs).
static int PRIVATE
          Private credentials type.
static int PUBLIC
          Public credentials type.
 
Method Summary
 int getAuthenticationFailures()
          Getter for the current number of authentication failures in a row.
 String getClassname()
          Getter for the principal classname.
 Timestamp getCreationDate()
          Getter for creation date.
 long getCredentialId()
          Getter for the credential id.
 Date getExpirationDate()
          Getter for the expiration date.
 Timestamp getLastAuthenticationDate()
          Getter for the last authentication date
 Timestamp getModifiedDate()
          Getter for the modified date.
 Timestamp getPreviousAuthenticationDate()
          Getter for the previous authentication date
 long getPrincipalId()
          Getter for the principal id.
 int getType()
          Getter for the credential type.
 String getValue()
          Getter for the credential value.
 boolean isEnabled()
          Getter for the enabled state
 boolean isEncoded()
          Getter for the encoded state
 boolean isExpired()
          Getter for the expired state.
 boolean isUpdateRequired()
          Getter for the update required state
 void setAuthenticationFailures(int authenticationFailures)
          Setter for the number of authentication failures
 void setClassname(String classname)
          Setter for the principal classname.
 void setCreationDate(Timestamp creationDate)
          Setter for the creation date.
 void setCredentialId(long credentialId)
          Setter for the credential id.
 void setEnabled(boolean enabled)
          Setter for the enabled state
 void setEncoded(boolean encoded)
          Setter for the encoded state
 void setExpirationDate(Date expirationDate)
          Setter for the expiration date.
 void setExpired(boolean expired)
          Setter for the expired state.
 void setLastAuthenticationDate(Timestamp lastAuthenticationDate)
          Setter for the last authentication date
 void setModifiedDate(Timestamp modifiedDate)
          Setter for the modified date.
 void setPreviousAuthenticationDate(Timestamp previousAuthenticationDate)
          Setter for the previous authentication date
 void setPrincipalId(long principalId)
          Setter for the principal id.
 void setType(int type)
          Setter for the credential type.
 void setUpdateRequired(boolean updateRequired)
          Setter for the update required state
 void setValue(String value)
          Setter for the credential value.
 

Field Detail

PRIVATE

static final int PRIVATE
Private credentials type.

See Also:
Constant Field Values

PUBLIC

static final int PUBLIC
Public credentials type.

See Also:
Constant Field Values

MAX_DATE

static final Date MAX_DATE
Maximum allowed java.sql.Date value (according to the specs). Note:
The concrete value is default time zone dependent and should only be used for setting Date fields, not to compare against.

Method Detail

getCredentialId

long getCredentialId()

Getter for the credential id.

Returns:
The credential id.

setCredentialId

void setCredentialId(long credentialId)

Setter for the credential id.

Parameters:
credentialId - The credential id.

getPrincipalId

long getPrincipalId()

Getter for the principal id.

Returns:
The principal id.

setPrincipalId

void setPrincipalId(long principalId)

Setter for the principal id.

Parameters:
principalId - The principal id.

getValue

String getValue()

Getter for the credential value.

Returns:
The credential value.

setValue

void setValue(String value)

Setter for the credential value.

Parameters:
value - The credential value.

isUpdateRequired

boolean isUpdateRequired()

Getter for the update required state

Returns:
true if required

setUpdateRequired

void setUpdateRequired(boolean updateRequired)

Setter for the update required state

Parameters:
updateRequired - the update required state

isEncoded

boolean isEncoded()

Getter for the encoded state

Returns:
true if encoded

setEncoded

void setEncoded(boolean encoded)
Setter for the encoded state

Parameters:
encoded - The encoded state

isEnabled

boolean isEnabled()

Getter for the enabled state

Returns:
true if enabled

setEnabled

void setEnabled(boolean enabled)
Setter for the enabled state

Parameters:
enabled - The enabled state

getAuthenticationFailures

int getAuthenticationFailures()

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

  • -1: never tried yet
  • 0: none, or last attempt was successful
  • >0: number of failures

Returns:
The number of authentication failures

setAuthenticationFailures

void setAuthenticationFailures(int authenticationFailures)

Setter for the number of authentication failures

Parameters:
authenticationFailures - The number of authentication failures

isExpired

boolean isExpired()
Getter for the expired state.

Returns:
true if expired

setExpired

void setExpired(boolean expired)
Setter for the expired state.

Parameters:
expired - The expired state

getExpirationDate

Date getExpirationDate()

Getter for the expiration date.

Returns:
The expiration date.

setExpirationDate

void setExpirationDate(Date expirationDate)

Setter for the expiration date.

Parameters:
expirationDate - The expiration date.

getType

int getType()

Getter for the credential type.

  • Private credential: type == 0
  • Public credential: type == 1

Returns:
The credential type.

setType

void setType(int type)

Setter for the credential type.

  • Private credential: type == 0
  • Public credential: type == 1

Parameters:
type - The credential type.

getClassname

String getClassname()

Getter for the principal classname.

Returns:
The principal classname.

setClassname

void setClassname(String classname)

Setter for the principal classname.

Parameters:
classname - The principal classname.

getCreationDate

Timestamp getCreationDate()

Getter for creation date.

Returns:
The creation date.

setCreationDate

void setCreationDate(Timestamp creationDate)

Setter for the creation date.

Parameters:
creationDate - The creation date.

getModifiedDate

Timestamp getModifiedDate()

Getter for the modified date.

Returns:
The modified date.

setModifiedDate

void setModifiedDate(Timestamp modifiedDate)

Setter for the modified date.

Parameters:
modifiedDate - The modified date.

getPreviousAuthenticationDate

Timestamp getPreviousAuthenticationDate()

Getter for the previous authentication date

Returns:
The previous authentication date.

setPreviousAuthenticationDate

void setPreviousAuthenticationDate(Timestamp previousAuthenticationDate)

Setter for the previous authentication date

Parameters:
previousAuthenticationDate - The previous authentication date.

getLastAuthenticationDate

Timestamp getLastAuthenticationDate()

Getter for the last authentication date

Returns:
The last authentication date.

setLastAuthenticationDate

void setLastAuthenticationDate(Timestamp lastAuthenticationDate)

Setter for the last authentication date

Parameters:
lastAuthenticationDate - The last authentication date.


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