Group.java 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* Group.java -- Represents a group of Principals
  2. Copyright (C) 1998, 2001 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package java.security.acl;
  32. import java.security.Principal;
  33. import java.util.Enumeration;
  34. /**
  35. * This interface represents a group of <code>Principals</code>. Note that
  36. * since this interface extends <code>Principal</code>, a <code>Group</code>
  37. * can be used where ever a <code>Principal</code> is requested. This
  38. * includes arguments to the methods in this interface.
  39. *
  40. * @version 0.0
  41. *
  42. * @author Aaron M. Renn (arenn@urbanophile.com)
  43. */
  44. public interface Group extends Principal
  45. {
  46. /**
  47. * This method adds a new <code>Principal</code> to this group.
  48. *
  49. * @param user The new <code>Principal</code> to add
  50. *
  51. * @return <code>true</code> if the user was successfully added or <code>false</code> if the user is already a member
  52. */
  53. boolean addMember(Principal user);
  54. /**
  55. * This method deletes a member from the group.
  56. *
  57. * @param user The <code>Principal</code> to delete
  58. *
  59. * @return <code>true</code> if the user was successfully deleted or <code>false</code> if the user is not a member of the group
  60. */
  61. boolean removeMember(Principal user);
  62. /**
  63. * This method tests whether or not a given <code>Principal</code> is a
  64. * member of this group.
  65. *
  66. * @param member The <code>Principal</code> to test for membership
  67. *
  68. * @return <code>true</code> if the user is member, <code>false</code> otherwise
  69. */
  70. boolean isMember(Principal member);
  71. /**
  72. * This method returns a list of all members of the group as an
  73. * <code>Enumeration</code>.
  74. *
  75. * @return The list of all members of the group
  76. */
  77. Enumeration<? extends Principal> members();
  78. }