home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / Owner.java < prev    next >
Text File  |  1997-05-20  |  3KB  |  93 lines

  1. /*
  2.  * @(#)Owner.java    1.8 97/01/30
  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.acl;
  24.  
  25. import java.security.Principal;
  26.  
  27. /**
  28.  * Interface for managing owners of Access Control Lists (ACLs) or ACL 
  29.  * configurations. (Note that the Acl interface in the 
  30.  * <code> java.security.acl </code> package extends this Owner
  31.  * interface.) The initial owner Principal should be specified as an 
  32.  * argument to the constructor of the class implementing this interface.   
  33.  *   
  34.  * @see java.security.acl.Acl    
  35.  *
  36.  */
  37. public interface Owner {
  38.  
  39.     /**
  40.      * Adds an owner. Only owners can modify ACL contents. The caller 
  41.      * principal must be an owner of the ACL in order to invoke this method.
  42.      * That is, only an owner can add another owner. The initial owner is 
  43.      * configured at ACL construction time. 
  44.      * 
  45.      * @param caller the principal invoking this method. It must be an owner 
  46.      * of the ACL.
  47.      * 
  48.      * @param owner the owner that should be added to the list of owners.
  49.      * 
  50.      * @return true if successful, false if owner is already an owner.
  51.      * @exception NotOwnerException if the caller principal is not an owner 
  52.      * of the ACL.
  53.      */
  54.     public boolean addOwner(Principal caller, Principal owner)
  55.       throws NotOwnerException;
  56.  
  57.     /** 
  58.      * Deletes an owner. If this is the last owner in the ACL, an exception is 
  59.      * raised.<p>
  60.      * 
  61.      * The caller principal must be an owner of the ACL in order to invoke 
  62.      * this method. 
  63.      * 
  64.      * @param caller the principal invoking this method. It must be an owner 
  65.      * of the ACL.
  66.      * 
  67.      * @param owner the owner to be removed from the list of owners.
  68.      * 
  69.      * @return true if the owner is removed, false if the owner is not part 
  70.      * of the list of owners.
  71.      * 
  72.      * @exception NotOwnerException if the caller principal is not an owner 
  73.      * of the ACL.
  74.      * 
  75.      * @exception LastOwnerException if there is only one owner left, so that
  76.      * deleteOwner would leave the ACL owner-less.
  77.      */
  78.     public boolean deleteOwner(Principal caller, Principal owner)
  79.       throws NotOwnerException, LastOwnerException;
  80.  
  81.     /**
  82.      * Returns true if the given principal is an owner of the ACL.
  83.      * 
  84.      * @param owner the principal to be checked to determine whether or not 
  85.      * it is an owner.
  86.      * 
  87.      * @return true if the passed principal is in the list of owners, false 
  88.      * if not.
  89.      */
  90.     public boolean isOwner(Principal owner);
  91.  
  92. }
  93.