Class AccessServiceAdmin

java.lang.Object
org.odpi.openmetadata.adminservices.registration.AccessServiceAdmin
Direct Known Subclasses:
GAFOperationalServices, OCFOperationalServices, OMFOperationalServices

public abstract class AccessServiceAdmin extends Object
AccessServiceAdmin is the interface that an access service implements to receive its configuration. The java class that implements this interface is created with a default constructor and then the initialize method is called. It is configured in the AccessServiceDescription enumeration.
  • Constructor Details

    • AccessServiceAdmin

      public AccessServiceAdmin()
  • Method Details

    • initialize

      public abstract void initialize(AccessServiceConfig accessServiceConfig, OMRSTopicConnector enterpriseOMRSTopicConnector, OMRSRepositoryConnector enterpriseOMRSRepositoryConnector, AuditLog auditLog, String localServerName, String localServerUserId, String localServerSecretsStoreProvider, String localServerSecretsStoreLocation, String localServerSecretsStoreCollection, int maxPageSize) throws OMAGConfigurationErrorException
      Initialize the access service.
      Parameters:
      accessServiceConfig - specific configuration properties for this access service.
      enterpriseOMRSTopicConnector - connector for receiving OMRS Events from the cohorts
      enterpriseOMRSRepositoryConnector - connector for querying the cohort repositories
      auditLog - audit log component for logging messages.
      localServerName - name of this server
      localServerUserId - user id to use on OMRS calls where there is no end user.
      localServerSecretsStoreProvider - secrets store connector for bearer token
      localServerSecretsStoreLocation - secrets store location for bearer token
      localServerSecretsStoreCollection - secrets store collection for bearer token
      maxPageSize - max number of results to return on single request.
      Throws:
      OMAGConfigurationErrorException - invalid parameters in the configuration properties.
    • getFullServiceName

      public String getFullServiceName()
      Return the cached service name.
      Returns:
      string name
    • setFullServiceName

      public void setFullServiceName(String fullServiceName)
      Set up the cached service name.
      Parameters:
      fullServiceName - string name
    • shutdown

      public abstract void shutdown()
      Shutdown the access service.
    • registerWithEnterpriseTopic

      protected void registerWithEnterpriseTopic(String accessServiceFullName, String serverName, OMRSTopicConnector omrsTopicConnector, OMRSTopicListener omrsTopicListener, AuditLog auditLog) throws OMAGConfigurationErrorException
      Register a listener with the enterprise topic connector.
      Parameters:
      accessServiceFullName - name of calling access service
      serverName - name of OMAG Server instance
      omrsTopicConnector - topic connector to register with
      omrsTopicListener - listener to register
      auditLog - audit log to record messages
      Throws:
      OMAGConfigurationErrorException - problem with topic connection
    • getTopicName

      protected String getTopicName(Connection connection)
      Return the name of the topic extracted from the endpoint of the topic's Connection.
      Parameters:
      connection - connection object
      Returns:
      topic name
    • getOutTopicEventBusConnector

      protected OpenMetadataTopicConnector getOutTopicEventBusConnector(Connection outTopicEventBusConnection, String accessServiceName, AuditLog parentAuditLog) throws OMAGConfigurationErrorException
      Create the event bus connector for this access services' Out Topic.
      Parameters:
      outTopicEventBusConnection - connection from the configuration properties - the event bus
      accessServiceName - name of the calling access service
      parentAuditLog - audit log from the admin component
      Returns:
      connector to access the topic
      Throws:
      OMAGConfigurationErrorException - problem creating connector
    • getServerSideOutTopicConnection

      protected Connection getServerSideOutTopicConnection(Connection outTopicEventBusConnection, String accessServiceFullName, String accessServiceConnectorProviderClassName, AuditLog auditLog) throws OMAGConfigurationErrorException
      Create the connector for this access services' Out Topic.
      Parameters:
      outTopicEventBusConnection - connection from the configuration properties - the event bus
      accessServiceFullName - name of the calling access service
      accessServiceConnectorProviderClassName - class name of connector provider
      auditLog - audit log from the admin component
      Returns:
      connector to access the topic
      Throws:
      OMAGConfigurationErrorException - problem creating connector
    • throwUnexpectedInitializationException

      protected void throwUnexpectedInitializationException(String actionDescription, String fullAccessServiceName, Exception error) throws OMAGConfigurationErrorException
      Log that an unexpected exception was received during start up.
      Parameters:
      actionDescription - calling method
      fullAccessServiceName - name of the access service
      error - exception that was caught
      Throws:
      OMAGConfigurationErrorException - wrapped exception
    • getTopicConnector

      public <T> T getTopicConnector(Connection topicConnection, Class<T> topicConnectorClass, AuditLog auditLog, String accessServiceFullName, String methodName) throws OMAGConfigurationErrorException
      Create an instance of an open metadata topic connector using the supplied connection.
      Type Parameters:
      T - type name
      Parameters:
      topicConnection - connection needed to create the connector
      topicConnectorClass - class to cast to
      accessServiceFullName - name of the calling access service
      auditLog - audit log for this connector
      methodName - calling method
      Returns:
      connector to access the topic
      Throws:
      OMAGConfigurationErrorException - problem creating connector