Class DropboxGroup

java.lang.Object
edu.internet2.middleware.grouper.app.dropbox.DropboxGroup

public class DropboxGroup extends Object
Domain object for a Dropbox Business team group.

Maps to the Dropbox Team API group object as returned by /2/team/groups/list, /2/team/groups/get_info, and /2/team/groups/create. Grouper manages "company_managed" groups and matches them by the group_external_id field, which Grouper sets to a stable value (e.g. the Grouper group idIndex or name).

  • Field Details

    • MANAGEMENT_TYPE_COMPANY_MANAGED

      public static final String MANAGEMENT_TYPE_COMPANY_MANAGED
      group_management_type value for a group whose membership is managed by the team (i.e. via the API). Grouper only provisions company_managed groups.
      See Also:
    • MANAGEMENT_TYPE_USER_MANAGED

      public static final String MANAGEMENT_TYPE_USER_MANAGED
      group_management_type value for a group whose membership is managed by the group's own owners in the Dropbox UI. Grouper does not manage these.
      See Also:
  • Constructor Details

    • DropboxGroup

      public DropboxGroup()
  • Method Details

    • createTableDropboxGroup

      public static void createTableDropboxGroup(DdlVersionBean ddlVersionBean, Database database)
      Create the mock database table that simulates the Dropbox group store for tests.
      Parameters:
      ddlVersionBean - ddl version bean
      database - the database model
    • getId

      public String getId()
    • setId

      public void setId(String id)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getExternalId

      public String getExternalId()
    • setExternalId

      public void setExternalId(String externalId)
    • getManagementType

      public String getManagementType()
    • setManagementType

      public void setManagementType(String managementType)
    • getMemberCount

      public Integer getMemberCount()
    • setMemberCount

      public void setMemberCount(Integer memberCount)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fromJson

      public static DropboxGroup fromJson(com.fasterxml.jackson.databind.JsonNode groupNode)
      Convert from a Dropbox group JSON node. Works for both the group summary objects in /2/team/groups/list and the fuller objects in /2/team/groups/get_info and /2/team/groups/create (member lists are read separately as memberships).
      Parameters:
      groupNode - a Dropbox group JSON object
      Returns:
      the DropboxGroup, or null if groupNode is null
    • toCreateJson

      public com.fasterxml.jackson.databind.node.ObjectNode toCreateJson()
      Convert to the request body for POST /2/team/groups/create.
      Returns:
      the create request body
    • toUpdateJson

      public com.fasterxml.jackson.databind.node.ObjectNode toUpdateJson()
      Convert to the request body for POST /2/team/groups/update. The group is selected by group_id; only the supplied new_* fields are changed.
      Returns:
      the update request body
    • toProvisioningGroup

      public ProvisioningGroup toProvisioningGroup()
      Convert to a Grouper provisioning group. The provisioning group id is the native Dropbox group_id; matching is configured on the externalId attribute.
      Returns:
      the converted target group
    • fromProvisioningGroup

      public static DropboxGroup fromProvisioningGroup(ProvisioningGroup targetGroup, Set<String> fieldNamesToSet)
      Convert from a Grouper provisioning group to a DropboxGroup.
      Parameters:
      targetGroup - the Grouper provisioning group
      fieldNamesToSet - field names to set, or null for all
      Returns:
      the DropboxGroup