java.lang.Object
org.odpi.openmetadata.governanceservers.enginehostservices.enginemap.GovernanceEngineMap

public class GovernanceEngineMap extends Object
GovernanceEngineMap provides a thread safe mapping of governance engine names to governance engine handlers. This class allows the governance engine handler to be added after the engine host has started processing requests. It is not possible to create the governance handler until the governance engine definition has been retrieved from the metadata access server. So, unless the engine definition is linked explicitly to an engine service, the type of the governance engine handler is unknown. Retrieval of a governance engine definition may be triggered by an event, or by a refresh sweep of the metadata. Therefore, it is possible that two threads are responding to the creation of a new governance engine definition. Hence, the synchronized methods
  • Constructor Details

    • GovernanceEngineMap

      public GovernanceEngineMap(String localServerName, String localServerUserId, AuditLog auditLog, int maxPageSize)
      Create a client-side object for calling a survey action engine.
      Parameters:
      localServerName - the name of the engine host server where the survey action engine is running
      localServerUserId - user id for the engine host server to use
      auditLog - logging destination
      maxPageSize - maximum number of results that can be returned in a single request
  • Method Details

    • getGovernanceEngineHandler

      public GovernanceEngineHandler getGovernanceEngineHandler(String governanceEngineName)
      Return the governance engine handler for a specific governance engine name if known. If the handler does not yet exist, an attempt is made to create it. If this fails, null is returned
      Parameters:
      governanceEngineName - engine to lookup
      Returns:
      handler or null
    • getGovernanceEngineHandler

      public GovernanceEngineHandler getGovernanceEngineHandler(EngineConfig governanceEngine)
      Return the governance engine handler for a specific governance engine name if known. If the handler does not yet exist, an attempt is made to create it. If this fails, null is returned
      Parameters:
      governanceEngine - engine to lookup
      Returns:
      handler or null
    • getGovernanceEngineHandlers

      public List<GovernanceEngineHandler> getGovernanceEngineHandlers()
      Return the list of active governance engine handlers.
      Returns:
      list of governance engine handlers or an empty list
    • getGovernanceEngineNames

      public List<String> getGovernanceEngineNames()
      Return the list of the configured engines.
      Returns:
      list of engine names
    • getGovernanceEngineNames

      public List<String> getGovernanceEngineNames(String serviceURLMarker)
      Return the list of the configured engines for a particular engine service.
      Parameters:
      serviceURLMarker - marker that determines which engine service is calling.
      Returns:
      list of engine names
    • setGovernanceEngineProperties

      public void setGovernanceEngineProperties(EngineConfig engineConfig, OpenMetadataEventClient eventClient, EngineConfigurationRefreshThread configurationRefreshThread) throws InvalidParameterException
      Set up a placeholder entry in the governance handler map for a governance engine.
      Parameters:
      engineConfig - description of the engine
      eventClient - client for receiving events
      configurationRefreshThread - thread for controlling the receipt of events.
      Throws:
      InvalidParameterException - Problem create the client
    • shutdown

      public void shutdown()
      Shutdown all engines ...