use of com.evolveum.midpoint.studio.action.transfer.ProcessObjectResult in project midpoint-studio by Evolveum.
the class CleanupFileTask method processObject.
@Override
public ProcessObjectResult processObject(MidPointObject object) throws Exception {
String newContent = cleanupObject(object);
MidPointObject newObject = MidPointObject.copy(object);
newObject.setContent(newContent);
return new ProcessObjectResult(null).object(newObject);
}
use of com.evolveum.midpoint.studio.action.transfer.ProcessObjectResult in project midpoint-studio by Evolveum.
the class DeleteTask method processObjectOid.
@Override
public ProcessObjectResult processObjectOid(ObjectTypes type, String oid) throws Exception {
DeleteOptions opts = new DeleteOptions().raw(raw);
client.delete(type.getClassDefinition(), oid, opts);
return new ProcessObjectResult(null);
}
use of com.evolveum.midpoint.studio.action.transfer.ProcessObjectResult in project midpoint-studio by Evolveum.
the class UploadRecomputeTask method processObject.
@Override
public ProcessObjectResult processObject(MidPointObject obj) throws Exception {
ProcessObjectResult por = super.processObject(obj);
if (obj.isExecutable()) {
return por;
}
OperationResult uploadResult = por.result();
if (uploadResult != null && !uploadResult.isSuccess()) {
printProblem("Skipping recomputation for " + obj.getName() + ", there was a problem with upload");
return por;
}
if (obj.getType() == null || !AssignmentHolderType.class.isAssignableFrom(obj.getType().getClassDefinition())) {
return por;
}
String requestString = buildExecuteScriptRequestBody(obj);
ExecuteScriptResponseType response = client.execute(requestString);
OperationResultType res = response.getResult();
OperationResult executionResult = OperationResult.createOperationResult(res);
return validateOperationResult("recompute", executionResult, obj.getName());
}
use of com.evolveum.midpoint.studio.action.transfer.ProcessObjectResult in project midpoint-studio by Evolveum.
the class UploadTestResourceTask method processObject.
@Override
public ProcessObjectResult processObject(MidPointObject obj) throws Exception {
ProcessObjectResult por = super.processObject(obj);
if (obj.isExecutable()) {
return por;
}
OperationResult uploadResult = por.result();
if (uploadResult != null && !uploadResult.isSuccess()) {
printProblem("Skipping test connection for " + obj.getName() + ", there was a problem with upload");
return por;
}
if (!ObjectTypes.RESOURCE.equals(obj.getType())) {
printProblem("Can't test connection for " + obj.getName() + ", because it's not resource, it's " + obj.getType().getClassDefinition().getName());
return por;
}
OperationResult testConnectionResult = client.testResource(obj.getOid());
return validateOperationResult(OPERATION_TEST_CONNECTION, testConnectionResult, obj.getName());
}
use of com.evolveum.midpoint.studio.action.transfer.ProcessObjectResult in project midpoint-studio by Evolveum.
the class UploadTestValidateResourceTask method processObject.
@Override
public ProcessObjectResult processObject(MidPointObject obj) throws Exception {
ProcessObjectResult por = super.processObject(obj);
OperationResult testConnectionResult = por.result();
String name = obj.getName();
if (testConnectionResult != null && !testConnectionResult.isSuccess()) {
printProblem("Skipping resource validation for " + name + ", there was a problem with upload/test");
return por;
}
if (!ObjectTypes.RESOURCE.equals(obj.getType())) {
printProblem("Can't validate resource for " + name + ", because it's " + obj.getType().getClassDefinition().getName());
return por;
}
GeneratorOptions genOptions = new GeneratorOptions();
BulkActionGenerator gen = new BulkActionGenerator(BulkActionGenerator.Action.VALIDATE);
String requestString = gen.generateFromSourceObject(obj, genOptions, getProject());
ExecuteScriptResponseType response = client.execute(requestString);
OperationResultType res = response.getResult();
OperationResult executionResult = OperationResult.createOperationResult(res);
return validateOperationResult("validate", executionResult, obj.getName());
}
Aggregations