Class GrouperProvisioningTargetNativeSync
java.lang.Object
edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningTargetNativeSync
- Direct Known Subclasses:
DatadogProvisioningTargetNativeSync,DropboxProvisioningTargetNativeSync,FreshRequesterProvisioningTargetNativeSync,GrouperAdobeProvisioningTargetNativeSync,GrouperAzureProvisioningTargetNativeSync,GrouperBoxProvisioningTargetNativeSync,GrouperDuoProvisioningTargetNativeSync,GrouperGoogleProvisioningTargetNativeSync,GrouperOktaProvisioningTargetNativeSync,GrouperRemedyProvisioningTargetNativeSync,GrouperScim2ProvisioningTargetNativeSync,InterfolioProvisioningTargetNativeSync,LdapProvisioningTargetNativeSync,TeamDynamixProvisioningTargetNativeSync,TrueFoundryProvisioningTargetNativeSync
Sibling of
GrouperProvisioningConfiguration / GrouperProvisioningBehavior /
GrouperProvisioningData that owns the runtime "generic provisioner sync back"
logic. Subclasses live per protocol (e.g. LdapProvisioningTargetNativeSync,
eventually GrouperScim2ProvisioningTargetNativeSync) and add the protocol-specific
concerns:
- Bean construction from the native protocol object (e.g.
LdapEntry,JsonNode). - Widening the protocol-specific search-attribute set so the native-attribute paths
configured on
GrouperProvisioningConfigurationare returned by the target query. - Convenience capture-from-native-entry methods that pair a build with a record.
This base is concrete and usable as-is for the recording side; a default provisioner with no protocol-specific build logic gets the generic three-method recorder.
Each recordTargetNativeXxx method is gated by the corresponding
GrouperProvisioningBehavior predicate
(GrouperProvisioningBehavior.isLoadGroupsToGenericGrouperTable() etc.) so callers
never need to flag-check at the call site.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearSyncBackGroupForDelete(String targetId) DroptargetIdfrom the group deleted set (cheap, idempotent).voidclearSyncBackGroupForRead(String targetId) seeclearSyncBackUserForRead(java.lang.String); same semantics for groupsvoidclearSyncBackUserForDelete(String targetId) seeclearSyncBackGroupForDelete(java.lang.String); same semantics for usersvoidclearSyncBackUserForRead(String targetId) DroptargetIdfrom the user sync-back-read set.protected List<GrouperProvisioningNativeAttributeConfig>Operator-configurednativeAttributesEntitiesfrom the provisioner, or null when there is none (or no provisioner is attached).protected List<GrouperProvisioningNativeAttributeConfig>groups analogue ofconfiguredNativeAttributeConfigsEntities()Effective list of native attribute configs to capture for entities (users).Effective list of native attribute configs to capture for groups.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.reference back up to the provisionerPer-protocol native<->grouper attribute NAME exceptions for entities: grouper attribute name -> native (JSON/bean) field name, EXCEPTIONS ONLY -- anything not listed is identical in both namespaces.groups analogue ofgrouperToNativeNameExceptionsEntities()voidmarkSyncBackGroupForDelete(String targetId) RegistertargetIdas deleted from the target this run.voidmarkSyncBackGroupForRead(String targetId) seemarkSyncBackUserForRead(java.lang.String); same semantics for groupsvoidmarkSyncBackUserForDelete(String targetId) seemarkSyncBackGroupForDelete(java.lang.String); same semantics for usersvoidmarkSyncBackUserForRead(String targetId) RegistertargetIdas needing a sync-back re-read.voidrecordTargetNativeGroup(GrouperProvisioningTargetNativeGroup grouperProvisioningTargetNativeGroup) Append a native group bean to the in-memory list that drives end-of-run sync into grouper_prov_group / _attr / _attr_value.voidrecordTargetNativeGroupWrite(String targetId, GrouperProvisioningTargetNativeGroup grouperProvisioningTargetNativeGroup) Group-write sync-back hook, called from a provisioner's insert/update commands path right after the target write (create or attribute update).voidrecordTargetNativeMembershipDelete(String targetGroupId, String targetUserId) Record a successful membership remove (SCIM PATCH op=remove, or any protocol's remove-member write): dropMultiKey(targetGroupId, targetUserId)from the native membership map so the end-of-run flush deletes its grouper_prov_mship row.voidrecordTargetNativeMembershipInsert(String targetGroupId, String targetUserId) Record a successful membership add (SCIM PATCH op=add, or any protocol's add-member write): putMultiKey(targetGroupId, targetUserId)in the native membership map.voidrecordTargetNativeMembershipReplace(String targetGroupId, Collection<String> targetUserIds) Record a successful full-members replace for one group (SCIM PATCH op=replace on members): the group's membership set in the mirror becomes exactlytargetUserIds.voidrecordTargetNativeMemberships(List<GrouperProvisioningTargetNativeMembership> grouperProvisioningTargetNativeMemberships) Append native memberships to the in-memory list that drives end-of-run sync into grouper_prov_mship.voidrecordTargetNativeUser(GrouperProvisioningTargetNativeUser grouperProvisioningTargetNativeUser) Append a native user bean to the in-memory list that drives end-of-run sync into grouper_prov_user / _attr / _attr_value.voidrecordTargetNativeUserWrite(String targetId, GrouperProvisioningTargetNativeUser grouperProvisioningTargetNativeUser) Entity-write sync-back hook; the user-axis mirror ofrecordTargetNativeGroupWrite(String, GrouperProvisioningTargetNativeGroup)(mark to-read, clear pending delete, drop stale rep, register if returned).voidremoveTargetNativeGroup(String targetId) Remove any captured native group representation fortargetId.voidremoveTargetNativeUser(String targetId) seeremoveTargetNativeGroup(java.lang.String); same semantics for usersvoidsetGrouperProvisioner(GrouperProvisioner grouperProvisioner1)
-
Constructor Details
-
GrouperProvisioningTargetNativeSync
public GrouperProvisioningTargetNativeSync()
-
-
Method Details
-
getGrouperProvisioner
reference back up to the provisioner -
setGrouperProvisioner
-
recordTargetNativeGroup
public void recordTargetNativeGroup(GrouperProvisioningTargetNativeGroup grouperProvisioningTargetNativeGroup) Append a native group bean to the in-memory list that drives end-of-run sync into grouper_prov_group / _attr / _attr_value. No-op when reporting is disabled or the DAO doesn't support retrieving groups. -
recordTargetNativeUser
public void recordTargetNativeUser(GrouperProvisioningTargetNativeUser grouperProvisioningTargetNativeUser) Append a native user bean to the in-memory list that drives end-of-run sync into grouper_prov_user / _attr / _attr_value. No-op when reporting is disabled or the DAO doesn't support retrieving entities. -
effectiveNativeAttributeConfigsEntities
Effective list of native attribute configs to capture for entities (users). If the provisioner config has an explicitnativeAttributesEntitieslist, that wins; otherwise the protocol subclass's defaults fromgetDefaultNativeAttributeConfigsEntities()are used. -
configuredNativeAttributeConfigsEntities
Operator-configurednativeAttributesEntitiesfrom the provisioner, or null when there is none (or no provisioner is attached). Isolated as a seam so the normalize/auto-inject ineffectiveNativeAttributeConfigsEntities()is always applied regardless of how the raw list is supplied -- production reads the provisioner; tests override this to inject a list without standing up a provisioner. Do NOT bypass the effective method itself, or the exceptions transform is skipped. -
effectiveNativeAttributeConfigsGroups
Effective list of native attribute configs to capture for groups. SeeeffectiveNativeAttributeConfigsEntities()for the resolution rule. -
configuredNativeAttributeConfigsGroups
groups analogue ofconfiguredNativeAttributeConfigsEntities() -
getDefaultNativeAttributeConfigsEntities
Per-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. -
getDefaultNativeAttributeConfigsGroups
Per-protocol sensible-default attribute list for groups. SeegetDefaultNativeAttributeConfigsEntities(). -
grouperToNativeNameExceptionsEntities
Per-protocol native<->grouper attribute NAME exceptions for entities: grouper attribute name -> native (JSON/bean) field name, EXCEPTIONS ONLY -- anything not listed is identical in both namespaces. This is the single source of truth for name differences and drives both name normalization of the effective capture list AND auto-injection of every renamed attribute, so a cache-reconstructed object has the same attribute shape (and therefore matches/compares the same) as a live read. Default empty (most targets use identical names, e.g. LDAP mail/cn). Override per protocol (e.g. Google's email -> primaryEmail).- Returns:
- grouper name -> native name, exceptions only
-
grouperToNativeNameExceptionsGroups
groups analogue ofgrouperToNativeNameExceptionsEntities() -
recordTargetNativeMemberships
public void recordTargetNativeMemberships(List<GrouperProvisioningTargetNativeMembership> grouperProvisioningTargetNativeMemberships) Append native memberships to the in-memory list that drives end-of-run sync into grouper_prov_mship. No-op when reporting is disabled, or when the membership load flag is off, or when the input list is empty. -
markSyncBackUserForRead
RegistertargetIdas needing a sync-back re-read. Called from write sites that change an entity in the target without getting a response body to capture from. No-op when reporting is off for entities or whentargetIdis null. -
markSyncBackGroupForRead
seemarkSyncBackUserForRead(java.lang.String); same semantics for groups -
clearSyncBackUserForRead
DroptargetIdfrom the user sync-back-read set. Called byrecordTargetNativeUser(edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningTargetNativeUser)whenever a fresh entry lands in the canonical map — whether from a read response, a write response, or the drain. -
clearSyncBackGroupForRead
seeclearSyncBackUserForRead(java.lang.String); same semantics for groups -
removeTargetNativeGroup
Remove any captured native group representation fortargetId. Idempotent. -
removeTargetNativeUser
seeremoveTargetNativeGroup(java.lang.String); same semantics for users -
markSyncBackGroupForDelete
RegistertargetIdas deleted from the target this run. No-op when group reporting is off ortargetIdis null. -
clearSyncBackGroupForDelete
DroptargetIdfrom the group deleted set (cheap, idempotent). -
markSyncBackUserForDelete
seemarkSyncBackGroupForDelete(java.lang.String); same semantics for users -
clearSyncBackUserForDelete
seeclearSyncBackGroupForDelete(java.lang.String); same semantics for users -
recordTargetNativeGroupWrite
public void recordTargetNativeGroupWrite(String targetId, GrouperProvisioningTargetNativeGroup grouperProvisioningTargetNativeGroup) Group-write sync-back hook, called from a provisioner's insert/update commands path right after the target write (create or attribute update). Runs four steps in order:- mark the target id for sync-back read (the drain ensures it later),
- drop the id from the deleted set (a write supersedes a pending delete),
- remove any stale read-map representation -- for an update this is the crucial step (drops the pre-write read-pass native so the drain re-reads it; an insert normally has none),
- if the write returned the native object, register it like a read so no re-read is needed -- the drain then cross-checks the read map and skips this id.
targetIdis null.- Parameters:
targetId- native target id of the written groupgrouperProvisioningTargetNativeGroup- native object from the write response, or null when the write returned no usable body (then the drain bulk-reads it)
-
recordTargetNativeUserWrite
public void recordTargetNativeUserWrite(String targetId, GrouperProvisioningTargetNativeUser grouperProvisioningTargetNativeUser) Entity-write sync-back hook; the user-axis mirror ofrecordTargetNativeGroupWrite(String, GrouperProvisioningTargetNativeGroup)(mark to-read, clear pending delete, drop stale rep, register if returned). No-op when entity reporting is off ortargetIdis null.- Parameters:
targetId- native target id of the written entitygrouperProvisioningTargetNativeUser- native object from the write response, or null when the write returned no usable body (then the drain bulk-reads it)
-
recordTargetNativeMembershipInsert
Record a successful membership add (SCIM PATCH op=add, or any protocol's add-member write): putMultiKey(targetGroupId, targetUserId)in the native membership map. Last-write-wins on a duplicate key (re-adding an existing member is a harmless no-op). No-op when membership reporting is off or either id is null. -
recordTargetNativeMembershipDelete
Record a successful membership remove (SCIM PATCH op=remove, or any protocol's remove-member write): dropMultiKey(targetGroupId, targetUserId)from the native membership map so the end-of-run flush deletes its grouper_prov_mship row. Idempotent. No-op when membership reporting is off or either id is null. -
recordTargetNativeMembershipReplace
public void recordTargetNativeMembershipReplace(String targetGroupId, Collection<String> targetUserIds) Record a successful full-members replace for one group (SCIM PATCH op=replace on members): the group's membership set in the mirror becomes exactlytargetUserIds. Every existing entry for the group is dropped, then one entry per id is added. A null/empty id list is valid and clears the group's memberships. No-op when membership reporting is off ortargetGroupIdis null.
-