home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / Principal.java < prev    next >
Text File  |  1998-01-23  |  2KB  |  75 lines

  1. /*
  2.  * @(#)Principal.java    1.12 97/01/29
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.security;
  24.  
  25. /**
  26.  * This interface represents a principal. A principal can be an
  27.  * individual, a corporation, a program thread; anything which can
  28.  * have an identity. See the <a href="../guide/security/Acl.html">ACL
  29.  * white paper</a> for more information.
  30.  *
  31.  * @see Identity
  32.  * @see Certificate
  33.  * @see java.security.acl.Acl
  34.  * @see java.security.acl.Group
  35.  *
  36.  * @version 1.12, 97/11/25
  37.  * @author Satish Dharmaraj 
  38.  */
  39. public interface Principal {
  40.  
  41.     /**
  42.      * Compares this principal to the specified object.  Returns true
  43.      * if the object passed in matches the principal represented by
  44.      * the implementation of this interface.  
  45.      *
  46.      * @param another the principal to compare with.
  47.      * 
  48.      * @return true if
  49.      * the principal passed in is the same as that encapsulated by
  50.      * this principal, false otherwise.
  51.      */
  52.     public boolean equals(Object another);
  53.     
  54.     /**
  55.      * Returns a string representation of this principal.  
  56.      *
  57.      * @return a string representation of this principal.
  58.      */
  59.     public String toString();
  60.  
  61.     /**
  62.      * Returns a hashcode for this principal.
  63.      *
  64.      * @return a hashcode for this principal.
  65.      */
  66.     public int hashCode();
  67.  
  68.     /**  
  69.      * Returns the name of this principal.
  70.      *
  71.      * @return the name of this principal.
  72.      */
  73.     public String getName();
  74. }
  75.