@Override protected PasswordPatch newInstance() { return new PasswordPatch(); }
public Builder resources(final String... resources) { getInstance().getResources().addAll(Arrays.asList(resources)); return this; }
public Builder onSyncope(final boolean onSyncope) { getInstance().setOnSyncope(onSyncope); return this; }
@Override public List<PropagationStatus> provision( final String key, final boolean changePwd, final String password, final Collection<String> resources, final boolean nullPriorityAsync) { UserPatch userPatch = new UserPatch(); userPatch.setKey(key); userPatch.getResources().addAll(resources.stream().map(resource -> new StringPatchItem.Builder().operation(PatchOperation.ADD_REPLACE).value(resource).build()). collect(Collectors.toSet())); if (changePwd) { PasswordPatch passwordPatch = new PasswordPatch(); passwordPatch.setOnSyncope(false); passwordPatch.getResources().addAll(resources); passwordPatch.setValue(password); userPatch.setPassword(passwordPatch); } PropagationByResource propByRes = new PropagationByResource(); propByRes.addAll(ResourceOperation.UPDATE, resources); WorkflowResult<Pair<UserPatch, Boolean>> wfResult = new WorkflowResult<>( ImmutablePair.of(userPatch, (Boolean) null), propByRes, "update"); List<PropagationTaskInfo> taskInfos = propagationManager.getUserUpdateTasks(wfResult, changePwd, null); PropagationReporter propagationReporter = taskExecutor.execute(taskInfos, nullPriorityAsync); return propagationReporter.getStatuses(); }
if (userPatch.getPassword() != null && StringUtils.isNotBlank(userPatch.getPassword().getValue())) { if (userPatch.getPassword().isOnSyncope()) { setPassword(user, userPatch.getPassword().getValue(), scce); user.setChangePwdDate(new Date()); propByRes.addAll(ResourceOperation.UPDATE, userPatch.getPassword().getResources()); userPatch.setPassword(new PasswordPatch()); userPatch.getPassword().getResources().add(resource.getKey()); });
@Transactional(readOnly = true) @Override public <M extends AnyPatch> void beforeUpdate( final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final EntityTO entityTO, final M anyPatch) throws JobExecutionException { if (anyPatch instanceof UserPatch) { PasswordPatch modPassword = ((UserPatch) anyPatch).getPassword(); parseEncodedPassword(modPassword == null ? null : modPassword.getValue()); } }
@Override public int hashCode() { return new HashCodeBuilder(). appendSuper(super.hashCode()). append(key). append(type). append(token). build(); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AssociationPatch other = (AssociationPatch) obj; return new EqualsBuilder(). appendSuper(super.equals(obj)). append(key, other.key). append(action, other.action). build(); } }
@Transactional(readOnly = true) @Override public <M extends AnyPatch> void beforeUpdate( final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final EntityTO entityTO, final M anyPatch) throws JobExecutionException { if (anyPatch instanceof UserPatch) { PasswordPatch modPassword = ((UserPatch) anyPatch).getPassword(); parseEncodedPassword(modPassword == null ? null : modPassword.getValue(), profile.getConnector()); } }
@Override public int hashCode() { return new HashCodeBuilder(). appendSuper(super.hashCode()). append(key). append(action). build(); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final StatusPatch other = (StatusPatch) obj; return new EqualsBuilder(). appendSuper(super.equals(obj)). append(key, other.key). append(type, other.type). append(token, other.token). build(); } }
@Override public List<PropagationTaskInfo> getUserUpdateTasks( final WorkflowResult<Pair<UserPatch, Boolean>> wfResult, final boolean changePwd, final Collection<String> noPropResourceKeys) { return getUpdateTasks( userDAO.authFind(wfResult.getResult().getLeft().getKey()), wfResult.getResult().getKey().getPassword() == null ? null : wfResult.getResult().getKey().getPassword().getValue(), changePwd, wfResult.getResult().getValue(), wfResult.getPropByRes(), wfResult.getResult().getKey().getVirAttrs(), noPropResourceKeys); }
public Builder resource(final String resource) { if (resource != null) { getInstance().getResources().add(resource); } return this; }
result.setPassword(userPatch.getPassword().getValue());
public Builder resources(final Collection<String> resources) { if (resources != null) { getInstance().getResources().addAll(resources); } return this; }
wfResult.getResult(), new PropagationByResource(), wfResult.getPerformedTasks()); Set<String> pwdResourceNames = new HashSet<>(userPatch.getPassword().getResources()); Collection<String> allResourceNames = userDAO.findAllResourceKeys(userPatch.getKey()); pwdResourceNames.retainAll(allResourceNames);