- java.lang.Object
-
- com.sun.security.auth.NTUserPrincipal
-
- All Implemented Interfaces:
Serializable,Principal
public class NTUserPrincipal extends Object implements Principal, Serializable
This class implements thePrincipalinterface and represents a Windows NT user.Principals such as this
NTUserPrincipalmay be associated with a particularSubjectto augment thatSubjectwith an additional identity. Refer to theSubjectclass for more information on how to achieve this. Authorization decisions can then be based upon the Principals associated with aSubject.- See Also:
Principal,Subject, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NTUserPrincipal(String name)Create anNTUserPrincipalwith a Windows NT username.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Compares the specified Object with thisNTUserPrincipalfor equality.StringgetName()Return the Windows NT username for thisNTPrincipal.inthashCode()Return a hash code for thisNTUserPrincipal.StringtoString()Return a string representation of thisNTPrincipal.
-
-
-
Constructor Detail
-
NTUserPrincipal
public NTUserPrincipal(String name)
Create anNTUserPrincipalwith a Windows NT username.- Parameters:
name- the Windows NT username for this user.- Throws:
NullPointerException- if thenameisnull.
-
-
Method Detail
-
getName
public String getName()
Return the Windows NT username for thisNTPrincipal.
-
toString
public String toString()
Return a string representation of thisNTPrincipal.
-
equals
public boolean equals(Object o)
Compares the specified Object with thisNTUserPrincipalfor equality. Returns true if the given object is also aNTUserPrincipaland the two NTUserPrincipals have the same name.- Specified by:
equalsin interfacePrincipal- Overrides:
equalsin classObject- Parameters:
o- Object to be compared for equality with thisNTPrincipal.- Returns:
- true if the specified Object is equal to this
NTPrincipal. - See Also:
Object.hashCode()
-
hashCode
public int hashCode()
Return a hash code for thisNTUserPrincipal.- Specified by:
hashCodein interfacePrincipal- Overrides:
hashCodein classObject- Returns:
- a hash code for this
NTUserPrincipal. - See Also:
Object.equals(java.lang.Object)
-
-