Class GrouperBoxProvisioningTargetNativeSync
GrouperProvisioningTargetNativeSync: builds native target reporting
beans for sync-back to the generic grouper_prov_group / grouper_prov_user tables.
Both groups and users are captured from the raw Box JSON (JSON Pointer paths,
like SCIM and Adobe), hooked at the API-commands seam (GrouperBoxApiCommands read
methods such as retrieveBoxGroups / retrieveBoxGroup / retrieveBoxUsers
/ retrieveBoxUser) where the per-element JSON node is in scope. This avoids losing any
Box field that the GrouperBoxGroup / GrouperBoxUser typed beans do not model;
operators can capture any JSON field via nativeAttributesGroups /
nativeAttributesEntities with a name and optional JSON-Pointer path.
The default keys are chosen so each default's captured value matches what the OLD typed-bean
getter returned. For Box every default's bean property name happens to equal its raw Box JSON
field name (e.g. group name/group_type/provenance; user
login/role/status/type), so the defaults need no explicit path
remapping (the JSON path defaults to "/" + name). The target ids come from /id
for both groups and users -- the same JSON field the old typed-bean build methods read via
GrouperBoxGroup.getId() / GrouperBoxUser.getId().
Memberships are captured on BOTH the read path and the write path. On read they are derived
from the Box memberships read during DAO translation (captureMemberships(java.lang.String, java.lang.Iterable<java.lang.String>)) -- Box's
membership model is group-centric (the /groups/:id/memberships read yields the member user
ids for a group), and the DAO records the (targetGroupId, targetUserId) pairs in the same
loop where they are already known. On write,
GrouperBoxTargetDao.insertMembership/deleteMembership call
captureMembershipInsertFromCurrentProvisioner(java.lang.String, java.lang.String) /
captureMembershipDeleteFromCurrentProvisioner(java.lang.String, java.lang.String) (-> recordTargetNativeMembershipInsert
/ recordTargetNativeMembershipDelete) on success, so a membership add/remove is recorded
into the native mirror on the write pass. Only the group/user object capture moved to JSON.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildNativeGroupFromJson(com.fasterxml.jackson.databind.JsonNode groupNode) Build a native group bean from the raw Box group JSON.buildNativeUserFromJson(com.fasterxml.jackson.databind.JsonNode userNode) Build a native user bean from the raw Box user JSON.voidcaptureGroupJson(com.fasterxml.jackson.databind.JsonNode groupNode) Build + record a Box group from its raw JSON.static voidcaptureGroupJsonFromCurrentProvisioner(com.fasterxml.jackson.databind.JsonNode groupNode) Capture a Box group (from its raw JSON) against the current provisioner's sync.static voidcaptureMembershipDeleteFromCurrentProvisioner(String groupTargetId, String userTargetId) Write-track a successful Box membership remove (deleteBoxMembership) against the current provisioner: drop(groupTargetId, userTargetId)from the native membership map so the end-of-run flush deletes its grouper_prov_mship row.static voidcaptureMembershipInsertFromCurrentProvisioner(String groupTargetId, String userTargetId) Write-track a successful Box membership add (createBoxMembership) against the current provisioner: record(groupTargetId, userTargetId)in the native membership map so the generic grouper_prov_mship sync-back mirror stays current on capture-on-write.voidcaptureMemberships(String targetGroupId, Iterable<String> targetUserIds) Record the (targetGroupId, targetUserId) pairs as native membership beans.static voidcaptureMembershipsFromCurrentProvisioner(String targetGroupId, Iterable<String> targetUserIds) Record the (targetGroupId, targetUserId) pairs as native membership beans on the current provisioner's sync.voidcaptureUserJson(com.fasterxml.jackson.databind.JsonNode userNode) Build + record a Box user from its raw JSON.static voidcaptureUserJsonFromCurrentProvisioner(com.fasterxml.jackson.databind.JsonNode userNode) Capture a Box user (from its raw JSON) against the current provisioner's sync.protected List<GrouperProvisioningNativeAttributeConfig>Per-protocol sensible-default attribute list for entities (users) when the operator hasn't configurednativeAttributesEntities.protected List<GrouperProvisioningNativeAttributeConfig>Per-protocol sensible-default attribute list for groups.Methods inherited from class edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningTargetNativeSync
clearSyncBackGroupForDelete, clearSyncBackGroupForRead, clearSyncBackUserForDelete, clearSyncBackUserForRead, configuredNativeAttributeConfigsEntities, configuredNativeAttributeConfigsGroups, effectiveNativeAttributeConfigsEntities, effectiveNativeAttributeConfigsGroups, getGrouperProvisioner, grouperToNativeNameExceptionsEntities, grouperToNativeNameExceptionsGroups, markSyncBackGroupForDelete, markSyncBackGroupForRead, markSyncBackUserForDelete, markSyncBackUserForRead, recordTargetNativeGroup, recordTargetNativeGroupWrite, recordTargetNativeMembershipDelete, recordTargetNativeMembershipInsert, recordTargetNativeMembershipReplace, recordTargetNativeMemberships, recordTargetNativeUser, recordTargetNativeUserWrite, removeTargetNativeGroup, removeTargetNativeUser, setGrouperProvisioner
-
Constructor Details
-
GrouperBoxProvisioningTargetNativeSync
public GrouperBoxProvisioningTargetNativeSync()
-
-
Method Details
-
getDefaultNativeAttributeConfigsEntities
Description copied from class:GrouperProvisioningTargetNativeSyncPer-protocol sensible-default attribute list for entities (users) when the operator hasn't configurednativeAttributesEntities. Override in protocol subclasses to return a curated list (e.g. SCIM core schema fields). Default is empty — for LDAP this means "no extra capture beyond what the regular target query returned," which is the historical behavior.- Overrides:
getDefaultNativeAttributeConfigsEntitiesin classGrouperProvisioningTargetNativeSync
-
getDefaultNativeAttributeConfigsGroups
Description copied from class:GrouperProvisioningTargetNativeSyncPer-protocol sensible-default attribute list for groups. SeeGrouperProvisioningTargetNativeSync.getDefaultNativeAttributeConfigsEntities().- Overrides:
getDefaultNativeAttributeConfigsGroupsin classGrouperProvisioningTargetNativeSync
-
buildNativeGroupFromJson
public GrouperProvisioningTargetNativeGroup buildNativeGroupFromJson(com.fasterxml.jackson.databind.JsonNode groupNode) Build a native group bean from the raw Box group JSON.targetIdis read from/id(the same field the old typed-bean build read via getId()); the attributes map is populated for each entry inGrouperProvisioningTargetNativeSync.effectiveNativeAttributeConfigsGroups()(operator-configured or default) by JSON Pointer. Returns null when the JSON is missing or has noid. -
buildNativeUserFromJson
public GrouperProvisioningTargetNativeUser buildNativeUserFromJson(com.fasterxml.jackson.databind.JsonNode userNode) Build a native user bean from the raw Box user JSON.targetIdis read from/id(the same field the old typed-bean build read via getId()); the attributes map is populated for each entry inGrouperProvisioningTargetNativeSync.effectiveNativeAttributeConfigsEntities()(operator-configured or default) by JSON Pointer. Returns null when the JSON is missing or has noid. -
captureGroupJson
public void captureGroupJson(com.fasterxml.jackson.databind.JsonNode groupNode) Build + record a Box group from its raw JSON. No-op when sync-back is off or id-less. -
captureUserJson
public void captureUserJson(com.fasterxml.jackson.databind.JsonNode userNode) Build + record a Box user from its raw JSON. No-op when sync-back is off or id-less. -
captureMemberships
Record the (targetGroupId, targetUserId) pairs as native membership beans. No-op if input is empty. -
captureGroupJsonFromCurrentProvisioner
public static void captureGroupJsonFromCurrentProvisioner(com.fasterxml.jackson.databind.JsonNode groupNode) Capture a Box group (from its raw JSON) against the current provisioner's sync. No-op if there's no current provisioner or the active provisioner isn't a Box one. Called from the commands seam (GrouperBoxApiCommandsread methods) for every group parsed from a read. -
captureUserJsonFromCurrentProvisioner
public static void captureUserJsonFromCurrentProvisioner(com.fasterxml.jackson.databind.JsonNode userNode) Capture a Box user (from its raw JSON) against the current provisioner's sync. No-op if there's no current provisioner or the active provisioner isn't a Box one. Called from the commands seam (GrouperBoxApiCommandsread methods) for every user parsed from a read. -
captureMembershipsFromCurrentProvisioner
public static void captureMembershipsFromCurrentProvisioner(String targetGroupId, Iterable<String> targetUserIds) Record the (targetGroupId, targetUserId) pairs as native membership beans on the current provisioner's sync. Box memberships are group-centric and derived during DAO translation, so unlike groups/users (captured at the commands JSON seam) this stays a typed-bean call site. -
captureMembershipInsertFromCurrentProvisioner
public static void captureMembershipInsertFromCurrentProvisioner(String groupTargetId, String userTargetId) Write-track a successful Box membership add (createBoxMembership) against the current provisioner: record(groupTargetId, userTargetId)in the native membership map so the generic grouper_prov_mship sync-back mirror stays current on capture-on-write. No-op out of cycle, for a non-Box provisioner, or when membership sync-back is off (guarded downstream byrecordTargetNativeMembershipInsert->isLoadMembershipsToGenericGrouperTable()). -
captureMembershipDeleteFromCurrentProvisioner
public static void captureMembershipDeleteFromCurrentProvisioner(String groupTargetId, String userTargetId) Write-track a successful Box membership remove (deleteBoxMembership) against the current provisioner: drop(groupTargetId, userTargetId)from the native membership map so the end-of-run flush deletes its grouper_prov_mship row. No-op out of cycle, for a non-Box provisioner, or when membership sync-back is off (guarded downstream byrecordTargetNativeMembershipDelete->isLoadMembershipsToGenericGrouperTable()).
-