src/share/classes/com/sun/security/auth/UserPrincipal.java

Print this page




  25 
  26 package com.sun.security.auth;
  27 
  28 import java.security.Principal;
  29 
  30 /**
  31  * A user principal identified by a username or account name.
  32  *
  33  * <p>
  34  * After successful authentication, a user {@link java.security.Principal}
  35  * can be associated with a particular {@link javax.security.auth.Subject}
  36  * to augment that <code>Subject</code> with an additional identity.
  37  * Authorization decisions can then be based upon the
  38  * <code>Principal</code>s that are associated with a <code>Subject</code>.
  39  *
  40  * <p>
  41  * This class is immutable.
  42  *
  43  * @since 1.6
  44  */

  45 public final class UserPrincipal implements Principal, java.io.Serializable {
  46 
  47     private static final long serialVersionUID = 892106070870210969L;
  48 
  49     /**
  50      * The principal's name
  51      *
  52      * @serial
  53      */
  54     private final String name;
  55 
  56     /**
  57      * Creates a principal.
  58      *
  59      * @param name The principal's string name.
  60      * @exception NullPointerException If the <code>name</code> is
  61      * <code>null</code>.
  62      */
  63     public UserPrincipal(String name) {
  64         if (name == null) {




  25 
  26 package com.sun.security.auth;
  27 
  28 import java.security.Principal;
  29 
  30 /**
  31  * A user principal identified by a username or account name.
  32  *
  33  * <p>
  34  * After successful authentication, a user {@link java.security.Principal}
  35  * can be associated with a particular {@link javax.security.auth.Subject}
  36  * to augment that <code>Subject</code> with an additional identity.
  37  * Authorization decisions can then be based upon the
  38  * <code>Principal</code>s that are associated with a <code>Subject</code>.
  39  *
  40  * <p>
  41  * This class is immutable.
  42  *
  43  * @since 1.6
  44  */
  45 @jdk.Supported
  46 public final class UserPrincipal implements Principal, java.io.Serializable {
  47 
  48     private static final long serialVersionUID = 892106070870210969L;
  49 
  50     /**
  51      * The principal's name
  52      *
  53      * @serial
  54      */
  55     private final String name;
  56 
  57     /**
  58      * Creates a principal.
  59      *
  60      * @param name The principal's string name.
  61      * @exception NullPointerException If the <code>name</code> is
  62      * <code>null</code>.
  63      */
  64     public UserPrincipal(String name) {
  65         if (name == null) {