com.sun.sgs.impl.auth
Class IdentityImpl

java.lang.Object
  extended by com.sun.sgs.impl.auth.IdentityImpl
All Implemented Interfaces:
Identity, Serializable
Direct Known Subclasses:
SystemIdentity

public class IdentityImpl
extends Object
implements Identity, Serializable

This is a basic implementation of Identity that maps a name to the identity.

See Also:
Serialized Form

Constructor Summary
IdentityImpl(String name)
          Creates an instance of Identity associated with the given name.
 
Method Summary
 boolean equals(Object o)
          
 String getName()
          Returns the name associated with this identity.
 int hashCode()
          
 void notifyLoggedIn()
          Notifies the system that this identity has logged in.
 void notifyLoggedOut()
          Notifies the system that this identity has logged out.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentityImpl

public IdentityImpl(String name)
Creates an instance of Identity associated with the given name.

Parameters:
name - the name of this identity
Method Detail

getName

public String getName()
Returns the name associated with this identity. This name must be unique within the application, and two identities with the same name must be equal.

Specified by:
getName in interface Identity
Returns:
the identity's name

notifyLoggedIn

public void notifyLoggedIn()
Notifies the system that this identity has logged in. Typically this is done shortly after authenticating the identity. Note that it is valid to authenticate an identity that does not log into the system.

Specified by:
notifyLoggedIn in interface Identity

notifyLoggedOut

public void notifyLoggedOut()
Notifies the system that this identity has logged out. Typically this is done after a client disconnects from the system.

Specified by:
notifyLoggedOut in interface Identity

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved