use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType 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.common_3.ObjectDeltaOperationType in project midpoint by Evolveum.
the class SchemaDebugUtil method prettyPrint.
public static String prettyPrint(ObjectDeltaOperationType deltaOpType) {
if (deltaOpType == null) {
return "null";
}
StringBuilder sb = new StringBuilder("ObjectDeltaOperationType(");
sb.append(prettyPrint(deltaOpType.getObjectDelta()));
sb.append(": ");
OperationResultType result = deltaOpType.getExecutionResult();
if (result == null) {
sb.append("null result");
} else {
sb.append(result.getStatus());
}
// object, resource?
sb.append(")");
return sb.toString();
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType in project midpoint by Evolveum.
the class DeltaConvertor method toObjectDeltaOperationType.
/**
* Object delta operation: native -> XML.
*/
public static ObjectDeltaOperationType toObjectDeltaOperationType(ObjectDeltaOperation<?> odo, DeltaConversionOptions options) throws SchemaException {
ObjectDeltaOperationType odoBean = new ObjectDeltaOperationType();
toObjectDeltaOperationType(odo, odoBean, options);
return odoBean;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType in project midpoint by Evolveum.
the class SqlAuditServiceImpl method insertAuditDeltas.
private void insertAuditDeltas(JdbcSession jdbcSession, MAuditEventRecord auditRow, List<ObjectDeltaOperationType> deltas) {
// we want to keep only unique deltas, checksum is also part of PK
Map<String, MAuditDelta> deltasByChecksum = new HashMap<>();
for (ObjectDeltaOperationType delta : deltas) {
if (delta == null) {
continue;
}
MAuditDelta mAuditDelta = convertDelta(delta, auditRow);
deltasByChecksum.put(mAuditDelta.checksum, mAuditDelta);
}
if (!deltasByChecksum.isEmpty()) {
SQLInsertClause insertBatch = jdbcSession.newInsert(QAuditDeltaMapping.get().defaultAlias());
for (MAuditDelta value : deltasByChecksum.values()) {
// NULLs are important to keep the value count consistent during the batch
insertBatch.populate(value, DefaultMapper.WITH_NULL_BINDINGS).addBatch();
}
insertBatch.setBatchToBulk(true);
insertBatch.execute();
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType in project midpoint by Evolveum.
the class QAuditDeltaMapping method toSchemaObject.
public ObjectDeltaOperationType toSchemaObject(MAuditDelta row) {
ObjectDeltaOperationType odo = new ObjectDeltaOperationType();
SQLTemplates querydslTemplates = repositoryContext().getQuerydslTemplates();
boolean usingSqlServer = querydslTemplates instanceof SQLServerTemplates;
odo.setObjectDelta(parseBytes(row.delta, usingSqlServer, ObjectDeltaType.class));
odo.setExecutionResult(parseBytes(row.fullResult, usingSqlServer, OperationResultType.class));
if (row.objectNameOrig != null || row.objectNameNorm != null) {
odo.setObjectName(new PolyStringType(new PolyString(row.objectNameOrig, row.objectNameNorm)));
}
odo.setResourceOid(row.resourceOid);
if (row.resourceNameOrig != null || row.resourceNameNorm != null) {
odo.setResourceName(new PolyStringType(new PolyString(row.resourceNameOrig, row.resourceNameNorm)));
}
return odo;
}
Aggregations