Search in sources :

Example 6 with ModelExecuteOptionsType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType in project midpoint by Evolveum.

the class AbstractTestForExchangeConnector method deleteTask.

protected void deleteTask(String oid) throws FaultMessage {
    ObjectDeltaType deltaType = new ObjectDeltaType();
    deltaType.setObjectType(ModelClientUtil.getTypeQName(TaskType.class));
    deltaType.setChangeType(ChangeTypeType.DELETE);
    deltaType.setOid(oid);
    ObjectDeltaListType deltaListType = new ObjectDeltaListType();
    deltaListType.getDelta().add(deltaType);
    ModelExecuteOptionsType executeOptionsType = new ModelExecuteOptionsType();
    executeOptionsType.setRaw(true);
    modelPort.executeChanges(deltaListType, executeOptionsType);
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) ModelExecuteOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)

Example 7 with ModelExecuteOptionsType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType in project midpoint by Evolveum.

the class AbstractTestForExchangeConnector method modifyObject.

protected ObjectDeltaOperationType modifyObject(Class objectType, String oid, String path, ModificationTypeType modType, Object value, ModelExecuteOptionsType optionsType, boolean assertSuccess) throws Exception {
    System.out.println("Modifying " + objectType.getSimpleName() + " " + oid + " (path: " + path + ")");
    ObjectDeltaType deltaType = new ObjectDeltaType();
    deltaType.setObjectType(ModelClientUtil.getTypeQName(objectType));
    deltaType.setChangeType(ChangeTypeType.MODIFY);
    deltaType.setOid(oid);
    if (path != null) {
        ItemDeltaType itemDelta = new ItemDeltaType();
        itemDelta.setModificationType(modType);
        itemDelta.setPath(createNonDefaultItemPathType(path));
        if (!(value instanceof Collection)) {
            itemDelta.getValue().add(value);
        } else {
            itemDelta.getValue().addAll((Collection) value);
        }
        deltaType.getItemDelta().add(itemDelta);
    }
    ObjectDeltaListType deltaListType = new ObjectDeltaListType();
    deltaListType.getDelta().add(deltaType);
    ObjectDeltaOperationListType odolist = modelPort.executeChanges(deltaListType, optionsType);
    return assertExecuteChangesSuccess(odolist, deltaType, assertSuccess);
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) Collection(java.util.Collection) ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType) ItemDeltaType(com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType)

Example 8 with ModelExecuteOptionsType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType in project midpoint by Evolveum.

the class AbstractWebserviceTest method deleteObject.

protected <O extends ObjectType> void deleteObject(Class<O> type, String oid, ModelExecuteOptionsType options) throws FaultMessage {
    ObjectDeltaListType deltaList = new ObjectDeltaListType();
    ObjectDeltaType delta = new ObjectDeltaType();
    delta.setObjectType(getTypeQName(type));
    delta.setChangeType(ChangeTypeType.DELETE);
    delta.setOid(oid);
    deltaList.getDelta().add(delta);
    ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, options);
    assertSuccess(deltaOpList);
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)

Example 9 with ModelExecuteOptionsType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType in project midpoint by Evolveum.

the class TestWSSanity method test020AddResourceOpenDj.

@Test
public void test020AddResourceOpenDj() throws Exception {
    final String TEST_NAME = "test020AddResourceOpenDj";
    displayTestTitle(TEST_NAME);
    LogfileTestTailer tailer = createLogTailer();
    ResourceType resource = ModelClientUtil.unmarshallFile(RESOURCE_OPENDJ_FILE);
    ObjectDeltaListType deltaList = new ObjectDeltaListType();
    ObjectDeltaType delta = new ObjectDeltaType();
    delta.setObjectType(getTypeQName(ResourceType.class));
    delta.setChangeType(ChangeTypeType.ADD);
    delta.setObjectToAdd(resource);
    deltaList.getDelta().add(delta);
    ModelExecuteOptionsType options = new ModelExecuteOptionsType();
    options.setIsImport(Boolean.TRUE);
    XMLGregorianCalendar startTs = TestUtil.currentTime();
    // WHEN
    ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, options);
    // THEN
    assertSuccess(deltaOpList);
    String oid = deltaOpList.getDeltaOperation().get(0).getObjectDelta().getOid();
    XMLGregorianCalendar endTs = TestUtil.currentTime();
    tailer.tail();
    displayAudit(tailer);
    assertAuditLoginLogout(tailer);
    assertAuditIds(tailer);
    assertAuditOperation(tailer, "ADD_OBJECT");
    tailer.assertAudit(4);
    assertEquals("Wrong OID", RESOURCE_OPENDJ_OID, oid);
    ResourceType resourceAfter = getObject(ResourceType.class, RESOURCE_OPENDJ_OID);
    display(resourceAfter);
    assertEquals("Wrong connector OID", connectorLdapOid, resourceAfter.getConnectorRef().getOid());
    assertCreateMetadata(resourceAfter, USER_ADMINISTRATOR_OID, startTs, endTs);
}
Also used : LogfileTestTailer(com.evolveum.midpoint.test.util.LogfileTestTailer) ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) ModelExecuteOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType) Test(org.testng.annotations.Test)

Example 10 with ModelExecuteOptionsType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType in project midpoint by Evolveum.

the class Main method deleteUser.

private static void deleteUser(ModelPortType modelPort, String oid) throws FaultMessage {
    ObjectDeltaType deltaType = new ObjectDeltaType();
    deltaType.setObjectType(ModelClientUtil.getTypeQName(UserType.class));
    deltaType.setChangeType(ChangeTypeType.DELETE);
    deltaType.setOid(oid);
    ObjectDeltaListType deltaListType = new ObjectDeltaListType();
    deltaListType.getDelta().add(deltaType);
    ModelExecuteOptionsType executeOptionsType = new ModelExecuteOptionsType();
    executeOptionsType.setRaw(true);
    modelPort.executeChanges(deltaListType, executeOptionsType);
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) ModelExecuteOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)

Aggregations

ModelExecuteOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType)18 ObjectDeltaListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)17 ObjectDeltaType (com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType)17 ObjectDeltaOperationListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType)10 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)8 ObjectDeltaOperationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType)6 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)6 Test (org.testng.annotations.Test)6 AbstractModelIntegrationTest (com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)4 PrismAsserts.assertEqualsPolyString (com.evolveum.midpoint.prism.util.PrismAsserts.assertEqualsPolyString)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)4 FaultMessage (com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage)4 File (java.io.File)4 QName (javax.xml.namespace.QName)4 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)3 Holder (javax.xml.ws.Holder)3 TaskType (com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType)2 ObjectAlreadyExistsFaultType (com.evolveum.midpoint.xml.ns._public.common.fault_3.ObjectAlreadyExistsFaultType)2 ModelPortType (com.evolveum.midpoint.xml.ns._public.model.model_3.ModelPortType)2 ItemDeltaType (com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType)2