public static <A extends AsynchronousOperationResult> ProvisioningOperationState<A> fromPendingOperations( PrismObject<ShadowType> repoShadow, List<PendingOperationType> pendingOperations) { ProvisioningOperationState<A> opState = new ProvisioningOperationState<>(); if (pendingOperations == null || pendingOperations.isEmpty()) { throw new IllegalArgumentException("Empty list of pending operations, cannot create ProvisioningOperationState"); } opState.pendingOperations = pendingOperations; // TODO: check that they have the same status opState.executionStatus = pendingOperations.get(0).getExecutionStatus(); // TODO: better algorithm opState.attemptNumber = pendingOperations.get(0).getAttemptNumber(); opState.repoShadow = repoShadow; return opState; }
public PendingOperationAsserter<R> assertAttemptNumber(Integer expected) { assertEquals("Wrong attempt number in "+desc(), expected, pendingOperation.getAttemptNumber()); return this; }
private boolean needsRetry(PendingOperationType pendingOperation) { return PendingOperationExecutionStatusType.EXECUTING.equals(pendingOperation.getExecutionStatus()) && pendingOperation.getAttemptNumber() != null; }
ItemPath containerPath = pendingOperation.asPrismContainerValue().getPath(); int attemptNumber = pendingOperation.getAttemptNumber() + 1; PropertyDelta<Integer> attemptNumberDelta = shadowDelta.createPropertyModification(containerPath.append(PendingOperationType.F_ATTEMPT_NUMBER)); attemptNumberDelta.setRealValuesToReplace(attemptNumber);