/** * Create an instance of {@link ObjectDeltaOperationListType } * */ public ObjectDeltaOperationListType createObjectDeltaOperationListType() { return new ObjectDeltaOperationListType(); }
public ObjectDeltaOperationListType deltaOperation(ObjectDeltaOperationType value) { getDeltaOperation().add(value); return this; }
/** * Creates a new {@code ObjectDeltaOperationListType} instance by deeply copying a given {@code ObjectDeltaOperationListType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public ObjectDeltaOperationListType(final ObjectDeltaOperationListType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'ObjectDeltaOperationListType' from 'null'."); } // 'DeltaOperation' collection. if (o.deltaOperation!= null) { copyDeltaOperation(o.getDeltaOperation(), this.getDeltaOperation()); } }
@Override public ObjectDeltaOperationListType executeChanges(ObjectDeltaListType deltaList, ModelExecuteOptionsType optionsType) throws FaultMessage { notNullArgument(deltaList, "Object delta list must not be null."); Task task = createTaskInstance(EXECUTE_CHANGES); auditLogin(task); OperationResult operationResult = task.getResult(); try { Collection<ObjectDelta> deltas = DeltaConvertor.createObjectDeltas(deltaList, prismContext); for (ObjectDelta delta : deltas) { prismContext.adopt(delta); } ModelExecuteOptions options = ModelExecuteOptions.fromModelExecutionOptionsType(optionsType); Collection<ObjectDeltaOperation<? extends ObjectType>> objectDeltaOperations = modelService.executeChanges((Collection) deltas, options, task, operationResult); // brutally eliminating type-safety compiler barking ObjectDeltaOperationListType retval = new ObjectDeltaOperationListType(); for (ObjectDeltaOperation objectDeltaOperation : objectDeltaOperations) { ObjectDeltaOperationType objectDeltaOperationType = DeltaConvertor.toObjectDeltaOperationType(objectDeltaOperation, null); retval.getDeltaOperation().add(objectDeltaOperationType); } return retval; } catch (Exception ex) { LoggingUtils.logException(LOGGER, "# MODEL executeChanges() failed", ex); throwFault(ex, operationResult); // notreached return null; } finally { auditLogout(task); } }
/** * Creates a new {@code ExecuteChangesResponseType} instance by deeply copying a given {@code ExecuteChangesResponseType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public ExecuteChangesResponseType(final ExecuteChangesResponseType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'ExecuteChangesResponseType' from 'null'."); } // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType this.deltaOperationList = ((o.deltaOperationList == null)?null:((o.getDeltaOperationList() == null)?null:o.getDeltaOperationList().clone())); }
public int hashCode() { final HashCodeStrategy strategy = DomAwareHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); }
public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public ObjectDeltaOperationType beginDeltaOperation() { ObjectDeltaOperationType value = new ObjectDeltaOperationType(); deltaOperation(value); return value; }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public ExecuteChangesResponseType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final ExecuteChangesResponseType clone = ((ExecuteChangesResponseType) super.clone()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType clone.deltaOperationList = ((this.deltaOperationList == null)?null:((this.getDeltaOperationList() == null)?null:this.getDeltaOperationList().clone())); return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<ObjectDeltaOperationType> theDeltaOperation; theDeltaOperation = (((this.deltaOperation!= null)&&(!this.deltaOperation.isEmpty()))?this.getDeltaOperation():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "deltaOperation", theDeltaOperation), currentHashCode, theDeltaOperation); } return currentHashCode; }
/** * Create an instance of {@link ObjectDeltaOperationListType } * */ public ObjectDeltaOperationListType createObjectDeltaOperationListType() { return new ObjectDeltaOperationListType(); }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public ObjectDeltaOperationListType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final ObjectDeltaOperationListType clone = ((ObjectDeltaOperationListType) super.clone()); // 'DeltaOperation' collection. if (this.deltaOperation!= null) { clone.deltaOperation = null; copyDeltaOperation(this.getDeltaOperation(), clone.getDeltaOperation()); } return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof ObjectDeltaOperationListType)) { return false; } if (this == object) { return true; } final ObjectDeltaOperationListType that = ((ObjectDeltaOperationListType) object); { List<ObjectDeltaOperationType> lhsDeltaOperation; lhsDeltaOperation = (((this.deltaOperation!= null)&&(!this.deltaOperation.isEmpty()))?this.getDeltaOperation():null); List<ObjectDeltaOperationType> rhsDeltaOperation; rhsDeltaOperation = (((that.deltaOperation!= null)&&(!that.deltaOperation.isEmpty()))?that.getDeltaOperation():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "deltaOperation", lhsDeltaOperation), LocatorUtils.property(thatLocator, "deltaOperation", rhsDeltaOperation), lhsDeltaOperation, rhsDeltaOperation)) { return false; } } return true; }
/** * Create an instance of {@link ObjectDeltaOperationListType } * */ public ObjectDeltaOperationListType createObjectDeltaOperationListType() { return new ObjectDeltaOperationListType(); }
public static ObjectDeltaOperationType findInDeltaOperationList(ObjectDeltaOperationListType operationListType, ObjectDeltaType originalDelta) { Validate.notNull(operationListType); Validate.notNull(originalDelta); if (originalDelta.getChangeType() != ChangeTypeType.ADD) { throw new IllegalArgumentException("Original delta is not of ADD type"); } if (originalDelta.getObjectToAdd() == null) { throw new IllegalArgumentException("Original delta contains no object-to-be-added"); } for (ObjectDeltaOperationType operationType : operationListType.getDeltaOperation()) { ObjectDeltaType objectDeltaType = operationType.getObjectDelta(); if (objectDeltaType.getChangeType() == ChangeTypeType.ADD && objectDeltaType.getObjectToAdd() != null) { ObjectType objectAdded = (ObjectType) objectDeltaType.getObjectToAdd(); if (objectAdded.getClass().equals(originalDelta.getObjectToAdd().getClass())) { return operationType; } } } return null; }
public ObjectDeltaOperationListType beginDeltaOperationList() { ObjectDeltaOperationListType value = new ObjectDeltaOperationListType(); deltaOperationList(value); return value; }
/** * Retrieves OID created by model Web Service from the returned list of ObjectDeltaOperations. * * @param operationListType result of the model web service executeChanges call * @param originalDelta original request used to find corresponding ObjectDeltaOperationType instance. Must be of ADD type. * @return OID if found * * PRELIMINARY IMPLEMENTATION. Currently the first returned ADD delta with the same object type as original delta is returned. */ public static String getOidFromDeltaOperationList(ObjectDeltaOperationListType operationListType, ObjectDeltaType originalDelta) { Validate.notNull(operationListType); Validate.notNull(originalDelta); if (originalDelta.getChangeType() != ChangeTypeType.ADD) { throw new IllegalArgumentException("Original delta is not of ADD type"); } if (originalDelta.getObjectToAdd() == null) { throw new IllegalArgumentException("Original delta contains no object-to-be-added"); } for (ObjectDeltaOperationType operationType : operationListType.getDeltaOperation()) { ObjectDeltaType objectDeltaType = operationType.getObjectDelta(); if (objectDeltaType.getChangeType() == ChangeTypeType.ADD && objectDeltaType.getObjectToAdd() != null) { ObjectType objectAdded = (ObjectType) objectDeltaType.getObjectToAdd(); if (objectAdded.getClass().equals(originalDelta.getObjectToAdd().getClass())) { return objectAdded.getOid(); } } } return null; }
private static ObjectDeltaOperationType getOdoFromDeltaOperationList(ObjectDeltaOperationListType operationListType, ObjectDeltaType originalDelta) { Validate.notNull(operationListType); Validate.notNull(originalDelta); for (ObjectDeltaOperationType operationType : operationListType.getDeltaOperation()) { ObjectDeltaType objectDeltaType = operationType.getObjectDelta(); if (originalDelta.getChangeType() == ChangeTypeType.ADD) { if (objectDeltaType.getChangeType() == originalDelta.getChangeType() && objectDeltaType.getObjectToAdd() != null) { ObjectType objectAdded = (ObjectType) objectDeltaType.getObjectToAdd(); if (objectAdded.getClass().equals(originalDelta.getObjectToAdd().getClass())) { return operationType; } } } else { if (objectDeltaType.getChangeType() == originalDelta.getChangeType() && originalDelta.getOid().equals(objectDeltaType.getOid())) { return operationType; } } } throw new IllegalStateException("No suitable ObjectDeltaOperationType found"); }