Search in sources :

Example 11 with AlreadyExistsException

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();
}
Also used : AlreadyExistsException(org.identityconnectors.framework.common.exceptions.AlreadyExistsException) ObjectAlreadyExistsException(com.evolveum.icf.dummy.resource.ObjectAlreadyExistsException) ConflictException(com.evolveum.icf.dummy.resource.ConflictException) SchemaViolationException(com.evolveum.icf.dummy.resource.SchemaViolationException) InvalidAttributeValueException(org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException)

Aggregations

AlreadyExistsException (org.identityconnectors.framework.common.exceptions.AlreadyExistsException)11 GuardedString (org.identityconnectors.common.security.GuardedString)10 ConflictException (com.evolveum.icf.dummy.resource.ConflictException)9 ObjectAlreadyExistsException (com.evolveum.icf.dummy.resource.ObjectAlreadyExistsException)9 FileNotFoundException (java.io.FileNotFoundException)9 ConnectException (java.net.ConnectException)9 ConnectionFailedException (org.identityconnectors.framework.common.exceptions.ConnectionFailedException)9 ConnectorIOException (org.identityconnectors.framework.common.exceptions.ConnectorIOException)9 SchemaViolationException (com.evolveum.icf.dummy.resource.SchemaViolationException)8 InvalidAttributeValueException (org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException)8 DummyAccount (com.evolveum.icf.dummy.resource.DummyAccount)6 DummyGroup (com.evolveum.icf.dummy.resource.DummyGroup)6 DummyOrg (com.evolveum.icf.dummy.resource.DummyOrg)6 DummyPrivilege (com.evolveum.icf.dummy.resource.DummyPrivilege)6 ConnectorException (org.identityconnectors.framework.common.exceptions.ConnectorException)6 UnknownUidException (org.identityconnectors.framework.common.exceptions.UnknownUidException)5 DummyObject (com.evolveum.icf.dummy.resource.DummyObject)4 ArrayList (java.util.ArrayList)3 DummyObjectClass (com.evolveum.icf.dummy.resource.DummyObjectClass)2 ObjectDoesNotExistException (com.evolveum.icf.dummy.resource.ObjectDoesNotExistException)2