Class DropboxGroup
java.lang.Object
edu.internet2.middleware.grouper.app.dropbox.DropboxGroup
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateTableDropboxGroup(DdlVersionBean ddlVersionBean, Database database) Create the mock database table that simulates the Dropbox group store for tests.static DropboxGroupfromJson(com.fasterxml.jackson.databind.JsonNode groupNode) Convert from a Dropbox group JSON node.static DropboxGroupfromProvisioningGroup(ProvisioningGroup targetGroup, Set<String> fieldNamesToSet) Convert from a Grouper provisioning group to a DropboxGroup.getId()getName()voidsetExternalId(String externalId) voidvoidsetManagementType(String managementType) voidsetMemberCount(Integer memberCount) voidcom.fasterxml.jackson.databind.node.ObjectNodeConvert to the request body for POST /2/team/groups/create.Convert to a Grouper provisioning group.toString()com.fasterxml.jackson.databind.node.ObjectNodeConvert to the request body for POST /2/team/groups/update.
-
Field Details
-
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
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
Create the mock database table that simulates the Dropbox group store for tests.- Parameters:
ddlVersionBean- ddl version beandatabase- the database model
-
getId
-
setId
-
getName
-
setName
-
getExternalId
-
setExternalId
-
getManagementType
-
setManagementType
-
getMemberCount
-
setMemberCount
-
toString
-
fromJson
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
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 groupfieldNamesToSet- field names to set, or null for all- Returns:
- the DropboxGroup
-