public ObjectDelta<ShadowType> getShadowDelta() { return (ObjectDelta<ShadowType>) accountOperationDescription.getObjectDelta(); }
public String getPlaintextPassword() { ObjectDelta delta = getAccountOperationDescription().getObjectDelta(); return delta != null ? getNotificationFunctions().getPlaintextPasswordFromDelta(delta) : null; }
private void executeNotifyAny(OperationStatus status, ResourceOperationDescription operationDescription, Task task, OperationResult result) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("AccountOperationListener.notify ({}) called with operationDescription = {}", status, operationDescription.debugDump()); } if (operationDescription.getObjectDelta() == null) { LOGGER.warn("Object delta is null, exiting the change listener."); return; } if (operationDescription.getCurrentShadow() == null) { LOGGER.warn("Current shadow is null, exiting the change listener."); return; } // for the time being, we deal only with accounts here if (operationDescription.getObjectDelta().getObjectTypeClass() == null || !ShadowType.class.isAssignableFrom(operationDescription.getObjectDelta().getObjectTypeClass())) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Object that was changed was not an account, exiting the operation listener (class = {})", operationDescription.getObjectDelta().getObjectTypeClass()); } return; } ResourceObjectEvent request = createRequest(status, operationDescription, task, result); notificationManager.processEvent(request, task, result); }
@Override protected boolean checkApplicability(Event event, GeneralNotifierType generalNotifierType, OperationResult result) { if (!event.isSuccess()) { LOGGER.trace("Operation was not successful, exiting."); return false; } ResourceObjectEvent resourceObjectEvent = (ResourceObjectEvent) event; ObjectDelta<? extends ShadowType> delta = resourceObjectEvent.getAccountOperationDescription().getObjectDelta(); if (delta == null) { // should not occur LOGGER.trace("Object delta is null, exiting. Event = " + event); return false; } return functions.getPlaintextPasswordFromDelta(delta) != null; }
ObjectDelta<ShadowType> delta = (ObjectDelta<ShadowType>) rod.getObjectDelta();
@Override protected String getSubject(Event event, GeneralNotifierType generalNotifierType, String transport, Task task, OperationResult result) { ResourceObjectEvent resourceObjectEvent = (ResourceObjectEvent) event; ResourceOperationDescription rod = resourceObjectEvent.getAccountOperationDescription(); ObjectDelta<ShadowType> delta = (ObjectDelta<ShadowType>) rod.getObjectDelta(); String objectTypeDescription = resourceObjectEvent.isShadowKind(ShadowKindType.ACCOUNT) ? "Account" : "Resource object"; if (delta.isAdd()) { return objectTypeDescription + " creation notification"; } else if (delta.isModify()) { return objectTypeDescription + " modification notification"; } else if (delta.isDelete()) { return objectTypeDescription + " deletion notification"; } else { return "(unknown resource object operation)"; } }
private ResourceObjectEvent createRequest(OperationStatus status, ResourceOperationDescription operationDescription, Task task, OperationResult result) { ResourceObjectEvent event = new ResourceObjectEvent(lightweightIdentifierGenerator); event.setAccountOperationDescription(operationDescription); event.setOperationStatus(status); event.setChangeType(operationDescription.getObjectDelta().getChangeType()); // fortunately there's 1:1 mapping String accountOid = operationDescription.getObjectDelta().getOid(); PrismObject<UserType> user = findRequestee(accountOid, task, result, operationDescription.getObjectDelta().isDelete()); if (user != null) { event.setRequestee(new SimpleObjectRefImpl(notificationsUtil, user.asObjectable())); } // otherwise, appropriate messages were already logged if (task != null && task.getOwner() != null) { event.setRequester(new SimpleObjectRefImpl(notificationsUtil, task.getOwner())); } else { LOGGER.warn("No owner for task {}, therefore no requester will be set for event {}", task, event.getId()); } if (task != null && task.getChannel() != null) { event.setChannel(task.getChannel()); } else if (operationDescription.getSourceChannel() != null) { event.setChannel(operationDescription.getSourceChannel()); } return event; }
assertNotNull("Delta not present", opDescription.getObjectDelta()); if (opDescription.getCurrentShadow() != null) { ShadowType currentShadowType = opDescription.getCurrentShadow().asObjectable(); if (!opDescription.getObjectDelta().isDelete() && !failure){ try { repositoryService.getObject(currentShadowType.getClass(), currentShadowType.getOid(), null, new OperationResult("mockSyncService."+notificationDesc)); if (opDescription.getObjectDelta() != null && !failure) { assertNotNull("Delta has null OID", opDescription.getObjectDelta().getOid());