com.imaginary.lwp
Class Identifier
java.lang.Object
|
+--com.imaginary.lwp.Identifier
- public class Identifier
- extends java.lang.Object
- implements java.io.Serializable
A client token for identifying itself to the server. When a user
logs in to the system successfully, the client is provided with
an Identifier
instance that it passes back to the
server any time it is involved in a transaction. The server then
uses that identifier to validate access to the resource in question.
Last modified $Date: 1999/10/06 03:19:11 $
- Version:
- $Revision: 1.2 $
- Author:
- George Reese (borg@imaginary.com)
- See Also:
- Serialized Form
Constructor Summary |
Identifier()
Empty constructor required by serialization. |
Method Summary |
static Identifier |
currentIdentifier()
Provides a client application with its identifier so that
it can pass it to a transactional method. |
boolean |
equals(java.lang.Object ob)
|
java.lang.String |
getUserID()
|
int |
hashCode()
A hash code based on the key. |
static void |
login(java.lang.String uid,
java.lang.String pw)
Authenticates the specified user ID against the specified password. |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Identifier
public Identifier()
- Empty constructor required by serialization.
currentIdentifier
public static Identifier currentIdentifier()
- Provides a client application with its identifier so that
it can pass it to a transactional method.
- Returns:
- the current client identifier
login
public static void login(java.lang.String uid,
java.lang.String pw)
throws AuthenticationException
- Authenticates the specified user ID against the specified password.
This method finds the server and sends the user ID and password
to it for authentication. If the password does not match the
currently stored password, then an exception is thrown. Otherwise
it will store the identifier the server hands back.
- Parameters:
uid
- the user ID of the person using the systempw
- the password of the user to use for authentication- Throws:
- AuthenticationException - the login attempt
failed
equals
public boolean equals(java.lang.Object ob)
- Parameters:
the
- object to compare to- Returns:
- true if the object is an
Identifier
and it
shares the same key as this object - Overrides:
- equals in class java.lang.Object
getUserID
public java.lang.String getUserID()
- Returns:
- the user ID associated with this identifier
hashCode
public int hashCode()
- A hash code based on the key.
- Overrides:
- hashCode in class java.lang.Object