com.ibm.wsspi.wssecurity.auth.token
Class UsernameToken

java.lang.Object
  extended bycom.ibm.wsspi.wssecurity.auth.token.WSSToken
      extended bycom.ibm.wsspi.wssecurity.auth.token.UsernameToken
All Implemented Interfaces:
java.lang.Cloneable, com.ibm.wsspi.security.token.PropagationToken, Token, com.ibm.wsspi.security.token.Token

public class UsernameToken
extends WSSToken

This class is a token object implementation for a username token that stores the username and password information of the token. It extends the WSSToken class, which implements the Token class. It will typically be created by the UsernameTokenGenerator and process by the UsernameTokenConsumer.


Nested Class Summary
 
Nested classes inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
WSSToken.AttributesEnumerator
 
Field Summary
 
Fields inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
_attributes, _callerChecked, _error, _keyInfoType, _processed, _referenced, _tokenelem, _tokenId, _trusted, _usedTokenConsumer, _usedTokenGenerator, _usedToLogin, _version, _vtype
 
Constructor Summary
UsernameToken(java.lang.String tokenId, java.lang.String username, char[] password)
          Constructor using a username and password.
UsernameToken(java.lang.String tokenId, java.lang.String username, char[] password, org.w3c.dom.Element elem)
          Constructor using a username, password and token element.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.Date getDate()
          Returns created date.
 long getExpiration()
           
 char[] getPassword()
          Returns the password char array.
 java.lang.String getPrincipal()
           
 java.lang.String getUniqueID()
           
 java.lang.String getUsername()
          Returns the username string.
 int hashCode()
           
 boolean isReadOnly()
           
 boolean isValid()
           
 void setDate(java.util.Date date)
          Sets created date.
 void setExpiration(long expiration)
           
 void setPassword(char[] password)
          Sets the username string.
 void setReadOnly()
           
 void setUsername(java.lang.String username)
          Sets the username string.
 java.lang.String toString()
           
 
Methods inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
addAttribute, clone, getAttributeNames, getAttributes, getBytes, getCallerChecked, getElement, getError, getId, getKeyInfoType, getName, getType, getUsedTokenConsumer, getUsedTokenGenerator, getUsedToLogin, getVersion, isForwardable, isProcessed, isReferenced, isTrusted, setCallerChecked, setElement, setError, setId, setKeyInfoType, setProcessed, setReferenced, setTrusted, setType, setType, setUsedTokenConsumer, setUsedTokenGenerator, setUsedToLogin
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UsernameToken

public UsernameToken(java.lang.String tokenId,
                     java.lang.String username,
                     char[] password)
Constructor using a username and password.

Parameters:
tokenId - The token ID
username - The username string
password - The password as a char[]; may be null if the token does not have a password

UsernameToken

public UsernameToken(java.lang.String tokenId,
                     java.lang.String username,
                     char[] password,
                     org.w3c.dom.Element elem)
Constructor using a username, password and token element.

Parameters:
tokenId - The token ID
username - The username string
password - The password as a char[]; may be null if the token does not have a password
elem - The token element
Method Detail

setDate

public void setDate(java.util.Date date)
Sets created date.

Parameters:
date - The created date

getDate

public java.util.Date getDate()
Returns created date.

Returns:
Date The created date

setUsername

public void setUsername(java.lang.String username)
Sets the username string.


getUsername

public java.lang.String getUsername()
Returns the username string.

Returns:
String The username

setPassword

public void setPassword(char[] password)
Sets the username string.


getPassword

public char[] getPassword()
Returns the password char array.

Returns:
char[] The password

getExpiration

public long getExpiration()

setExpiration

public void setExpiration(long expiration)

isReadOnly

public boolean isReadOnly()

setReadOnly

public void setReadOnly()

getPrincipal

public java.lang.String getPrincipal()

getUniqueID

public java.lang.String getUniqueID()

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)

isValid

public boolean isValid()

toString

public java.lang.String toString()