@Override protected AnyPatch doUpdate( final AnyTO before, final AnyPatch anyPatch, final SyncDelta delta, final ProvisioningReport result) { AnyObjectPatch anyObjectPatch = AnyObjectPatch.class.cast(anyPatch); Pair<AnyObjectPatch, List<PropagationStatus>> updated = anyObjectProvisioningManager.update( anyObjectPatch, Collections.singleton(profile.getTask().getResource().getKey()), true); return anyPatch; } }
@Override protected AnyTO doCreate(final AnyTO anyTO, final SyncDelta delta) { GroupTO groupTO = GroupTO.class.cast(anyTO); Map.Entry<String, List<PropagationStatus>> created = groupProvisioningManager.create( groupTO, groupOwnerMap, Collections.singleton(profile.getTask().getResource().getKey()), true); return getAnyTO(created.getKey()); }
@Override protected AnyTO doCreate(final AnyTO anyTO, final SyncDelta delta) { AnyObjectTO anyObjectTO = AnyObjectTO.class.cast(anyTO); Map.Entry<String, List<PropagationStatus>> created = anyObjectProvisioningManager.create( anyObjectTO, Collections.singleton(profile.getTask().getResource().getKey()), true); return getAnyTO(created.getKey()); }
@Override protected AnyTO doCreate(final AnyTO anyTO, final SyncDelta delta) { UserTO userTO = UserTO.class.cast(anyTO); Boolean enabled = pullUtils.readEnabled(delta.getObject(), profile.getTask()); Map.Entry<String, List<PropagationStatus>> created = userProvisioningManager.create(userTO, true, true, enabled, Collections.singleton(profile.getTask().getResource().getKey()), true); return getAnyTO(created.getKey()); }
@Override protected AnyPatch doUpdate( final AnyTO before, final AnyPatch anyPatch, final SyncDelta delta, final ProvisioningReport result) { UserPatch userPatch = UserPatch.class.cast(anyPatch); Boolean enabled = pullUtils.readEnabled(delta.getObject(), profile.getTask()); Pair<UserPatch, List<PropagationStatus>> updated = userProvisioningManager.update( userPatch, result, enabled, Collections.singleton(profile.getTask().getResource().getKey()), true); return updated.getLeft(); } }
AuditElements.EventCategoryType.PULL, REALM_TYPE.toLowerCase(), profile.getTask().getResource().getKey(), event, result, AuditElements.EventCategoryType.PULL, REALM_TYPE.toLowerCase(), profile.getTask().getResource().getKey(), event, result,
@Override protected AnyPatch doUpdate( final AnyTO before, final AnyPatch anyPatch, final SyncDelta delta, final ProvisioningReport result) { GroupPatch groupPatch = GroupPatch.class.cast(anyPatch); Pair<GroupPatch, List<PropagationStatus>> updated = groupProvisioningManager.update( groupPatch, Collections.singleton(profile.getTask().getResource().getKey()), true); String groupOwner = null; for (AttrPatch attrPatch : groupPatch.getPlainAttrs()) { if (attrPatch.getOperation() == PatchOperation.ADD_REPLACE && attrPatch.getAttrTO() != null && attrPatch.getAttrTO().getSchema().isEmpty() && !attrPatch.getAttrTO().getValues().isEmpty()) { groupOwner = attrPatch.getAttrTO().getValues().get(0); } } if (groupOwner != null) { groupOwnerMap.put(updated.getLeft().getKey(), groupOwner); } return anyPatch; }
anyTypeDAO.findUser(), entry.getValue(), ghandler.getProfile().getTask().getResource(), ghandler.getProfile().getConnector(), userIgnoreCaseMatch); anyTypeDAO.findGroup(), entry.getValue(), ghandler.getProfile().getTask().getResource(), ghandler.getProfile().getConnector(), groupIgnoreCaseMatch).
AuditElements.EventCategoryType.PULL, anyUtils.anyTypeKind().name().toLowerCase(), profile.getTask().getResource().getKey(), event, result, AuditElements.EventCategoryType.PULL, anyUtils.anyTypeKind().name().toLowerCase(), profile.getTask().getResource().getKey(), event, result,
realm.getResources().remove(profile.getTask().getResource()); } else { realm.add(profile.getTask().getResource());
final boolean dryRun) throws JobExecutionException { LOG.debug("Executing pull on {}", pullTask.getResource()); profile.getActions().addAll(actions); profile.setDryRun(dryRun); profile.setConflictResolutionAction(pullTask.getResource().getPullPolicy() == null ? ConflictResolutionAction.IGNORE : pullTask.getResource().getPullPolicy().getConflictResolutionAction()); if (pullTask.getResource().getOrgUnit() != null) { status.set("Pulling " + pullTask.getResource().getOrgUnit().getObjectClass().getObjectClassValue()); OrgUnit orgUnit = pullTask.getResource().getOrgUnit(); OperationOptions options = MappingUtils.buildOperationOptions( MappingUtils.getPullItems(orgUnit.getItems()).iterator()); boolean userIgnoreCaseMatch = false; boolean groupIgnoreCaseMatch = false; for (Provision provision : pullTask.getResource().getProvisions()) { if (provision.getMapping() != null) { if (provision.getAnyType().getKind() == AnyTypeKind.USER) { String result = createReport(profile.getResults(), pullTask.getResource(), dryRun); LOG.debug("Pull result: {}", result); return result;
propByRes.add(ResourceOperation.DELETE, profile.getTask().getResource().getKey()); taskExecutor.execute(propagationManager.createTasks(realm, propByRes, null), false); realm.getResources().remove(profile.getTask().getResource()); realmTO = binder.getRealmTO(realmDAO.save(realm), true); } else {
@Override public boolean handle(final SyncDelta delta) { try { OrgUnit orgUnit = profile.getTask().getResource().getOrgUnit(); if (orgUnit == null) { throw new JobExecutionException("No orgUnit found on " + profile.getTask().getResource() + " for " + delta.getObject().getObjectClass());
protected List<ProvisioningReport> assign( final SyncDelta delta, final Provision provision, final AnyUtils anyUtils) throws JobExecutionException { if (!profile.getTask().isPerformCreate()) { LOG.debug("PullTask not configured for create"); finalize(UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), Result.SUCCESS, null, null, delta); return Collections.<ProvisioningReport>emptyList(); } AnyTO anyTO = connObjectUtils.getAnyTO(delta.getObject(), profile.getTask(), provision, anyUtils); anyTO.getResources().add(profile.getTask().getResource().getKey()); ProvisioningReport result = new ProvisioningReport(); result.setOperation(ResourceOperation.CREATE); result.setAnyType(provision.getAnyType().getKey()); result.setStatus(ProvisioningReport.Status.SUCCESS); result.setName(getName(anyTO)); result.setUidValue(delta.getUid().getUidValue()); if (profile.isDryRun()) { result.setKey(null); finalize(UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), Result.SUCCESS, null, null, delta); } else { for (PullActions action : profile.getActions()) { action.beforeAssign(profile, delta, anyTO); } create(anyTO, delta, UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), provision, result); } return Collections.singletonList(result); }
delete(key, Collections.singleton(profile.getTask().getResource().getKey()), true); output = null; resultStatus = Result.SUCCESS;
Provision provision = null; try { provision = profile.getTask().getResource().getProvision(delta.getObject().getObjectClass()).orElse(null); if (provision == null) { throw new JobExecutionException("No provision found on " + profile.getTask().getResource() + " for " + delta.getObject().getObjectClass());
private List<ProvisioningReport> assign(final SyncDelta delta, final OrgUnit orgUnit) throws JobExecutionException { if (!profile.getTask().isPerformCreate()) { LOG.debug("PullTask not configured for create"); finalize(UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), Result.SUCCESS, null, null, delta); return Collections.<ProvisioningReport>emptyList(); } RealmTO realmTO = connObjectUtils.getRealmTO(delta.getObject(), profile.getTask(), orgUnit); if (realmTO.getFullPath() == null) { if (realmTO.getParent() == null) { realmTO.setParent(profile.getTask().getDestinatioRealm().getFullPath()); } realmTO.setFullPath(realmTO.getParent() + "/" + realmTO.getName()); } realmTO.getResources().add(profile.getTask().getResource().getKey()); ProvisioningReport result = new ProvisioningReport(); result.setOperation(ResourceOperation.CREATE); result.setAnyType(REALM_TYPE); result.setStatus(ProvisioningReport.Status.SUCCESS); result.setName(realmTO.getFullPath()); if (profile.isDryRun()) { result.setKey(null); finalize(UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), Result.SUCCESS, null, null, delta); } else { for (PullActions action : profile.getActions()) { action.beforeAssign(profile, delta, realmTO); } create(realmTO, delta, UnmatchingRule.ASSIGN, result); } return Collections.singletonList(result); }
propByRes.add(ResourceOperation.DELETE, profile.getTask().getResource().getKey()); taskExecutor.execute(propagationManager.getDeleteTasks( provision.getAnyType().getKind(), anyPatch.getResources().add(new StringPatchItem.Builder(). operation(PatchOperation.DELETE). value(profile.getTask().getResource().getKey()).build());
anyPatch.getResources().add(new StringPatchItem.Builder(). operation(unlink ? PatchOperation.DELETE : PatchOperation.ADD_REPLACE). value(profile.getTask().getResource().getKey()).build());
remediationTO.setResource(remediation.getPullTask().getResource().getKey());