/** * Create an instance of {@link PendingOperationType } * */ public PendingOperationType createPendingOperationType() { return new PendingOperationType(); }
/** * Create an instance of {@link PendingOperationType } * */ public PendingOperationType createPendingOperationType() { return new PendingOperationType(); }
/** * Create an instance of {@link PendingOperationType } * */ public PendingOperationType createPendingOperationType() { return new PendingOperationType(); }
public PendingOperationType beginPendingOperation() { PendingOperationType value = new PendingOperationType(); pendingOperation(value); return value; }
@Override protected PendingOperationType createItem(PrismContainerValue value) { PendingOperationType pendingOperation = new PendingOperationType(); pendingOperation.setupContainerValue(value); return pendingOperation; }
public PendingOperationType clone() { PendingOperationType object = new PendingOperationType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
ObjectDeltaType pendingDeltaType = DeltaConvertor.toObjectDeltaType(pendingDelta); PendingOperationType pendingOperation = new PendingOperationType(); pendingOperation.setDelta(pendingDeltaType); pendingOperation.setRequestTimestamp(clock.currentTimeXMLGregorianCalendar());
private PendingOperationType createPendingOperation( ObjectDelta<ShadowType> requestDelta, ProvisioningOperationState<? extends AsynchronousOperationResult> opState, String asyncOperationReference) throws SchemaException { ObjectDeltaType deltaType = DeltaConvertor.toObjectDeltaType(requestDelta); PendingOperationType pendingOperation = new PendingOperationType(); pendingOperation.setType(opState.getOperationType()); pendingOperation.setDelta(deltaType); XMLGregorianCalendar now = clock.currentTimeXMLGregorianCalendar(); pendingOperation.setRequestTimestamp(now); if (PendingOperationExecutionStatusType.EXECUTING.equals(opState.getExecutionStatus())) { pendingOperation.setOperationStartTimestamp(now); } pendingOperation.setExecutionStatus(opState.getExecutionStatus()); pendingOperation.setResultStatus(opState.getResultStatusType()); if (opState.getAttemptNumber() != null) { pendingOperation.setAttemptNumber(opState.getAttemptNumber()); pendingOperation.setLastAttemptTimestamp(now); } if (asyncOperationReference != null) { pendingOperation.setAsynchronousOperationReference(asyncOperationReference); } else { pendingOperation.setAsynchronousOperationReference(opState.getAsynchronousOperationReference()); } return pendingOperation; }
/** * Add shadow pendingOperations; MID-4831 */ @Test public void test250AddShadowPendingOperations() throws Exception { final String TEST_NAME = "test250AddShadowPendingOperations"; TestUtil.displayTestTitle(TEST_NAME); // GIVEN OperationResult result = new OperationResult(TEST_NAME); PrismObject<ShadowType> shadow = prismContext.createObjectable(ShadowType.class) .name("shadow1") .oid("000-aaa-bbb-ccc") .asPrismObject(); repositoryService.addObject(shadow, null, result); ObjectQuery query = prismContext.queryFor(ShadowType.class) .item(ShadowType.F_NAME).eqPoly("shadow1") .and().exists(ShadowType.F_PENDING_OPERATION) .build(); List<PrismObject<ShadowType>> objectsBefore = repositoryService.searchObjects(ShadowType.class, query, null, result); assertEquals("Wrong # of shadows found (before)", 0, objectsBefore.size()); // WHEN List<ItemDelta<?, ?>> itemDeltas = prismContext.deltaFor(ShadowType.class) .item(ShadowType.F_PENDING_OPERATION).add(new PendingOperationType(prismContext).executionStatus(COMPLETED)) .asItemDeltas(); repositoryService.modifyObject(ShadowType.class, shadow.getOid(), itemDeltas, getModifyOptions(), result); // THEN List<PrismObject<ShadowType>> objectsAfter = repositoryService.searchObjects(ShadowType.class, query, null, result); assertEquals("Wrong # of shadows found (after)", 1, objectsAfter.size()); display("object found (after)", objectsAfter.get(0)); }