use of org.identityconnectors.framework.common.exceptions.AlreadyExistsException in project midpoint by Evolveum.
the class DummyConnector method schema.
/**
* {@inheritDoc}
*/
public Schema schema() {
log.info("schema::begin");
if (!configuration.getSupportSchema()) {
log.info("schema::unsupported operation");
throw new UnsupportedOperationException();
}
SchemaBuilder builder = new SchemaBuilder(DummyConnector.class);
try {
builder.defineObjectClass(createAccountObjectClass(configuration.getSupportActivation()));
builder.defineObjectClass(createGroupObjectClass(configuration.getSupportActivation()));
builder.defineObjectClass(createPrivilegeObjectClass());
builder.defineObjectClass(createOrgObjectClass());
for (ObjectClassInfo auxObjectClass : createAuxiliaryObjectClasses()) {
builder.defineObjectClass(auxObjectClass);
}
} catch (SchemaViolationException e) {
throw new InvalidAttributeValueException(e.getMessage(), e);
} catch (ConflictException e) {
throw new AlreadyExistsException(e);
}
if (configuration.isSupportReturnDefaultAttributes()) {
builder.defineOperationOption(OperationOptionInfoBuilder.buildReturnDefaultAttributes(), SearchOp.class, SyncOp.class);
}
log.info("schema::end");
return builder.build();
}
Aggregations