uk.org.ogsadai.client.toolkit.sessions
Class SessionID

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.sessions.SessionID

public class SessionID
extends java.lang.Object

An object use to identify a particular session.

This consists of a prefixed identifier string with a value that is guaranteed to be unique within the scope of a single JVM.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  java.lang.String mIdentifier
           
static java.lang.String PREFIX
          Prefix for all session ID identifier strings.
 
Constructor Summary
SessionID()
          Creates a new SessionID that is guaranteed to be unique within the context of a JVM.
SessionID(java.lang.String identifier)
          Creates a new SessionID with the specified identifier string.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares the specified object with this session identifier for equality.
 int hashCode()
          Return a hash code for this object.
 java.lang.String toString()
          Returns the session identifier string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mIdentifier

private final java.lang.String mIdentifier

PREFIX

public static final java.lang.String PREFIX
Prefix for all session ID identifier strings.

See Also:
Constant Field Values
Constructor Detail

SessionID

public SessionID()
Creates a new SessionID that is guaranteed to be unique within the context of a JVM.


SessionID

public SessionID(java.lang.String identifier)
Creates a new SessionID with the specified identifier string. This constructor should only be used to recreate a SessionID representing an existing session.

Parameters:
identifier - The identifier string for a session.
Throws:
java.lang.IllegalArgumentException - if the identifier parameter is null.
Method Detail

toString

public java.lang.String toString()
Returns the session identifier string.

Overrides:
toString in class java.lang.Object
Returns:
session identifier string.

equals

public boolean equals(java.lang.Object obj)
Compares the specified object with this session identifier for equality.

Equality is determined by ensuring the object is a SessionID then performing a "value comparison" of the session identifier string.

Overrides:
equals in class java.lang.Object
Returns:
true if the specified object is a non-null SessionID with an identifier string equal to this session identifier.
See Also:
String.equals(java.lang.Object)

hashCode

public int hashCode()
Return a hash code for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code.
See Also:
String.hashCode()