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;
}
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));
}
}
Aggregations