ajanta.security.acl
Class PrincipalImpl

java.lang.Object
  |
  +--ajanta.security.acl.PrincipalImpl
All Implemented Interfaces:
java.security.Principal, java.io.Serializable
Direct Known Subclasses:
GroupImpl

public class PrincipalImpl
extends java.lang.Object
implements java.security.Principal, java.io.Serializable

PrincipalImpl implements java.acl.Principal interface his interface represents a principal. A principal can be an individual, a corporation, a program thread; anything which can have an identity.

See Also:
AjantaIdentity, Serialized Form

Constructor Summary
PrincipalImpl(ajanta.util.AjantaIdentity identity)
          Constructs a Principal object from AjantaIdentity object
PrincipalImpl(java.lang.String identity)
          Constructs a Principal object from String object
PrincipalImpl(ajanta.naming.URN identity)
          Constructs a Principal object from URN object
 
Method Summary
 boolean equals(java.lang.Object another)
          Compares this principal to the specified object.
 java.lang.String getName()
          Returns the name of this principal.
 int hashCode()
          Returns a hashcode for this principal
 java.lang.String toString()
          Returns a string representation of this principal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrincipalImpl

public PrincipalImpl(ajanta.util.AjantaIdentity identity)
Constructs a Principal object from AjantaIdentity object

Parameters:
identity - - In ajanta all the identity is derived from Ajanta Identity class
See Also:
AjantaIdentity

PrincipalImpl

public PrincipalImpl(java.lang.String identity)
Constructs a Principal object from String object

Parameters:
identity - - String name of this principal will be stored as AjantaIdentiry which is a URN
See Also:
AjantaIdentity

PrincipalImpl

public PrincipalImpl(ajanta.naming.URN identity)
Constructs a Principal object from URN object

Parameters:
identity - - String name of this principal will be stored as AjantaIdentiry which is a URN
See Also:
AjantaIdentity
Method Detail

equals

public boolean equals(java.lang.Object another)
Compares this principal to the specified object. Returns true if the object passed in matches Currently it does not compare Public Key

Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object
Parameters:
another - - the principal to compare with
Returns:
true if the principal passed in is the same as that encapsulated by this principal, false otherwise.

toString

public java.lang.String toString()
Returns a string representation of this principal.

Specified by:
toString in interface java.security.Principal
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this principal.

hashCode

public int hashCode()
Returns a hashcode for this principal

Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode for this principal.

getName

public java.lang.String getName()
Returns the name of this principal.

Specified by:
getName in interface java.security.Principal
Returns:
the name of this principal.