private PrismObject<ShadowType> getShadowFromChange(ResourceObjectShadowChangeDescription change) { if (change.getCurrentShadow() != null) { return change.getCurrentShadow(); } if (change.getOldShadow() != null) { return change.getOldShadow(); } return null; }
@Override public void notifyChange(ResourceObjectShadowChangeDescription change, Task task, OperationResult parentResult) { cache.invalidate(change.getResource(), change.getCurrentShadow()); }
private void validate(ResourceObjectShadowChangeDescription change) { Validate.notNull(change, "Resource object shadow change description must not be null."); Validate.isTrue(change.getCurrentShadow() != null || change.getObjectDelta() != null, "Object delta and current shadow are null. At least one must be provided."); Validate.notNull(change.getResource(), "Resource in change must not be null."); if (consistencyChecks) { if (change.getCurrentShadow() != null) { change.getCurrentShadow().checkConsistence(); ShadowUtil.checkConsistence(change.getCurrentShadow(), "current shadow in change description"); } if (change.getObjectDelta() != null) { change.getObjectDelta().checkConsistence(); } } }
private String getOidFromChange(ResourceObjectShadowChangeDescription change) { if (change.getCurrentShadow() != null && StringUtils.isNotEmpty(change.getCurrentShadow().getOid())) { return change.getCurrentShadow().getOid(); } if (change.getOldShadow() != null && StringUtils.isNotEmpty(change.getOldShadow().getOid())) { return change.getOldShadow().getOid(); } if (change.getObjectDelta() == null || StringUtils.isEmpty(change.getObjectDelta().getOid())) { throw new IllegalArgumentException( "Oid was not defined in change (not in current, old shadow, delta)."); } return change.getObjectDelta().getOid(); }
public ResourceObjectShadowChangeDescriptionAsserter assertNoCurrentShadow() { assertNull("Unexpected current shadow in change notificaiton", changeDesc.getCurrentShadow()); return this; }
private boolean isThombstone(ResourceObjectShadowChangeDescription change) { PrismObject<? extends ShadowType> shadow = null; if (change.getOldShadow() != null) { shadow = change.getOldShadow(); } else if (change.getCurrentShadow() != null) { shadow = change.getCurrentShadow(); } if (shadow != null) { if (shadow.asObjectable().isDead() != null) { return shadow.asObjectable().isDead(); } } ObjectDelta<? extends ShadowType> objectDelta = change.getObjectDelta(); return objectDelta != null && objectDelta.isDelete(); }
public ShadowAsserter<ResourceObjectShadowChangeDescriptionAsserter> currentShadow() { PrismObject<ShadowType> currentShadow = changeDesc.getCurrentShadow(); assertNotNull("No current shadow in change notification", currentShadow); return new ShadowAsserter<>(currentShadow, this, "currentShadow in change notification"); }
PrismObject<? extends ShadowType> resourceShadow = change.getCurrentShadow();
assertNotNull("No parent result", parentResult); assertTrue("Either current shadow or delta must be present", change.getCurrentShadow() != null || change.getObjectDelta() != null); if (change.isUnrelatedChange() || isDryRun(task) || (change.getCurrentShadow() != null && change.getCurrentShadow().asObjectable().isProtectedObject() == Boolean.TRUE)){ return; if (change.getCurrentShadow() != null) { ShadowType currentShadowType = change.getCurrentShadow().asObjectable(); if (currentShadowType != null) { assertNotNull("Current shadow does not have an OID", change.getCurrentShadow().getOid()); assertNotNull("Current shadow does not have resourceRef", currentShadowType.getResourceRef()); assertNotNull("Current shadow has null attributes", currentShadowType.getAttributes()); if (change.getCurrentShadow().asObjectable().getKind() == ShadowKindType.ACCOUNT) { ShadowType account = change.getCurrentShadow().asObjectable(); if (ShadowUtil.isExists(account)) { if (supportActivation) {
PrismObject<ShadowType> currentShadow = lastChange.getCurrentShadow(); assertNotNull("Current shadow missing", lastChange.getCurrentShadow()); assertTrue("Wrong type of current shadow: " + currentShadow.getClass().getName(), currentShadow.canRepresent(ShadowType.class));
PrismObject<ShadowType> currentShadow = lastChange.getCurrentShadow(); assertNotNull("Current shadow missing", lastChange.getCurrentShadow()); assertTrue("Wrong type of current shadow: " + currentShadow.getClass().getName(), currentShadow.canRepresent(ShadowType.class));
PrismObject<ShadowType> currentShadow = lastChange.getCurrentShadow(); assertNotNull("Current shadow missing", lastChange.getCurrentShadow()); assertTrue("Wrong type of current shadow: " + currentShadow.getClass().getName(), currentShadow.canRepresent(ShadowType.class));
PrismObject<? extends ShadowType> currentShadow = lastChange.getCurrentShadow(); assertNotNull("No current shadow in change notification", currentShadow); assertNotNull("No old shadow in change notification", lastChange.getOldShadow());
ShadowType currentShadowType = lastChange.getCurrentShadow().asObjectable(); assertNotNull("Current shadow missing", lastChange.getCurrentShadow()); PrismAsserts.assertClass("current shadow", ShadowType.class, currentShadowType);
ShadowType currentShadowType = lastChange.getCurrentShadow().asObjectable(); assertNotNull("Current shadow missing", lastChange.getCurrentShadow()); PrismAsserts.assertClass("current shadow", ShadowType.class, currentShadowType);
PrismObject<ShadowType> currentShadow = change.getCurrentShadow(); PrismObject<ShadowType> applicableShadow = currentShadow; if (applicableShadow == null) {