Search in sources :

Example 1 with SchemaCapabilityType

use of com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.SchemaCapabilityType in project midpoint by Evolveum.

the class ConnectorInstanceConnIdImpl method processOperationCapabilities.

private boolean processOperationCapabilities(OperationResult parentResult) {
    capabilities = new ArrayList<>();
    // Create capabilities from supported connector operations
    InternalMonitor.recordConnectorOperation("getSupportedOperations");
    Set<Class<? extends APIOperation>> supportedOperations = connIdConnectorFacade.getSupportedOperations();
    LOGGER.trace("Connector supported operations: {}", supportedOperations);
    boolean supportsSchema = false;
    if (supportedOperations.contains(SchemaApiOp.class)) {
        SchemaCapabilityType capSchema = new SchemaCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createSchema(capSchema));
        supportsSchema = true;
    }
    if (supportedOperations.contains(SyncApiOp.class)) {
        LiveSyncCapabilityType capSync = new LiveSyncCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createLiveSync(capSync));
    }
    if (supportedOperations.contains(TestApiOp.class)) {
        TestConnectionCapabilityType capTest = new TestConnectionCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createTestConnection(capTest));
    }
    if (supportedOperations.contains(CreateApiOp.class)) {
        CreateCapabilityType capCreate = new CreateCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createCreate(capCreate));
    }
    if (supportedOperations.contains(GetApiOp.class) || supportedOperations.contains(SearchApiOp.class)) {
        ReadCapabilityType capRead = new ReadCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createRead(capRead));
    }
    if (supportedOperations.contains(UpdateApiOp.class)) {
        UpdateCapabilityType capUpdate = new UpdateCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createUpdate(capUpdate));
    }
    if (supportedOperations.contains(DeleteApiOp.class)) {
        DeleteCapabilityType capDelete = new DeleteCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createDelete(capDelete));
    }
    if (supportedOperations.contains(ScriptOnResourceApiOp.class) || supportedOperations.contains(ScriptOnConnectorApiOp.class)) {
        ScriptCapabilityType capScript = new ScriptCapabilityType();
        if (supportedOperations.contains(ScriptOnResourceApiOp.class)) {
            Host host = new Host();
            host.setType(ProvisioningScriptHostType.RESOURCE);
            capScript.getHost().add(host);
        // language is unknown here
        }
        if (supportedOperations.contains(ScriptOnConnectorApiOp.class)) {
            Host host = new Host();
            host.setType(ProvisioningScriptHostType.CONNECTOR);
            capScript.getHost().add(host);
        // language is unknown here
        }
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createScript(capScript));
    }
    return supportsSchema;
}
Also used : UpdateCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.UpdateCapabilityType) ReadCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ReadCapabilityType) DeleteCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.DeleteCapabilityType) GetApiOp(org.identityconnectors.framework.api.operations.GetApiOp) SchemaCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.SchemaCapabilityType) ScriptOnConnectorApiOp(org.identityconnectors.framework.api.operations.ScriptOnConnectorApiOp) TestConnectionCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.TestConnectionCapabilityType) ScriptOnResourceApiOp(org.identityconnectors.framework.api.operations.ScriptOnResourceApiOp) Host(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType.Host) CreateCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CreateCapabilityType) SearchApiOp(org.identityconnectors.framework.api.operations.SearchApiOp) ScriptCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType) LiveSyncCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.LiveSyncCapabilityType) ObjectClass(org.identityconnectors.framework.common.objects.ObjectClass) APIOperation(org.identityconnectors.framework.api.operations.APIOperation)

Example 2 with SchemaCapabilityType

use of com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.SchemaCapabilityType in project midpoint by Evolveum.

the class ConnIdCapabilitiesAndSchemaParser method processOperationCapabilities.

/**
 * Create capabilities from supported connector operations
 */
