use of com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType in project midpoint by Evolveum.
the class Main method deleteTask.
private static void deleteTask(ModelPortType modelPort, 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);
}
use of com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType in project midpoint by Evolveum.
the class Main method reconcileUser.
private static void reconcileUser(ModelPortType modelPort, String oid) throws FaultMessage {
Document doc = ModelClientUtil.getDocumnent();
ObjectDeltaType userDelta = new ObjectDeltaType();
userDelta.setOid(oid);
userDelta.setObjectType(ModelClientUtil.getTypeQName(UserType.class));
userDelta.setChangeType(ChangeTypeType.MODIFY);
ObjectDeltaListType deltaList = new ObjectDeltaListType();
deltaList.getDelta().add(userDelta);
ModelExecuteOptionsType optionsType = new ModelExecuteOptionsType();
optionsType.setReconcile(true);
modelPort.executeChanges(deltaList, optionsType);
}
use of com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType in project midpoint by Evolveum.
the class Main method changeUserGivenName.
private static void changeUserGivenName(ModelPortType modelPort, 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);
}
use of com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType in project midpoint by Evolveum.
the class Main method modifyRoleReplaceInducement.
// removes inducement with a given ID and replaces it with a new one
private static void modifyRoleReplaceInducement(ModelPortType modelPort, String roleOid, int oldId, String newInducementOid) throws FaultMessage, IOException, SAXException {
ItemDeltaType inducementDeleteDelta = new ItemDeltaType();
inducementDeleteDelta.setModificationType(ModificationTypeType.DELETE);
inducementDeleteDelta.setPath(ModelClientUtil.createItemPathType("inducement"));
inducementDeleteDelta.getValue().add(ModelClientUtil.parseElement("<value><id>" + oldId + "</id></value>"));
ItemDeltaType inducementAddDelta = new ItemDeltaType();
inducementAddDelta.setModificationType(ModificationTypeType.ADD);
inducementAddDelta.setPath(ModelClientUtil.createItemPathType("inducement"));
inducementAddDelta.getValue().add(ModelClientUtil.createRoleAssignment(newInducementOid));
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(RoleType.class));
deltaType.setChangeType(ChangeTypeType.MODIFY);
deltaType.setOid(roleOid);
deltaType.getItemDelta().add(inducementDeleteDelta);
deltaType.getItemDelta().add(inducementAddDelta);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType objectDeltaOperationList = modelPort.executeChanges(deltaListType, null);
for (ObjectDeltaOperationType objectDeltaOperation : objectDeltaOperationList.getDeltaOperation()) {
if (!OperationResultStatusType.SUCCESS.equals(objectDeltaOperation.getExecutionResult().getStatus())) {
System.out.println("*** Operation result = " + objectDeltaOperation.getExecutionResult().getStatus() + ": " + objectDeltaOperation.getExecutionResult().getMessage());
}
}
}
use of com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method changeUserPassword.
protected void changeUserPassword(String oid, String newPassword) throws FaultMessage {
ItemDeltaType passwordDelta = new ItemDeltaType();
passwordDelta.setModificationType(ModificationTypeType.REPLACE);
passwordDelta.setPath(ModelClientUtil.createItemPathType("credentials/password/value"));
passwordDelta.getValue().add(ModelClientUtil.createProtectedString(newPassword));
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(UserType.class));
deltaType.setChangeType(ChangeTypeType.MODIFY);
deltaType.setOid(oid);
deltaType.getItemDelta().add(passwordDelta);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
modelPort.executeChanges(deltaListType, null);
}
Aggregations