Lines Matching defs:Subject

45  * <p> A <code>Subject</code> represents a grouping of related information
47 * Such information includes the Subject's identities as well as
53 * within the <code>Subject</code>. Principals simply bind names to a
54 * <code>Subject</code>. For example, a <code>Subject</code> that happens
57 * to the <code>Subject</code>, and another which binds,
59 * to the <code>Subject</code>. Both Principals refer to the same
60 * <code>Subject</code> even though each has a different name.
62 * <p> A <code>Subject</code> may also own security-related attributes,
71 * <p> To retrieve all the Principals associated with a <code>Subject</code>,
73 * all the public or private credentials belonging to a <code>Subject</code>,
80 * Subject subject;
84 * // add a Principal and credential to the Subject
89 * <p> This <code>Subject</code> class implements <code>Serializable</code>.
90 * While the Principals associated with the <code>Subject</code> are serialized,
91 * the credentials associated with the <code>Subject</code> are not.
100 public final class Subject implements java.io.Serializable {
106 * Subject's Principals
112 * The set is a <code>Subject.SecureSet</code>.
118 * Subject's Credentials
124 * Whether this Subject is read-only
138 * Create an instance of a <code>Subject</code>
142 * <p> The newly constructed Sets check whether this <code>Subject</code>
154 public Subject() {
165 * Create an instance of a <code>Subject</code> with
170 * These newly created Sets check whether this <code>Subject</code>
183 * @param readOnly true if the <code>Subject</code> is to be read-only,
187 * to be associated with this <code>Subject</code>. <p>
190 * to be associated with this <code>Subject</code>. <p>
193 * to be associated with this <code>Subject</code>.
199 public Subject(boolean readOnly, Set<? extends Principal> principals,
219 * Set this <code>Subject</code> to be read-only.
221 * <p> Modifications (additions and removals) to this Subject's
224 * The <code>destroy</code> operation on this Subject's credentials will
227 * <p> Subsequent attempts to modify the Subject's <code>Principal</code>
230 * Also, once a <code>Subject</code> is read-only,
236 * to set this <code>Subject</code> to be read-only.
248 * Query whether this <code>Subject</code> is read-only.
252 * @return true if this <code>Subject</code> is read-only, false otherwise.
259 * Get the <code>Subject</code> associated with the provided
264 * In this situation, the most recent <code>Subject</code> associated
270 * the <code>Subject</code>.
272 * @return the <code>Subject</code> associated with the provided
274 * if no <code>Subject</code> is associated
278 * to get the <code>Subject</code>. <p>
283 public static Subject getSubject(final AccessControlContext acc) {
295 // return the Subject from the DomainCombiner of the provided context
297 (new java.security.PrivilegedAction<Subject>() {
298 public Subject run() {
309 * Perform work as a particular <code>Subject</code>.
317 * the provided <code>Subject</code>).
324 * @param subject the <code>Subject</code> that the specified
329 * <code>Subject</code>. <p>
340 public static <T> T doAs(final Subject subject,
351 // set up the new Subject-based AccessControlContext
362 * Perform work as a particular <code>Subject</code>.
370 * the provided <code>Subject</code>).
377 * @param subject the <code>Subject</code> that the specified
382 * <code>Subject</code>. <p>
398 public static <T> T doAs(final Subject subject,
411 // set up the new Subject-based AccessControlContext for doPrivileged
421 * Perform privileged work as a particular <code>Subject</code>.
423 * <p> This method behaves exactly as <code>Subject.doAs</code>,
433 * @param subject the <code>Subject</code> that the specified
438 * <code>Subject</code>. <p>
452 public static <T> T doAsPrivileged(final Subject subject,
465 // set up the new Subject-based AccessControlContext
479 * Perform privileged work as a particular <code>Subject</code>.
481 * <p> This method behaves exactly as <code>Subject.doAs</code>,
491 * @param subject the <code>Subject</code> that the specified
496 * <code>Subject</code>. <p>
515 public static <T> T doAsPrivileged(final Subject subject,
529 // set up the new Subject-based AccessControlContext for doPrivileged
541 private static AccessControlContext createContext(final Subject subject,
560 * <code>Subject</code>. Each <code>Principal</code> represents
561 * an identity for this <code>Subject</code>.
563 * <p> The returned <code>Set</code> is backed by this Subject's
571 * <code>Subject</code>.
582 * <code>Subject</code> that are instances or subclasses of the specified
585 * <p> The returned <code>Set</code> is not backed by this Subject's
615 * <code>Subject</code>.
617 * <p> The returned <code>Set</code> is backed by this Subject's
625 * <code>Subject</code>.
636 * <code>Subject</code>.
638 * <p> The returned <code>Set</code> is backed by this Subject's
657 * <code>Subject</code>.
676 * <code>Subject</code> that are instances or subclasses of the specified
679 * <p> The returned <code>Set</code> is not backed by this Subject's
709 * <code>Subject</code> that are instances or subclasses of the specified
716 * <p> The returned <code>Set</code> is not backed by this Subject's
753 * Compares the specified Object with this <code>Subject</code>
754 * for equality. Returns true if the given object is also a Subject
755 * and the two <code>Subject</code> instances are equivalent.
756 * More formally, two <code>Subject</code> instances are
763 * <code>Subject</code>.
766 * <code>Subject</code>.
769 * to access the private credentials for this <code>Subject</code>,
771 * private credentials for the provided <code>Subject</code>.
781 if (o instanceof Subject) {
783 final Subject that = (Subject)o;
818 * Return the String representation of this <code>Subject</code>.
822 * @return the String representation of this <code>Subject</code>.
829 * package private convenience method to print out the Subject
835 String s = ResourcesMgr.getString("Subject.");
879 * Returns a hashcode for this <code>Subject</code>.
883 * @return a hashcode for this <code>Subject</code>.
886 * to access this Subject's private credentials.
892 * hashcodes of this Subject's Principals and credentials.
969 * @serialField this$0 Subject The outer Subject instance.
973 new ObjectStreamField("this$0", Subject.class),
978 Subject subject;
993 SecureSet(Subject subject, int which) {
999 SecureSet(Subject subject, int which, Set<? extends E> set) {
1017 if (which != Subject.PRIV_CREDENTIAL_SET) {
1039 ("Subject.is.read.only"));
1045 case Subject.PRINCIPAL_SET:
1048 case Subject.PUB_CREDENTIAL_SET:
1065 (ResourcesMgr.getString("Subject.is.read.only"));
1071 case Subject.PRINCIPAL_SET:
1074 case Subject.PUB_CREDENTIAL_SET:
1084 case Subject.PRINCIPAL_SET:
1087 ("attempting.to.add.an.object.which.is.not.an.instance.of.java.security.Principal.to.a.Subject.s.Principal.Set"));
1107 if (which != Subject.PRIV_CREDENTIAL_SET) {
1135 if (which != Subject.PRIV_CREDENTIAL_SET) {
1176 if (which != Subject.PRIV_CREDENTIAL_SET) {
1214 if (which != Subject.PRIV_CREDENTIAL_SET) {
1252 if (which != Subject.PRIV_CREDENTIAL_SET) {
1280 if (which == Subject.PRIV_CREDENTIAL_SET) {
1298 subject = (Subject) fields.get("this$0", null);
1320 case Subject.PRINCIPAL_SET:
1323 case Subject.PUB_CREDENTIAL_SET:
1335 case Subject.PRINCIPAL_SET:
1336 iterator = Subject.this.principals.iterator();
1338 case Subject.PUB_CREDENTIAL_SET:
1339 iterator = Subject.this.pubCredentials.iterator();
1342 iterator = Subject.this.privCredentials.iterator();
1351 if (which == Subject.PRIV_CREDENTIAL_SET) {
1362 if (which != Subject.PRIV_CREDENTIAL_SET) {
1370 Subject.this.getPrincipals()));