Package org.apache.cxf.common.security

## Class SimpleGroup

- java.lang.Object
- - org.apache.cxf.common.security.SimplePrincipal
  - - org.apache.cxf.common.security.SimpleGroup

- All Implemented Interfaces:
    `Serializable`, `Principal`, `GroupPrincipal`

      public class SimpleGroup
      extends SimplePrincipal
      implements GroupPrincipal

  Simple Group implementation
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SimpleGroup​(String groupName)` |
    `SimpleGroup​(String groupName, String memberName)` |
    `SimpleGroup​(String groupName, Principal member)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `addMember​(Principal p)` | Adds the specified member to the group.
    `boolean` | `equals​(Object obj)` |
    `int` | `hashCode()` |
    `boolean` | `isMember​(Principal p)` | Returns true if the passed principal is a member of the group.
    `Enumeration<? extends Principal>` | `members()` | Returns an enumeration of the members in the group.
    `boolean` | `removeMember​(Principal p)` | Removes the specified member from the group.

    - ### Methods inherited from class org.apache.cxf.common.security.SimplePrincipal

      `getName, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.security.Principal

      `getName, implies, toString`

- - ### Constructor Detail

    - #### SimpleGroup

          public SimpleGroup​(String groupName)

    - #### SimpleGroup

          public SimpleGroup​(String groupName,
                             String memberName)

    - #### SimpleGroup

          public SimpleGroup​(String groupName,
                             Principal member)

  - ### Method Detail

    - #### isMember

          public boolean isMember​(Principal p)

      Description copied from interface: `GroupPrincipal`
      Returns true if the passed principal is a member of the group. This method does a recursive search, so if a principal belongs to a group which is a member of this group, true is returned.
      Specified by:
        `isMember` in interface `GroupPrincipal`
      Parameters:
        `p` - the principal whose membership is to be checked.
      Returns:
        true if the principal is a member of this group, false otherwise.

    - #### addMember

          public boolean addMember​(Principal p)

      Description copied from interface: `GroupPrincipal`
      Adds the specified member to the group.
      Specified by:
        `addMember` in interface `GroupPrincipal`
      Parameters:
        `p` - the principal to add to this group.
      Returns:
        true if the member was successfully added, false if the principal was already a member.

    - #### members

          public Enumeration<? extends Principal> members()

      Description copied from interface: `GroupPrincipal`
      Returns an enumeration of the members in the group. The returned objects can be instances of either Principal or Group (which is a subclass of Principal).
      Specified by:
        `members` in interface `GroupPrincipal`
      Returns:
        an enumeration of the group members.

    - #### removeMember

          public boolean removeMember​(Principal p)

      Description copied from interface: `GroupPrincipal`
      Removes the specified member from the group.
      Specified by:
        `removeMember` in interface `GroupPrincipal`
      Parameters:
        `p` - the principal to remove from this group.
      Returns:
        true if the principal was removed, or false if the principal was not a member.

    - #### equals

          public boolean equals​(Object obj)

      Specified by:
        `equals` in interface `Principal`
      Overrides:
        `equals` in class `SimplePrincipal`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Principal`
      Overrides:
        `hashCode` in class `SimplePrincipal`