use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method getObjectNoFetch.
protected <T extends ObjectType> T getObjectNoFetch(Class<T> clazz, String oid) throws SAXException, IOException, FaultMessage {
SelectorQualifiedGetOptionsType options = new SelectorQualifiedGetOptionsType();
SelectorQualifiedGetOptionType option = new SelectorQualifiedGetOptionType();
GetOperationOptionsType getOptions = new GetOperationOptionsType();
getOptions.setNoFetch(true);
option.setOptions(getOptions);
options.getOption().add(option);
return getObject(clazz, oid, options);
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method deleteObject.
protected void deleteObject(Class objectClass, String oid, boolean ignoreFailures, ModelExecuteOptionsType executeOptionsType) throws FaultMessage {
System.out.println("Deleting " + objectClass.getSimpleName() + " " + oid);
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(objectClass));
deltaType.setChangeType(ChangeTypeType.DELETE);
deltaType.setOid(oid);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
if (!ignoreFailures) {
modelPort.executeChanges(deltaListType, executeOptionsType);
} else {
try {
modelPort.executeChanges(deltaListType, executeOptionsType);
} catch (Exception e) {
System.err.println("Cannot remove " + oid + ": " + e.getMessage());
}
}
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createAddressBookPolicy.
protected String createAddressBookPolicy(String name, Collection<String> addressLists, String gal, String oab, String rooms) throws FaultMessage {
Document doc = ModelClientUtil.getDocumnent();
ShadowType shadow = new ShadowType();
shadow.setName(ModelClientUtil.createPolyStringType(name, doc));
shadow.setResourceRef(createObjectReferenceType(ResourceType.class, getResourceOid()));
shadow.setObjectClass(OC_ADDRESS_BOOK_POLICY);
shadow.setKind(ShadowKindType.GENERIC);
shadow.setIntent("address-book-policy");
ShadowAttributesType attributes = new ShadowAttributesType();
attributes.getAny().add(ModelClientUtil.createTextElement(new QName(NS_ICFS, "name"), name, doc));
for (String addressList : addressLists) {
attributes.getAny().add(ModelClientUtil.createTextElement(new QName(NS_RI, "AddressLists"), addressList, doc));
}
attributes.getAny().add(ModelClientUtil.createTextElement(new QName(NS_RI, "GlobalAddressList"), gal, doc));
attributes.getAny().add(ModelClientUtil.createTextElement(new QName(NS_RI, "OfflineAddressBook"), oab, doc));
attributes.getAny().add(ModelClientUtil.createTextElement(new QName(NS_RI, "RoomList"), rooms, doc));
shadow.setAttributes(attributes);
return createShadow(shadow);
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createUser.
protected String createUser(UserType userType) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(UserType.class));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(userType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, null);
String oid = ModelClientUtil.getOidFromDeltaOperationList(operationListType, deltaType);
return oid;
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method changeUserGivenName.
protected void changeUserGivenName(String oid, String newValue) throws FaultMessage {
Document doc = ModelClientUtil.getDocumnent();
ObjectDeltaType userDelta = new ObjectDeltaType();
userDelta.setOid(oid);
userDelta.setObjectType(ModelClientUtil.getTypeQName(UserType.class));
userDelta.setChangeType(ChangeTypeType.MODIFY);
ItemDeltaType itemDelta = new ItemDeltaType();
itemDelta.setModificationType(ModificationTypeType.REPLACE);
itemDelta.setPath(ModelClientUtil.createItemPathType("givenName"));
itemDelta.getValue().add(ModelClientUtil.createPolyStringType(newValue, doc));
userDelta.getItemDelta().add(itemDelta);
ObjectDeltaListType deltaList = new ObjectDeltaListType();
deltaList.getDelta().add(userDelta);
modelPort.executeChanges(deltaList, null);
}
Aggregations