01: /*
02: * @(#)Owner.java 1.19 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: *
26: */
27:
28: package java.security.acl;
29:
30: import java.security.Principal;
31:
32: /**
33: * Interface for managing owners of Access Control Lists (ACLs) or ACL
34: * configurations. (Note that the Acl interface in the
35: * <code> java.security.acl </code> package extends this Owner
36: * interface.) The initial owner Principal should be specified as an
37: * argument to the constructor of the class implementing this interface.
38: *
39: * @see java.security.acl.Acl
40: *
41: */
42: public interface Owner {
43:
44: /**
45: * Adds an owner. Only owners can modify ACL contents. The caller
46: * principal must be an owner of the ACL in order to invoke this method.
47: * That is, only an owner can add another owner. The initial owner is
48: * configured at ACL construction time.
49: *
50: * @param caller the principal invoking this method. It must be an owner
51: * of the ACL.
52: *
53: * @param owner the owner that should be added to the list of owners.
54: *
55: * @return true if successful, false if owner is already an owner.
56: * @exception NotOwnerException if the caller principal is not an owner
57: * of the ACL.
58: */
59: public boolean addOwner(Principal caller, Principal owner)
60: throws NotOwnerException;
61:
62: /**
63: * Deletes an owner. If this is the last owner in the ACL, an exception is
64: * raised.<p>
65: *
66: * The caller principal must be an owner of the ACL in order to invoke
67: * this method.
68: *
69: * @param caller the principal invoking this method. It must be an owner
70: * of the ACL.
71: *
72: * @param owner the owner to be removed from the list of owners.
73: *
74: * @return true if the owner is removed, false if the owner is not part
75: * of the list of owners.
76: *
77: * @exception NotOwnerException if the caller principal is not an owner
78: * of the ACL.
79: *
80: * @exception LastOwnerException if there is only one owner left, so that
81: * deleteOwner would leave the ACL owner-less.
82: */
83: public boolean deleteOwner(Principal caller, Principal owner)
84: throws NotOwnerException, LastOwnerException;
85:
86: /**
87: * Returns true if the given principal is an owner of the ACL.
88: *
89: * @param owner the principal to be checked to determine whether or not
90: * it is an owner.
91: *
92: * @return true if the passed principal is in the list of owners, false
93: * if not.
94: */
95: public boolean isOwner(Principal owner);
96:
97: }
|