private void processOperationCapabilities() {
    if (connIdSupportedOperations.contains(SchemaApiOp.class)) {
        SchemaCapabilityType capSchema = new SchemaCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createSchema(capSchema));
        supportsSchema = true;
    } else {
        supportsSchema = false;
    }
    if (connIdSupportedOperations.contains(SyncApiOp.class)) {
        LiveSyncCapabilityType capSync = new LiveSyncCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createLiveSync(capSync));
    }
    if (connIdSupportedOperations.contains(TestApiOp.class)) {
        TestConnectionCapabilityType capTest = new TestConnectionCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createTestConnection(capTest));
    }
    if (connIdSupportedOperations.contains(CreateApiOp.class)) {
        CreateCapabilityType capCreate = new CreateCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createCreate(capCreate));
    }
    if (connIdSupportedOperations.contains(UpdateDeltaApiOp.class)) {
        UpdateCapabilityType capUpdate = new UpdateCapabilityType();
        capUpdate.setDelta(true);
        // This is the default for all resources.
        // (Currently there is no way how to obtain it from the connector.)
        // It can be disabled manually.
        capUpdate.setAddRemoveAttributeValues(true);
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createUpdate(capUpdate));
    } else if (connIdSupportedOperations.contains(UpdateApiOp.class)) {
        UpdateCapabilityType capUpdate = new UpdateCapabilityType();
        // This is the default for all resources.
        // (Currently there is no way how to obtain it from the connector.)
        // It can be disabled manually.
        capUpdate.setAddRemoveAttributeValues(true);
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createUpdate(capUpdate));
    }
    if (connIdSupportedOperations.contains(DeleteApiOp.class)) {
        DeleteCapabilityType capDelete = new DeleteCapabilityType();
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createDelete(capDelete));
    }
    if (connIdSupportedOperations.contains(ScriptOnResourceApiOp.class) || connIdSupportedOperations.contains(ScriptOnConnectorApiOp.class)) {
        ScriptCapabilityType capScript = new ScriptCapabilityType();
        if (connIdSupportedOperations.contains(ScriptOnResourceApiOp.class)) {
            Host host = new Host();
            host.setType(ProvisioningScriptHostType.RESOURCE);
            capScript.getHost().add(host);
        // language is unknown here
        }
        if (connIdSupportedOperations.contains(ScriptOnConnectorApiOp.class)) {
            Host host = new Host();
            host.setType(ProvisioningScriptHostType.CONNECTOR);
            capScript.getHost().add(host);
        // language is unknown here
        }
        capabilities.add(CAPABILITY_OBJECT_FACTORY.createScript(capScript));
    }
}
Also used : UpdateApiOp(org.identityconnectors.framework.api.operations.UpdateApiOp) UpdateCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.UpdateCapabilityType) ScriptCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType) DeleteCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.DeleteCapabilityType) LiveSyncCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.LiveSyncCapabilityType) SchemaCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.SchemaCapabilityType) ScriptOnConnectorApiOp(org.identityconnectors.framework.api.operations.ScriptOnConnectorApiOp) TestConnectionCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.TestConnectionCapabilityType) ScriptOnResourceApiOp(org.identityconnectors.framework.api.operations.ScriptOnResourceApiOp) Host(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType.Host) CreateCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CreateCapabilityType)

Aggregations

CreateCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CreateCapabilityType)2 DeleteCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.DeleteCapabilityType)2 LiveSyncCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.LiveSyncCapabilityType)2 SchemaCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.SchemaCapabilityType)2 ScriptCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType)2 Host (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType.Host)2 TestConnectionCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.TestConnectionCapabilityType)2 UpdateCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.UpdateCapabilityType)2 ScriptOnConnectorApiOp (org.identityconnectors.framework.api.operations.ScriptOnConnectorApiOp)2 ScriptOnResourceApiOp (org.identityconnectors.framework.api.operations.ScriptOnResourceApiOp)2 ReadCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ReadCapabilityType)1 APIOperation (org.identityconnectors.framework.api.operations.APIOperation)1 GetApiOp (org.identityconnectors.framework.api.operations.GetApiOp)1 SearchApiOp (org.identityconnectors.framework.api.operations.SearchApiOp)1 UpdateApiOp (org.identityconnectors.framework.api.operations.UpdateApiOp)1 ObjectClass (org.identityconnectors.framework.common.objects.ObjectClass)1