Class ServerAuthorViewHandler

java.lang.Object
org.odpi.openmetadata.viewservices.serverauthor.handlers.ServerAuthorViewHandler

public class ServerAuthorViewHandler extends Object
The ServerAuthorViewHandler is initialised with the server the call should be sent to. The handler exposes methods for functionality for the Server Author view allowing servers to authored and deployed onto a platform. The handler implements server authoring capabilies, OMAG server configurations are accumulated on the platform that is identified in the Server author View configuration. While authoring servers, the caller is not aware of where the server configurations are being accumulated. In addition to server authoring capabilities, this handler allows the known platforms, as defined in the view configuration to be queried to see what servers are configured on them. The call can then deploy a server that has been configured onto a particular platform.
  • Constructor Details

    • ServerAuthorViewHandler

      public ServerAuthorViewHandler()
      Default constructor for ServerAuthorViewHandler
    • ServerAuthorViewHandler

      public ServerAuthorViewHandler(String localServerUserId, String metadataServerURL, List<ResourceEndpointConfig> resourceEndpoints)
      ServerAuthorViewHandler constructor with configured resourceEndpoints
      Parameters:
      localServerUserId - admin userid
      metadataServerURL - url of the platform to issue admin calls to store configuration
      resourceEndpoints - list of platforms
  • Method Details

    • getResourceEndpoints

      public Map<String,List<ResourceEndpoint>> getResourceEndpoints()
      getResourceEndpoints - returns a list of the configured resource endpoints. Does not include discovered resource endpoints.
      Returns:
      the map of resource endpoints
    • getKnownPlatforms

      public Set<Platform> getKnownPlatforms(String userId, String methodName, AuditLog auditLog) throws ServerAuthorViewServiceException
      Get the server configurations associated with the platforms that this view service knows about as well as the services it supports.
      Parameters:
      userId - userId under which the request is performed
      methodName - The name of the method being invoked
      auditLog - auditLog
      Returns:
      the known platforms, which if active will contain their associated omag server configurations
      Throws:
      ServerAuthorViewServiceException - the server author view has detected an error
    • setInMemLocalRepository

      public void setInMemLocalRepository(String className, String methodName, String serverToBeConfiguredName) throws ServerAuthorViewServiceException
      Set the local repository to be in memory for the named server
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server being configured
      Throws:
      ServerAuthorViewServiceException - server author exception
    • setGraphLocalRepository

      public void setGraphLocalRepository(String className, String methodName, String serverToBeConfiguredName, Map<String,Object> storageProperties) throws ServerAuthorViewServiceException
      Set the local repository to be graph for the named server
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server being configured
      storageProperties - storage properties
      Throws:
      ServerAuthorViewServiceException - server author exception
    • setReadOnlyLocalRepository

      public void setReadOnlyLocalRepository(String className, String methodName, String serverToBeConfiguredName) throws ServerAuthorViewServiceException
      Set the local repository to be read only for the named server
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server being configured
      Throws:
      ServerAuthorViewServiceException - server author exception
    • setPluginRepositoryConnection

      public void setPluginRepositoryConnection(String className, String methodName, String serverToBeConfiguredName, Connection connection) throws ServerAuthorViewServiceException
      Provide the connection to the local repository - used when the local repository mode is set to plugin repository.
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to be configured.
      connection - connection to the OMRS repository connector.
      Throws:
      ServerAuthorViewServiceException - a server author exception
    • getStoredConfiguration

      public OMAGServerConfig getStoredConfiguration(String className, String methodName, String serverToBeRetrievedName) throws ServerAuthorViewServiceException
      Get the stored configuration for the named server
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeRetrievedName - name of the server whose configuration is to be retrieved
      Returns:
      the omag server configuration
      Throws:
      ServerAuthorViewServiceException - server author exception
    • deployOMAGServerConfig

      public void deployOMAGServerConfig(String className, String methodName, String destinationPlatformName, String serverToBeDeployedName) throws ServerAuthorViewServiceException
      Deploy an OMAG Server configuration onto a target platform.
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      destinationPlatformName - platform onto which the server is to be deployed
      serverToBeDeployedName - name of the server to deploy
      Throws:
      ServerAuthorViewServiceException - server author exception
    • setOMAGServerConfig

      public void setOMAGServerConfig(String className, String methodName, String serverToBeConfiguredName, OMAGServerConfig omagServerConfig) throws ServerAuthorViewServiceException
      Set an OMAG Server's configuration
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to be configured
      omagServerConfig - the server configuration we are setting
      Throws:
      ServerAuthorViewServiceException - server author exception
    • configureAccessService

      public void configureAccessService(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker, Map<String,Object> accessServiceOptions) throws ServerAuthorViewServiceException
      Configure an access service
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      serviceURLMarker - identifier of the access service to configure
      accessServiceOptions - access service options
      Throws:
      ServerAuthorViewServiceException - server author exception
    • disableAccessService

      public void disableAccessService(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker) throws ServerAuthorViewServiceException
      Disable an access service
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      serviceURLMarker - identifier of the access service to configure
      Throws:
      ServerAuthorViewServiceException - server author exception
    • configureAllAccessServices

      public void configureAllAccessServices(String className, String methodName, String serverToBeConfiguredName, Map<String,Object> accessServiceOptions) throws ServerAuthorViewServiceException
      Configure all access services
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      accessServiceOptions - access service options to apply to all access services
      Throws:
      ServerAuthorViewServiceException - server author exception
    • configureViewService

      public void configureViewService(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker, Map<String,Object> viewServiceOptions) throws ServerAuthorViewServiceException
      Configure an view service
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      serviceURLMarker - identifier of the view service to configure
      viewServiceOptions - view service options
      Throws:
      ServerAuthorViewServiceException - server author exception
    • disableViewService

      public void disableViewService(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker) throws ServerAuthorViewServiceException
      Disable an view service
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      serviceURLMarker - identifier of the view service to configure
      Throws:
      ServerAuthorViewServiceException - server author exception
    • configureEngineService

      public void configureEngineService(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker, Map<String,Object> engineServiceOptions, List<EngineConfig> engines) throws ServerAuthorViewServiceException
      Configure an engine service
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      serviceURLMarker - identifier of the engine service to configure
      engineServiceOptions - engine service options
      engines - engines
      Throws:
      ServerAuthorViewServiceException - server author exception
    • disableEngineService

      public void disableEngineService(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker) throws ServerAuthorViewServiceException
      Disable an view service
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      serviceURLMarker - identifier of the view service to configure
      Throws:
      ServerAuthorViewServiceException - server author exception
    • setEnterpriseAccessConfig

      public void setEnterpriseAccessConfig(String className, String methodName, String serverToBeConfiguredName, EnterpriseAccessConfig enterpriseAccessConfig) throws ServerAuthorViewServiceException
      set the Enterprise Access config
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      enterpriseAccessConfig - enterprise access config
      Throws:
      ServerAuthorViewServiceException - server author exception
    • setEventBus

      public void setEventBus(String className, String methodName, String serverToBeConfiguredName, String connectorProvider, String topicURLRoot, Map<String,Object> configurationProperties) throws ServerAuthorViewServiceException
      set the Event bus
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      connectorProvider - connector provider name
      topicURLRoot - topic URL root
      configurationProperties - configuration properties
      Throws:
      ServerAuthorViewServiceException - server author exception
    • setDefaultAuditLog

      public void setDefaultAuditLog(String className, String methodName, String serverToBeConfiguredName) throws ServerAuthorViewServiceException
      set the default audit log
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      Throws:
      ServerAuthorViewServiceException - server author exception
    • addConsoleAuditLogDestination

      public void addConsoleAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities) throws ServerAuthorViewServiceException
      add a console audit log
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      supportedSeverities - a list of support severities
      Throws:
      ServerAuthorViewServiceException - server author exception
    • addSLF4JAuditLogDestination

      public void addSLF4JAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities) throws ServerAuthorViewServiceException
      add a SLF4J audit log
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      supportedSeverities - a list of support severities
      Throws:
      ServerAuthorViewServiceException - server author exception
    • addFileAuditLogDestination

      public void addFileAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities) throws ServerAuthorViewServiceException
      add a File audit log destination
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      supportedSeverities - a list of support severities
      Throws:
      ServerAuthorViewServiceException - server author exception
    • addEventTopicAuditLogDestination

      public void addEventTopicAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities) throws ServerAuthorViewServiceException
      add a Event Topic audit log destination
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      supportedSeverities - a list of support severities
      Throws:
      ServerAuthorViewServiceException - server author exception
    • addAuditLogDestination

      public void addAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, Connection connection) throws ServerAuthorViewServiceException
      add an audit log destination specified by a connection
      Parameters:
      className - class Name for diagnostic purposes
      methodName - current operation
      serverToBeConfiguredName - name of the server to being configured
      connection - connection to use for the audit log destination
      Throws:
      ServerAuthorViewServiceException - server author exception
    • updateAuditLogDestination

      public void updateAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, String auditLogDestinationName, Connection auditLogDestination) throws ServerAuthorViewServiceException
      Update an audit log destination that is identified with the supplied destination name with the supplied connection object.
      Parameters:
      className - class name used for diagnostics
      methodName - the current operation
      serverToBeConfiguredName - name of the server to be configured.
      auditLogDestinationName - name of the audit log destination to be updated
      auditLogDestination - connection object that defines the audit log destination
      Throws:
      ServerAuthorViewServiceException - a server author exception
    • deleteAuditLogDestination

      public void deleteAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, String auditLogDestinationName) throws ServerAuthorViewServiceException
      Delete an audit log destination that is identified with the supplied destination name
      Parameters:
      className - class name used for diagnostics
      methodName - the current operation
      serverToBeConfiguredName - name of the server to be configured.
      auditLogDestinationName - name of the audit log destination to be deleted
      Throws:
      ServerAuthorViewServiceException - a server author exception
    • getActiveConfiguration

      public OMAGServerConfig getActiveConfiguration(String className, String methodName, String serverToRetrieveName) throws ServerAuthorViewServiceException
      Get the active configuration of the named server
      Parameters:
      className - class name used for diagnostics
      methodName - the current operation
      serverToRetrieveName - the server to retrieve name
      Returns:
      the activate configuration or
      Throws:
      ServerAuthorViewServiceException - a server author exception
    • activateWithStoredConfig

      public void activateWithStoredConfig(String className, String methodName, String destinationPlatformName, String serverToBeActivatedName)
      Activate the stored configuration for the named server on the named destination platform
      Parameters:
      className - class name for diagnostics
      methodName - action being performed
      destinationPlatformName - name of the platform name on which the configuration should be activated
      serverToBeActivatedName - server name of the configuration to activate
    • deactivateServerPermanently

      public void deactivateServerPermanently(String className, String methodName, String destinationPlatformName, String serverToBeDeactivatedName)
      Deactivate the stored configuration for the named server on the named destination platform permanently. The configuration associated with this server is deleted, so it cannot be activated again.

      To activate this server again on this platform, a new configuration must be created, which can then be activated.

      Parameters:
      className - class name for diagnostics
      methodName - action being performed
      destinationPlatformName - name of the platform name on which the configuration should be activated
      serverToBeDeactivatedName - server name of the configuration to deactivate
    • deactivateServerTemporarily

      public void deactivateServerTemporarily(String className, String methodName, String destinationPlatformName, String serverToBeDeactivatedName)
      Deactivate the stored configuration for the named server on the named destination platform temporarily. The configuration still exists after this operation, so it can be activated again
      Parameters:
      className - class name for diagnostics
      methodName - action being performed
      destinationPlatformName - name of the platform name on which the configuration should be activated
      serverToBeDeactivatedName - server name of the configuration to deactivate
    • getSupportedAuditLogSeverities

      public List<OMRSAuditLogReportSeverity> getSupportedAuditLogSeverities()
      Get the supported severities for the audit log
      Returns:
      the list of the supported severities for the audit log
    • clearAuditLogDestinations

      public void clearAuditLogDestinations(String serverToBeConfiguredName) throws ServerAuthorViewServiceException
      Clear the audit log destinations associated with the server being configured
      Parameters:
      serverToBeConfiguredName - name of the server to be configured.
      Throws:
      ServerAuthorViewServiceException - a server author exception
    • addCohortRegistration

      public void addCohortRegistration(String serverToBeConfiguredName, String cohortName) throws ServerAuthorViewServiceException
      Enable registration of server to an open metadata repository cohort using the default topic structure (DEDICATED_TOPICS). A cohort is a group of open metadata repositories that are sharing metadata. An OMAG server can connect to zero, one or more cohorts. Each cohort needs a unique name. The members of the cohort use a shared topic to exchange registration information and events related to changes in their supported metadata types and instances. They are also able to query each other's metadata directly through REST calls.
      Parameters:
      serverToBeConfiguredName - server being configured
      cohortName - name of the cohort.
      Throws:
      ServerAuthorViewServiceException - error occurred during the registration of the cohort
    • removeCohortRegistration

      public void removeCohortRegistration(String serverToBeConfiguredName, String cohortName) throws ServerAuthorViewServiceException
      Unregister this server from an open metadata repository cohort.
      Parameters:
      serverToBeConfiguredName - server being configured
      cohortName - name of the cohort.
      Throws:
      ServerAuthorViewServiceException - error occurred during the unregistration of the cohort