Class ConnectorConfigurationFactory

java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.ConnectorConfigurationFactory

public class ConnectorConfigurationFactory extends Object
ConnectorConfigurationFactory sets up default configuration for the OMRS components. It is used by the OMAG and UI server while it manages the changes made to the server configuration by the server administrator. The aim is to build up the RepositoryServicesConfig object that is used to initialize the OMRSOperationalServices.
  • Constructor Details

    • ConnectorConfigurationFactory

      public ConnectorConfigurationFactory()
      Default constructor
  • Method Details

    • getServerConfigConnection

      public Connection getServerConfigConnection(String serverName)
      Returns the connection for the open metadata server configuration file.
      Parameters:
      serverName - name of the server
      Returns:
      Connection object
    • getServerConfigConnectionForRetrieveAll

      public Connection getServerConfigConnectionForRetrieveAll()
      Returns the connection for the open metadata server configuration retrieve all.
      Returns:
      Connection object
    • getDefaultAuditLogConnection

      public Connection getDefaultAuditLogConnection()
      Return the connection for the default audit log. By default, the Audit Log written to stdout.
      Returns:
      OCF Connection used to create the default audit logger
    • getConsoleAuditLogConnection

      public Connection getConsoleAuditLogConnection(String qualifier, List<String> supportedSeverities)
      Return the connection for the console audit log destination. This audit log destination writes to stdout.
      Parameters:
      qualifier - unique qualifier for the connection
      supportedSeverities - list of severities that should be logged to this destination (empty list means all)
      Returns:
      OCF Connection used to create the stdout console audit logger
    • getFileBasedAuditLogConnection

      public Connection getFileBasedAuditLogConnection(String localServerName, String directoryName, List<String> supportedSeverities)
      Return the connection for the file-based audit log. By default, the File-based Audit log is stored in a directory called localServerName.ffdc.
      Parameters:
      localServerName - name of the local server
      directoryName - name of directory
      supportedSeverities - list of severities that should be logged to this destination (empty list means all)
      Returns:
      OCF Connection used to create the file based audit logger
    • getSLF4JAuditLogConnection

      public Connection getSLF4JAuditLogConnection(String qualifier, List<String> supportedSeverities)
      Return the connection for the file-based audit log. By default, the File-based Audit log is stored in a directory called localServerName.ffdc.
      Parameters:
      qualifier - unique qualifier for the connection
      supportedSeverities - list of severities that should be logged to this destination (empty list means all)
      Returns:
      OCF Connection used to create the file based audit logger
    • getEventTopicAuditLogConnection

      public Connection getEventTopicAuditLogConnection(String localServerName, List<String> supportedSeverities, String eventBusConnectorProviderClassName, String topicURLRoot, String suppliedTopicName, String serverId, Map<String,Object> eventBusConfigurationProperties)
      Return the connection for the event topic audit log. By default, the topic name is called openmetadata.repositoryservices.{localServerName}.ffdc.
      Parameters:
      localServerName - name of the local server
      supportedSeverities - list of severities that should be logged to this destination (empty list means all)
      eventBusConnectorProviderClassName - name of connector provider class that controls the type of connector used.
      topicURLRoot - root URL of the topic - this is prepended to the topic name
      suppliedTopicName - topicName from the caller
      serverId - identifier of the server - used to pick up the right offset for the inbound messages.
      eventBusConfigurationProperties - - additional properties for the event bus connection
      Returns:
      OCF Connection used to create the event topic audit logger
    • getOpenMetadataArchiveFileConnection

      public Connection getOpenMetadataArchiveFileConnection(String fileName)
      Return the connection for an open metadata archive file.
      Parameters:
      fileName - name of the archive file
      Returns:
      OCF Connection used to create the file-based open metadata archive
    • getDefaultCohortRegistryConnection

      public Connection getDefaultCohortRegistryConnection(String localServerName, String cohortName)
      Return the connection to the default registry store called localServerName.cohortName.registrystore.
      Parameters:
      localServerName - name of the local server
      cohortName - name of the cohort
      Returns:
      Connection object
    • getDefaultLocalRepositoryLocalConnection

      public Connection getDefaultLocalRepositoryLocalConnection()
      Return the default local repository's local connection. This is set to null which means use the remote connection.
      Returns:
      null Connection object
    • getDefaultLocalRepositoryRemoteConnection

      public Connection getDefaultLocalRepositoryRemoteConnection(String localServerName, String localServerURL)
      Return the Connection for this server's OMRS Repository REST API. If the localServerURL is something like https://localhost:9443/west-domain then the REST API URL would be https://localhost:9443/west-domain/servers/{localServerName}/open-metadata/repository-services/...
      Parameters:
      localServerName - name of the local server
      localServerURL - root of the local server's URL
      Returns:
      Connection object
    • getLocalGraphRepositoryLocalConnection

      public Connection getLocalGraphRepositoryLocalConnection(Map<String,Object> storageProperties)
      Return the local graph repository's connection. This is using the GraphOMRSRepositoryConnector. Note there is no endpoint defined. This needs to be added when the graph repository connector is implemented.
      Parameters:
      storageProperties - properties used to configure Egeria Graph DB
      Returns:
      Connection object
    • getXTDBInMemLocalRepositoryLocalConnection

      public Connection getXTDBInMemLocalRepositoryLocalConnection()
      Return the local XTDB repository's connection for an in memory repository. This is using the XTDBOMRSRepositoryConnector. Note there is no endpoint defined.
      Returns:
      Connection object
    • getXTDBKVLocalRepositoryLocalConnection

      public Connection getXTDBKVLocalRepositoryLocalConnection(String serverName)
      Return the local XTDB repository's connection. This is using the XTDBOMRSRepositoryConnector. Note there is no endpoint defined.
      "configurationProperties": { "xtdbConfig": { "xtdb.lucene/lucene-store": { "db-dir": "data/servers/" + serverName + "/xtdb/lucene" }, "xtdb/index-store": { "kv-store": { "xtdb/module": "xtdb.rocksdb/->kv-store", "db-dir" : "data/servers/" + serverName + "/xtdb/rdb-index" } }, "xtdb/document-store": { "kv-store": { "xtdb/module" : "xtdb.rocksdb/->kv-store", "db-dir" : "data/servers/" + serverName + "/xtdb/rdb-docs" } }, "xtdb/tx-log": { "kv-store": { "xtdb/module" : "xtdb.rocksdb/->kv-store", "db-dir" : "data/servers/" + serverName + "/xtdb/rdb-tx" } } } }
      Parameters:
      serverName - associated server name
      Returns:
      Connection object
    • getXTDBLocalRepositoryLocalConnection

      public Connection getXTDBLocalRepositoryLocalConnection(Map<String,Object> storageProperties)
      Return the local XTDB repository's connection. This is using the XTDBOMRSRepositoryConnector. Note there is no endpoint defined.
      Parameters:
      storageProperties - properties used to configure Egeria XTDB DB
      Returns:
      Connection object
    • getInMemoryLocalRepositoryLocalConnection

      public Connection getInMemoryLocalRepositoryLocalConnection()
      Return the in-memory local repository connection. This is using the InMemoryOMRSRepositoryConnector.
      Returns:
      Connection object
    • getReadOnlyLocalRepositoryLocalConnection

      public Connection getReadOnlyLocalRepositoryLocalConnection()
      Return the read only local repository connection. This is using the ReadOnlyOMRSRepositoryConnector.
      Returns:
      Connection object
    • getRepositoryConnection

      public Connection getRepositoryConnection(String connectorProviderClassName, String url, Map<String,Object> configurationProperties) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
      Returns the connection for an arbitrary repository proxy.
      Parameters:
      connectorProviderClassName - class name of the connector provider
      url - location of the repository proxy
      configurationProperties - name value pairs for the connection
      Returns:
      Connection object
      Throws:
      ClassNotFoundException - when the provided class cannot be found
      InstantiationException - when the provided class cannot be instantiated
      IllegalAccessException - when there is insufficient access to instantiate the provided class
      NoSuchMethodException - the default constructor of the connector provider is not implemented
      InvocationTargetException - the default constructor of the connector provider can not be called
    • getDefaultEventMapperConnection

      public Connection getDefaultEventMapperConnection()
      Return the default local repository event mapper. This is null since the use of, or need for, the event mapper is determined by the type of local repository.
      Returns:
      null Connection object
    • getDefaultEventBusConnection

      public Connection getDefaultEventBusConnection(String connectorProviderClassName, String topicURLRoot, String topicName, String serverId, String eventDirection, Map<String,Object> configurationProperties)
      Return the event bus connection substituting default values where they are missing from the event bus configuration.
      Parameters:
      connectorProviderClassName - name of connector provider class that controls the type of connector used.
      topicURLRoot - root URL of the topic - this is prepended to the topic name
      topicName - name of the topic - if null it means that the connection should be null
      serverId - identifier of the server - used to pick up the right offset for the inbound messages.
      eventDirection - should the event bus be restricted in the direction that events can flow?
      configurationProperties - additional configuration properties for the connection
      Returns:
      Connection object
    • getDefaultEnterpriseOMRSTopicConnection

      public Connection getDefaultEnterpriseOMRSTopicConnection(String localServerName, String serverId)
      Return the default connection for the enterprise OMRS topic. This uses an in-memory event bus connector
      Parameters:
      localServerName - name of local server
      serverId - identifier of the server - used to pick up the right offset for the inbound messages.
      Returns:
      Connection object
    • getDefaultRemoteEnterpriseOMRSTopicConnection

      public Connection getDefaultRemoteEnterpriseOMRSTopicConnection(String localServerName, Map<String,Object> configurationProperties, String eventBusConnectorProvider, String topicURLRoot, String serverId, Map<String,Object> eventBusConfigurationProperties)
      Return the default connection for the enterprise OMRS topic. This uses an in-memory event bus connector
      Parameters:
      localServerName - name of local server
      configurationProperties - name value property pairs for the topic connection
      eventBusConnectorProvider - class name of the event bus connector's provider
      topicURLRoot - root name for the topic URL
      serverId - identifier of the server - used to pick up the right offset for the inbound messages.
      eventBusConfigurationProperties - name value property pairs for the event bus connection
      Returns:
      Connection object
    • getDefaultSingleCohortOMRSTopicConnection

      public Connection getDefaultSingleCohortOMRSTopicConnection(String cohortName, Map<String,Object> configurationProperties, String eventBusConnectorProvider, String topicURLRoot, String serverId, Map<String,Object> eventBusConfigurationProperties)
      Return the connection for the single OMRS topic for the named cohort.
      Parameters:
      cohortName - name of the cohort
      configurationProperties - name value property pairs for the topic connection
      eventBusConnectorProvider - class name of the event bus connector's provider
      topicURLRoot - root name for the topic URL
      serverId - identifier of the server - used to pick up the right offset for the inbound messages.
      eventBusConfigurationProperties - name value property pairs for the event bus connection
      Returns:
      Connection object
    • getDefaultRegistrationCohortOMRSTopicConnection

      public Connection getDefaultRegistrationCohortOMRSTopicConnection(String cohortName, Map<String,Object> configurationProperties, String eventBusConnectorProvider, String topicURLRoot, Map<String,Object> eventBusConfigurationProperties)
      Return the connection for the registration OMRS topic for the named cohort.
      Parameters:
      cohortName - name of the cohort
      configurationProperties - name value property pairs for the topic connection
      eventBusConnectorProvider - class name of the event bus connector's provider
      topicURLRoot - root name for the topic URL
      eventBusConfigurationProperties - name value property pairs for the event bus connection
      Returns:
      Connection object
    • getDefaultTypesCohortOMRSTopicConnection

      public Connection getDefaultTypesCohortOMRSTopicConnection(String cohortName, Map<String,Object> configurationProperties, String eventBusConnectorProvider, String topicURLRoot, Map<String,Object> eventBusConfigurationProperties)
      Return the connection for the registration OMRS topic for the named cohort.
      Parameters:
      cohortName - name of the cohort
      configurationProperties - name value property pairs for the topic connection
      eventBusConnectorProvider - class name of the event bus connector's provider
      topicURLRoot - root name for the topic URL
      eventBusConfigurationProperties - name value property pairs for the event bus connection
      Returns:
      Connection object
    • getDefaultInstancesCohortOMRSTopicConnection

      public Connection getDefaultInstancesCohortOMRSTopicConnection(String cohortName, Map<String,Object> configurationProperties, String eventBusConnectorProvider, String topicURLRoot, String serverId, Map<String,Object> eventBusConfigurationProperties)
      Return the connection for the single OMRS topic for the named cohort.
      Parameters:
      cohortName - name of the cohort
      configurationProperties - name value property pairs for the topic connection
      eventBusConnectorProvider - class name of the event bus connector's provider
      topicURLRoot - root name for the topic URL
      serverId - identifier of the server - used to pick up the right offset for the inbound messages.
      eventBusConfigurationProperties - name value property pairs for the event bus connection
      Returns:
      Connection object
    • getDefaultCohortOMRSTopicConnection

      public Connection getDefaultCohortOMRSTopicConnection(String topicName, Map<String,Object> configurationProperties, String eventSourceName, String eventBusConnectorProvider, String topicURLRoot, String consumerGroupId, Map<String,Object> eventBusConfigurationProperties)
      Return the connection for the registration OMRS topic for the named cohort.
      Parameters:
      topicName - name of the topic in the cohort
      configurationProperties - name value property pairs for the topic connection
      eventSourceName - name of the event source
      eventBusConnectorProvider - class name of the event bus connector's provider
      topicURLRoot - root name for the topic URL
      consumerGroupId - identifier of the consumer group - used to pick up the right offset for the inbound messages.
      eventBusConfigurationProperties - name value property pairs for the event bus connection
      Returns:
      Connection object
    • getRepositoryEventMapperConnection

      public Connection getRepositoryEventMapperConnection(String connectorProviderClassName, Map<String,Object> configurationProperties, String eventSource) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
      Return a connection for a repository event mapper. Notice that this event mapper is not the open metadata virtual connector because this event mapper is interfacing with external technology.
      Parameters:
      connectorProviderClassName - java class name of the connector provider for the event mapper
      configurationProperties - additional properties for event mapper
      eventSource - name of the event source used by the event mapper
      Returns:
      Connection object
      Throws:
      ClassNotFoundException - when the provided class cannot be found
      InstantiationException - when the provided class cannot be instantiated
      IllegalAccessException - when there is insufficient access to instantiate the provided class
      NoSuchMethodException - the default constructor of the connector provider is not implemented
      InvocationTargetException - the default constructor of the connector provider can not be called