1. /*
  2. * @(#)Owner.java 1.12 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.security.acl;
  8. import java.security.Principal;
  9. /**
  10. * Interface for managing owners of Access Control Lists (ACLs) or ACL
  11. * configurations. (Note that the Acl interface in the
  12. * <code> java.security.acl </code> package extends this Owner
  13. * interface.) The initial owner Principal should be specified as an
  14. * argument to the constructor of the class implementing this interface.
  15. *
  16. * @see java.security.acl.Acl
  17. *
  18. */
  19. public interface Owner {
  20. /**
  21. * Adds an owner. Only owners can modify ACL contents. The caller
  22. * principal must be an owner of the ACL in order to invoke this method.
  23. * That is, only an owner can add another owner. The initial owner is
  24. * configured at ACL construction time.
  25. *
  26. * @param caller the principal invoking this method. It must be an owner
  27. * of the ACL.
  28. *
  29. * @param owner the owner that should be added to the list of owners.
  30. *
  31. * @return true if successful, false if owner is already an owner.
  32. * @exception NotOwnerException if the caller principal is not an owner
  33. * of the ACL.
  34. */
  35. public boolean addOwner(Principal caller, Principal owner)
  36. throws NotOwnerException;
  37. /**
  38. * Deletes an owner. If this is the last owner in the ACL, an exception is
  39. * raised.<p>
  40. *
  41. * The caller principal must be an owner of the ACL in order to invoke
  42. * this method.
  43. *
  44. * @param caller the principal invoking this method. It must be an owner
  45. * of the ACL.
  46. *
  47. * @param owner the owner to be removed from the list of owners.
  48. *
  49. * @return true if the owner is removed, false if the owner is not part
  50. * of the list of owners.
  51. *
  52. * @exception NotOwnerException if the caller principal is not an owner
  53. * of the ACL.
  54. *
  55. * @exception LastOwnerException if there is only one owner left, so that
  56. * deleteOwner would leave the ACL owner-less.
  57. */
  58. public boolean deleteOwner(Principal caller, Principal owner)
  59. throws NotOwnerException, LastOwnerException;
  60. /**
  61. * Returns true if the given principal is an owner of the ACL.
  62. *
  63. * @param owner the principal to be checked to determine whether or not
  64. * it is an owner.
  65. *
  66. * @return true if the passed principal is in the list of owners, false
  67. * if not.
  68. */
  69. public boolean isOwner(Principal owner);
  70. }