public static ObjectDeltaListType createDeltaList(ObjectDeltaType... deltas) { ObjectDeltaListType list = new ObjectDeltaListType(); for (ObjectDeltaType delta: deltas) { list.getDelta().add(delta); } return list; }
/** * Creates a new {@code ObjectDeltaListType} instance by deeply copying a given {@code ObjectDeltaListType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public ObjectDeltaListType(final ObjectDeltaListType 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 'ObjectDeltaListType' from 'null'."); } // 'Delta' collection. if (o.delta!= null) { copyDelta(o.getDelta(), this.getDelta()); } }
public ObjectDeltaType beginDelta() { ObjectDeltaType value = new ObjectDeltaType(); delta(value); return value; }
/** * Create an instance of {@link ObjectDeltaListType } * */ public ObjectDeltaListType createObjectDeltaListType() { return new ObjectDeltaListType(); }
public ObjectDeltaListType delta(ObjectDeltaType value) { getDelta().add(value); return this; }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public ExecuteChangesType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final ExecuteChangesType clone = ((ExecuteChangesType) super.clone()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType clone.deltaList = ((this.deltaList == null)?null:((this.getDeltaList() == null)?null:this.getDeltaList().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType clone.options = ((this.options == null)?null:((this.getOptions() == null)?null:this.getOptions().clone())); return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
/** * Create an instance of {@link ObjectDeltaListType } * */ public ObjectDeltaListType createObjectDeltaListType() { return new ObjectDeltaListType(); }
public static Collection<ObjectDelta> createObjectDeltas(ObjectDeltaListType deltaList, PrismContext prismContext) throws SchemaException { List<ObjectDelta> retval = new ArrayList<>(); for (ObjectDeltaType deltaType : deltaList.getDelta()) { retval.add(createObjectDelta(deltaType, prismContext)); } return retval; } }
/** * Creates a new {@code ExecuteChangesType} instance by deeply copying a given {@code ExecuteChangesType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public ExecuteChangesType(final ExecuteChangesType 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 'ExecuteChangesType' from 'null'."); } // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType this.deltaList = ((o.deltaList == null)?null:((o.getDeltaList() == null)?null:o.getDeltaList().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType this.options = ((o.options == null)?null:((o.getOptions() == null)?null:o.getOptions().clone())); }
private OperationResultType modifyObjectViaModelWS(ObjectDeltaType objectChange) throws FaultMessage { ObjectDeltaListType deltaList = new ObjectDeltaListType(); deltaList.getDelta().add(objectChange); ObjectDeltaOperationListType list = modelWeb.executeChanges(deltaList, null); return getOdoFromDeltaOperationList(list, objectChange).getExecutionResult(); }
/** * Create an instance of {@link ObjectDeltaListType } * */ public ObjectDeltaListType createObjectDeltaListType() { return new ObjectDeltaListType(); }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<ObjectDeltaType> theDelta; theDelta = (((this.delta!= null)&&(!this.delta.isEmpty()))?this.getDelta():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "delta", theDelta), currentHashCode, theDelta); } return currentHashCode; }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public ObjectDeltaListType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final ObjectDeltaListType clone = ((ObjectDeltaListType) super.clone()); // 'Delta' collection. if (this.delta!= null) { clone.delta = null; copyDelta(this.getDelta(), clone.getDelta()); } return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
public static <O extends ObjectType> ObjectDeltaListType createModificationDeltaList(Class<O> type, String oid, String path, ModificationTypeType modType, Object... values) { ObjectDeltaListType deltaList = new ObjectDeltaListType(); ObjectDeltaType delta = new ObjectDeltaType(); delta.setObjectType(getTypeQName(type)); delta.setChangeType(ChangeTypeType.MODIFY); delta.setOid(oid); ItemDeltaType itemDelta = new ItemDeltaType(); itemDelta.setPath(ModelClientUtil.createItemPathType(path)); itemDelta.setModificationType(modType); itemDelta.getValue().addAll(Arrays.asList(values)); delta.getItemDelta().add(itemDelta); deltaList.getDelta().add(delta); return deltaList; }
public ObjectDeltaListType beginDeltaList() { ObjectDeltaListType value = new ObjectDeltaListType(); deltaList(value); return value; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof ObjectDeltaListType)) { return false; } if (this == object) { return true; } final ObjectDeltaListType that = ((ObjectDeltaListType) object); { List<ObjectDeltaType> lhsDelta; lhsDelta = (((this.delta!= null)&&(!this.delta.isEmpty()))?this.getDelta():null); List<ObjectDeltaType> rhsDelta; rhsDelta = (((that.delta!= null)&&(!that.delta.isEmpty()))?that.getDelta():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "delta", lhsDelta), LocatorUtils.property(thatLocator, "delta", rhsDelta), lhsDelta, rhsDelta)) { return false; } } return true; }
@Test public void test200ModifyAccountWrongExplicitType() throws Exception { final String TEST_NAME = "test200ModifyAccountWrongExplicitType"; TestUtil.displayTestTitle(this, TEST_NAME); // GIVEN Task task = taskManager.createTaskInstance(TestModelWebServiceNegative.class.getName() + "." + TEST_NAME); ObjectDeltaType objectChange = createShadowReplaceChange(ACCOUNT_SHADOW_GUYBRUSH_OID, "attributes/"+DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, "42", DOMUtil.XSD_INT); ObjectDeltaListType deltaList = new ObjectDeltaListType(); deltaList.getDelta().add(objectChange); // WHEN, THEN //assertExecuteChangesFailure(deltaList, null, SchemaViolationFaultType.class, "The value of type", "cannot be applied to attribute"); assertExecuteChangesFailure(deltaList, null, SchemaViolationFaultType.class, "Expected", "but got class"); }
private OperationResultType deleteObjectViaModelWS(QName typeQName, String oid) throws FaultMessage { ObjectDeltaListType deltaList = new ObjectDeltaListType(); ObjectDeltaType objectDelta = new ObjectDeltaType(); objectDelta.setOid(oid); objectDelta.setObjectType(typeQName); objectDelta.setChangeType(ChangeTypeType.DELETE); deltaList.getDelta().add(objectDelta); ObjectDeltaOperationListType list = modelWeb.executeChanges(deltaList, null); return getOdoFromDeltaOperationList(list, objectDelta).getExecutionResult(); }
/** * First tests are positive, to make sure that this method works. */ @Test public void test110ModifyAccountImplicitType() throws Exception { final String TEST_NAME = "test110ModifyAccountImplicitType"; TestUtil.displayTestTitle(this, TEST_NAME); // GIVEN Task task = taskManager.createTaskInstance(TestModelWebServiceNegative.class.getName() + "." + TEST_NAME); ObjectDeltaType objectChange = createShadowReplaceChange(ACCOUNT_SHADOW_GUYBRUSH_OID, "attributes/"+DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, "bar", null); ObjectDeltaListType deltaList = new ObjectDeltaListType(); deltaList.getDelta().add(objectChange); // WHEN modelWeb.executeChanges(deltaList, null); // THEN // Check account in dummy resource assertDefaultDummyAccount(ACCOUNT_GUYBRUSH_DUMMY_USERNAME, ACCOUNT_GUYBRUSH_DUMMY_FULLNAME, true); assertDummyAccountAttribute(null, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, "bar"); }