Interface GroupsConnection

All Known Implementing Classes:
DirectoryGroupsConnection

public interface GroupsConnection
Interface for common operations on Groups.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The role of a member in a group.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a member to the specified group with the given role.
    com.google.api.services.directory.model.Group
    createGroup(String groupKey)
    Creates a group with the given email address (groupKey) that is open for external members to join, and returns it.
    Returns all of the members of the specified group.
    boolean
    isMemberOfGroup(String memberEmail, String groupKey)
    Checks whether the given email belongs to the "support" group.
    void
    Removes a member from the specified group, or throws GoogleJsonResponseException if the member doesn't exist.
  • Method Details

    • addMemberToGroup

      void addMemberToGroup(String groupKey, String email, GroupsConnection.Role role) throws IOException
      Adds a member to the specified group with the given role. This function is idempotent; if the member already exists in the group, then it returns normally. If the group doesn't exist, then it is created.
      Throws:
      IOException
    • removeMemberFromGroup

      void removeMemberFromGroup(String groupKey, String email) throws IOException
      Removes a member from the specified group, or throws GoogleJsonResponseException if the member doesn't exist.
      Throws:
      IOException
    • getMembersOfGroup

      Set<String> getMembersOfGroup(String groupKey) throws IOException
      Returns all of the members of the specified group. Note that it gets members only; not owners or managers. Returns an empty set if the group in question does not exist.
      Throws:
      IOException
    • createGroup

      com.google.api.services.directory.model.Group createGroup(String groupKey) throws IOException
      Creates a group with the given email address (groupKey) that is open for external members to join, and returns it. This function is idempotent; if the given group already exists, then this function returns as normal without error (and without modifying the existing group in any way, including permissions on who is able to join). The configured admin owner for the Google App is automatically added as an owner.
      Throws:
      IOException
    • isMemberOfGroup

      boolean isMemberOfGroup(String memberEmail, String groupKey)
      Checks whether the given email belongs to the "support" group.