Top Description Fields Constructors Methods
com.sun.security.auth

public Class NTDomainPrincipal

extends Object
implements Principal, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.security.Principal
Imports
java.io.IOException, .InvalidObjectException, .ObjectInputStream, java.security.Principal

This class implements the Principal interface and represents the name of the Windows NT domain into which the user authenticated. This will be a domain name if the user logged into a Windows NT domain, a workgroup name if the user logged into a workgroup, or a machine name if the user logged into a standalone configuration.

Principals such as this NTDomainPrincipal may be associated with a particular Subject to augment that Subject with an additional identity. Refer to the Subject class for more information on how to achieve this. Authorization decisions can then be based upon the Principals associated with a Subject.

Since
1.4
See Also
java.security.Principal, javax.security.auth.Subject

Field Summary

Modifier and TypeField and Description
private String
private static final long

Constructor Summary

AccessConstructor and Description
public
NTDomainPrincipal(String
the Windows NT domain name for this user.
name
)

Create an NTDomainPrincipal with a Windows NT domain name.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the specified Object is equal to this NTDomainPrincipal.
equals
(Object
Object to be compared for equality with this NTDomainPrincipal.
o
)

Overrides java.lang.Object.equals.

Implements java.security.Principal.equals.

Compares the specified Object with this NTDomainPrincipal for equality.

public String

Returns:

the Windows NT domain name for this NTDomainPrincipal
getName
()

Implements java.security.Principal.getName.

Return the Windows NT domain name for this NTDomainPrincipal.

public int

Returns:

a hash code for this NTDomainPrincipal.
hashCode
()

Overrides java.lang.Object.hashCode.

Implements java.security.Principal.hashCode.

Return a hash code for this NTDomainPrincipal.

private void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
stream
)

Restores the state of this object from the stream.

public String

Returns:

a string representation of this NTDomainPrincipal.
toString
()

Overrides java.lang.Object.toString.

Implements java.security.Principal.toString.

Return a string representation of this NTDomainPrincipal.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private String name
serialVersionUIDback to summary
private static final long serialVersionUID
Annotations
@Serial

Constructor Detail

NTDomainPrincipalback to summary
public NTDomainPrincipal(String name)

Create an NTDomainPrincipal with a Windows NT domain name.

Parameters
name:String

the Windows NT domain name for this user.

Exceptions
NullPointerException:
if the name is null.

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements java.security.Principal.equals.

Compares the specified Object with this NTDomainPrincipal for equality. Returns true if the given object is also a NTDomainPrincipal and the two NTDomainPrincipals have the same name.

Parameters
o:Object

Object to be compared for equality with this NTDomainPrincipal.

Returns:boolean

true if the specified Object is equal to this NTDomainPrincipal.

getNameback to summary
public String getName()

Implements java.security.Principal.getName.

Return the Windows NT domain name for this NTDomainPrincipal.

Returns:String

the Windows NT domain name for this NTDomainPrincipal

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.security.Principal.hashCode.

Return a hash code for this NTDomainPrincipal.

Returns:int

a hash code for this NTDomainPrincipal.

readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Restores the state of this object from the stream.

Parameters
stream:ObjectInputStream

the ObjectInputStream from which data is read

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a serialized class cannot be loaded
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements java.security.Principal.toString.

Return a string representation of this NTDomainPrincipal.

Returns:String

a string representation of this NTDomainPrincipal.