API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.security.auth. Subject View Source
Author(s)
Since
Version
1.127, 11/17/05
Serial
Hierarchy
 Object
      Subject
Implements
 Serializable
Subclasses
Description
publicfinal class Subject
  A Subject represents a grouping of related information for a single entity, such as a person.
See also:    Principal DomainCombiner
Constructors
public Subject ()
  Create an instance of a Subject with an empty Set of Principals and empty Sets of public and private credentials.
public Subject (boolean readOnly, Set<Principal> principals, Set<Object> pubCredentials, Set<Object> privCredentials)
  Create an instance of a Subject with Principals and credentials.
Methods
Hide/Show inherited methods
publicstatic T doAs (Subject subject, PrivilegedAction< T> action)
  Perform work as a particular Subject.
publicstatic T doAs (Subject subject, PrivilegedExceptionAction< T> action) throws PrivilegedActionException
  Perform work as a particular Subject.
publicstatic T doAsPrivileged (Subject subject, PrivilegedAction< T> action, AccessControlContext acc)
  Perform privileged work as a particular Subject.
publicstatic T doAsPrivileged (Subject subject, PrivilegedExceptionAction< T> action, AccessControlContext acc) throws PrivilegedActionException
  Perform privileged work as a particular Subject.
public boolean equals (Object o)
  Compares the specified Object with this Subject for equality.
public Set<Principal> getPrincipals ()
  Return the Set of Principals associated with this Subject.
public Set< T> getPrincipals (Class< T> c)
  Return a Set of Principals associated with this Subject that are instances or subclasses of the specified Class.
public Set<Object> getPrivateCredentials ()
  Return the Set of private credentials held by this Subject.
public Set< T> getPrivateCredentials (Class< T> c)
  Return a Set of private credentials associated with this Subject that are instances or subclasses of the specified Class.
public Set<Object> getPublicCredentials ()
  Return the Set of public credentials held by this Subject.
public Set< T> getPublicCredentials (Class< T> c)
  Return a Set of public credentials associated with this Subject that are instances or subclasses of the specified Class.
publicstatic Subject getSubject (AccessControlContext acc)
  Get the Subject associated with the provided AccessControlContext.
public int hashCode ()
  Returns a hashcode for this Subject.
public boolean isReadOnly ()
  Query whether this Subject is read-only.
public void setReadOnly ()
  Set this Subject to be read-only.
public String toString ()
  Return the String representation of this Subject.
pack-private String toString (boolean includePrivateCredentials)
package private convenience method to print out the Subject without firing off a security check when trying to access the Private Credentials
Fields
Hide/Show inherited fields
pack-private Set principals
  A Set that provides a view of all of this Subject's Principals
pack-privatetransient Set privCredentials
pack-privatetransient Set pubCredentials
Sets that provide a view of all of this Subject's Credentials
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar