KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > security > acl > Owner


1 /*
2  * @(#)Owner.java 1.16 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.security.acl;
9
10 import java.security.Principal JavaDoc;
11
12 /**
13  * Interface for managing owners of Access Control Lists (ACLs) or ACL
14  * configurations. (Note that the Acl interface in the
15  * <code> java.security.acl </code> package extends this Owner
16  * interface.) The initial owner Principal should be specified as an
17  * argument to the constructor of the class implementing this interface.
18  *
19  * @see java.security.acl.Acl
20  *
21  */

22 public interface Owner {
23
24     /**
25      * Adds an owner. Only owners can modify ACL contents. The caller
26      * principal must be an owner of the ACL in order to invoke this method.
27      * That is, only an owner can add another owner. The initial owner is
28      * configured at ACL construction time.
29      *
30      * @param caller the principal invoking this method. It must be an owner
31      * of the ACL.
32      *
33      * @param owner the owner that should be added to the list of owners.
34      *
35      * @return true if successful, false if owner is already an owner.
36      * @exception NotOwnerException if the caller principal is not an owner
37      * of the ACL.
38      */

39     public boolean addOwner(Principal JavaDoc caller, Principal JavaDoc owner)
40       throws NotOwnerException JavaDoc;
41
42     /**
43      * Deletes an owner. If this is the last owner in the ACL, an exception is
44      * raised.<p>
45      *
46      * The caller principal must be an owner of the ACL in order to invoke
47      * this method.
48      *
49      * @param caller the principal invoking this method. It must be an owner
50      * of the ACL.
51      *
52      * @param owner the owner to be removed from the list of owners.
53      *
54      * @return true if the owner is removed, false if the owner is not part
55      * of the list of owners.
56      *
57      * @exception NotOwnerException if the caller principal is not an owner
58      * of the ACL.
59      *
60      * @exception LastOwnerException if there is only one owner left, so that
61      * deleteOwner would leave the ACL owner-less.
62      */

63     public boolean deleteOwner(Principal JavaDoc caller, Principal JavaDoc owner)
64       throws NotOwnerException JavaDoc, LastOwnerException JavaDoc;
65
66     /**
67      * Returns true if the given principal is an owner of the ACL.
68      *
69      * @param owner the principal to be checked to determine whether or not
70      * it is an owner.
71      *
72      * @return true if the passed principal is in the list of owners, false
73      * if not.
74      */

75     public boolean isOwner(Principal JavaDoc owner);
76
77 }
78
Popular Tags