Package org.teiid.client.security
Class SessionToken
- java.lang.Object
-
- org.teiid.client.security.SessionToken
-
- All Implemented Interfaces:
Externalizable
,Serializable
public class SessionToken extends Object implements Externalizable
This class is an immutable identifier for a unique session that also maintains the name of the principal for that session. Since this class can be used to authenticate a user, it must be secure in transit if sent to the client. Also it should only be sent to the client who creates the session.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SessionToken()
SessionToken(long id, String userName)
Used by tests to control the session idSessionToken(String userName)
The primary constructor that specifies userName
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getSessionID()
Returns unique session identifierString
getUsername()
Get the principal name for this session's user.void
readExternal(ObjectInput in)
String
toString()
Returns a string representing the current state of the object.void
writeExternal(ObjectOutput out)
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SessionToken
public SessionToken()
-
SessionToken
public SessionToken(long id, String userName)
Used by tests to control the session id- Parameters:
id
-userName
-
-
SessionToken
public SessionToken(String userName)
The primary constructor that specifies userName- Parameters:
userName
- (String) the userName for this session
-
-
Method Detail
-
getSessionID
public String getSessionID()
Returns unique session identifier- Returns:
- the session ID
-
getUsername
public String getUsername()
Get the principal name for this session's user.- Returns:
- the user name
-
toString
public String toString()
Returns a string representing the current state of the object.
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
-