use of com.evolveum.midpoint.studio.impl.MidPointClient in project midpoint-studio by Evolveum.
the class VerifyAction method processFiles.
private void processFiles(AnActionEvent evt, MidPointService mm, Environment env, List<VirtualFile> files) {
ObjectValidator validator = new ObjectValidator(MidPointUtils.DEFAULT_PRISM_CONTEXT);
validator.setAllWarnings();
MidPointClient client = new MidPointClient(evt.getProject(), env);
for (VirtualFile file : files) {
RunnableUtils.runReadAction(() -> {
try {
List<MidPointObject> objects = MidPointUtils.parseProjectFile(evt.getProject(), file, NOTIFICATION_KEY);
for (MidPointObject obj : objects) {
try {
PrismObject object = client.parseObject(obj.getContent());
ValidationResult validationResult = validator.validate(object);
for (ValidationItem validationItem : validationResult.getItems()) {
String msg = buildValidationItem(object, validationItem);
mm.printToConsole(env, VerifyAction.class, msg);
}
} catch (Exception ex) {
mm.printToConsole(env, VerifyAction.class, "Couldn't parse object '" + obj.getName() + "'(" + obj.getType() + ") from file '" + file.getPath() + "', reason: " + ex.getMessage());
}
}
} catch (Exception ex) {
mm.printToConsole(env, VerifyAction.class, "Couldn't parse objects from file '" + file.getPath() + "', reason: " + ex.getMessage());
}
});
}
}
use of com.evolveum.midpoint.studio.impl.MidPointClient in project midpoint-studio by Evolveum.
the class ClientBackgroundableTask method setupMidpointClient.
private MidPointClient setupMidpointClient() {
LOG.debug("Setting up MidPoint client");
Environment env = getEnvironment();
midPointService.printToConsole(env, getClass(), "Setting up midPoint client");
MidPointClient client = new MidPointClient(getProject(), env);
LOG.debug("MidPoint client setup done");
return client;
}
Aggregations