use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createObject.
protected String createObject(Class clazz, ObjectType objectType, ModelExecuteOptionsType options, boolean assertSuccess) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(clazz));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(objectType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, options);
lastOdo = assertExecuteChangesSuccess(operationListType, null, assertSuccess);
// }
return ModelClientUtil.getOidFromDeltaOperationList(operationListType, deltaType);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createOrg.
protected String createOrg(OrgType orgType) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(OrgType.class));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(orgType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, null);
return ModelClientUtil.getOidFromDeltaOperationList(operationListType, deltaType);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class TestSanityLegacy method getOdoFromDeltaOperationList.
// ugly hack...
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 (" + originalDelta.getChangeType() + ")found. We have: " + operationListType);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractWebserviceTest method checkAuditEnabled.
private void checkAuditEnabled(SystemConfigurationType configurationType) throws FaultMessage {
LoggingConfigurationType loggingConfig = configurationType.getLogging();
AuditingConfigurationType auditConfig = loggingConfig.getAuditing();
if (auditConfig == null) {
auditConfig = new AuditingConfigurationType();
auditConfig.setEnabled(true);
loggingConfig.setAuditing(auditConfig);
} else {
if (BooleanUtils.isTrue(auditConfig.isEnabled())) {
return;
}
auditConfig.setEnabled(true);
}
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(SystemConfigurationType.class, SystemObjectsType.SYSTEM_CONFIGURATION.value(), "logging", ModificationTypeType.REPLACE, loggingConfig);
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
assertSuccess(deltaOpList);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractWebserviceTest method addObject.
protected <O extends ObjectType> String addObject(O object) throws FaultMessage {
ObjectDeltaListType deltaList = new ObjectDeltaListType();
ObjectDeltaType delta = new ObjectDeltaType();
delta.setObjectType(getTypeQName(object.getClass()));
delta.setChangeType(ChangeTypeType.ADD);
delta.setObjectToAdd(object);
deltaList.getDelta().add(delta);
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
assertSuccess(deltaOpList);
return deltaOpList.getDeltaOperation().get(0).getObjectDelta().getOid();
}
Aggregations