1. /*
  2. * @(#)Owner.java 1.13 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.security.acl;
  11. import java.security.Principal;
  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. * Adds an owner. Only owners can modify ACL contents. The caller
  25. * principal must be an owner of the ACL in order to invoke this method.
  26. * That is, only an owner can add another owner. The initial owner is
  27. * configured at ACL construction time.
  28. *
  29. * @param caller the principal invoking this method. It must be an owner
  30. * of the ACL.
  31. *
  32. * @param owner the owner that should be added to the list of owners.
  33. *
  34. * @return true if successful, false if owner is already an owner.
  35. * @exception NotOwnerException if the caller principal is not an owner
  36. * of the ACL.
  37. */
  38. public boolean addOwner(Principal caller, Principal owner)
  39. throws NotOwnerException;
  40. /**
  41. * Deletes an owner. If this is the last owner in the ACL, an exception is
  42. * raised.<p>
  43. *
  44. * The caller principal must be an owner of the ACL in order to invoke
  45. * this method.
  46. *
  47. * @param caller the principal invoking this method. It must be an owner
  48. * of the ACL.
  49. *
  50. * @param owner the owner to be removed from the list of owners.
  51. *
  52. * @return true if the owner is removed, false if the owner is not part
  53. * of the list of owners.
  54. *
  55. * @exception NotOwnerException if the caller principal is not an owner
  56. * of the ACL.
  57. *
  58. * @exception LastOwnerException if there is only one owner left, so that
  59. * deleteOwner would leave the ACL owner-less.
  60. */
  61. public boolean deleteOwner(Principal caller, Principal owner)
  62. throws NotOwnerException, LastOwnerException;
  63. /**
  64. * Returns true if the given principal is an owner of the ACL.
  65. *
  66. * @param owner the principal to be checked to determine whether or not
  67. * it is an owner.
  68. *
  69. * @return true if the passed principal is in the list of owners, false
  70. * if not.
  71. */
  72. public boolean isOwner(Principal owner);
  73. }