Build 1.0_r1(from source)

javax.security.auth
Class Subject

java.lang.Object
  extended by javax.security.auth.Subject
All Implemented Interfaces:
Serializable

public final class Subject
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
Subject()
           
Subject(boolean readOnly, Set<? extends Principal> subjPrincipals, Set<?> pubCredentials, Set<?> privCredentials)
           
 
Method Summary
static Object doAs(Subject subject, PrivilegedAction action)
           
static Object doAs(Subject subject, PrivilegedExceptionAction action)
           
static Object doAsPrivileged(Subject subject, PrivilegedAction action, AccessControlContext context)
           
static Object doAsPrivileged(Subject subject, PrivilegedExceptionAction action, AccessControlContext context)
           
 boolean equals(Object obj)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 Set<Principal> getPrincipals()
           
<T extends Principal>
Set<T>
getPrincipals(Class<T> c)
           
 Set<Object> getPrivateCredentials()
           
<T> Set<T>
getPrivateCredentials(Class<T> c)
           
 Set<Object> getPublicCredentials()
           
<T> Set<T>
getPublicCredentials(Class<T> c)
           
static Subject getSubject(AccessControlContext context)
           
 int hashCode()
          Returns an integer hash code for the receiver.
 boolean isReadOnly()
           
 void setReadOnly()
           
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Subject

public Subject()

Subject

public Subject(boolean readOnly,
               Set<? extends Principal> subjPrincipals,
               Set<?> pubCredentials,
               Set<?> privCredentials)
Method Detail

doAs

public static Object doAs(Subject subject,
                          PrivilegedAction action)

doAsPrivileged

public static Object doAsPrivileged(Subject subject,
                                    PrivilegedAction action,
                                    AccessControlContext context)

doAs

public static Object doAs(Subject subject,
                          PrivilegedExceptionAction action)
                   throws PrivilegedActionException
Throws:
PrivilegedActionException

doAsPrivileged

public static Object doAsPrivileged(Subject subject,
                                    PrivilegedExceptionAction action,
                                    AccessControlContext context)
                             throws PrivilegedActionException
Throws:
PrivilegedActionException

equals

public boolean equals(Object obj)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
obj - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

getPrincipals

public Set<Principal> getPrincipals()

getPrincipals

public <T extends Principal> Set<T> getPrincipals(Class<T> c)

getPrivateCredentials

public Set<Object> getPrivateCredentials()

getPrivateCredentials

public <T> Set<T> getPrivateCredentials(Class<T> c)

getPublicCredentials

public Set<Object> getPublicCredentials()

getPublicCredentials

public <T> Set<T> getPublicCredentials(Class<T> c)

hashCode

public int hashCode()
Description copied from class: Object
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

setReadOnly

public void setReadOnly()

isReadOnly

public boolean isReadOnly()

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

getSubject

public static Subject getSubject(AccessControlContext context)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature