use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class DeleteAction method executeAction.
@Override
protected void executeAction() throws Exception {
ModelPortType port = createModelPort();
ModelExecuteOptionsType options = new ModelExecuteOptionsType();
options.setForce(getParams().isForce());
options.setRaw(getParams().isRaw());
QName type = getParams().getType();
ObjectDeltaType delta = createDeleteDelta(getParams().getOid(), type);
ObjectDeltaListType deltas = createDeltaList(delta);
try {
ObjectDeltaOperationListType result = port.executeChanges(deltas, options);
List<ObjectDeltaOperationType> operations = result.getDeltaOperation();
ObjectDeltaOperationType operation = operations.get(0);
OperationResultType resultType = operation.getExecutionResult();
STD_OUT.info("Status: {}", resultType.getStatus());
} catch (FaultMessage ex) {
handleError("Couldn't delete object '" + type.getLocalPart() + "' with oid '" + getParams().getOid() + "'", ex);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage in project midpoint by Evolveum.
the class ExportAction method executeAction.
@Override
protected void executeAction() throws Exception {
ModelPortType port = createModelPort();
Writer writer = null;
try {
writer = createWriter();
writeHeader(writer);
if (StringUtils.isNotEmpty(getParams().getOid())) {
//get
executeGet(port, writer);
} else {
//search
executeSearch(port, writer);
}
writeFooter(writer);
writer.flush();
} catch (SAXException | JAXBException | IOException | FaultMessage ex) {
handleError("Couldn't export objects", ex);
} finally {
IOUtils.closeQuietly(writer);
}
}
Aggregations