Class ServerAuthorViewHandler
java.lang.Object
org.odpi.openmetadata.viewservices.serverauthor.handlers.ServerAuthorViewHandler
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 Summary
ConstructorsConstructorDescriptionDefault constructor for ServerAuthorViewHandlerServerAuthorViewHandler
(String localServerUserId, String metadataServerURL, List<ResourceEndpointConfig> resourceEndpoints) ServerAuthorViewHandler constructor with configured resourceEndpoints -
Method Summary
Modifier and TypeMethodDescriptionvoid
activateWithStoredConfig
(String className, String methodName, String destinationPlatformName, String serverToBeActivatedName) Activate the stored configuration for the named server on the named destination platformvoid
addAuditLogDestination
(String className, String methodName, String serverToBeConfiguredName, Connection connection) add an audit log destination specified by a connectionvoid
addCohortRegistration
(String serverToBeConfiguredName, String cohortName) Enable registration of server to an open metadata repository cohort using the default topic structure (DEDICATED_TOPICS).void
addConsoleAuditLogDestination
(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities) add a console audit logvoid
addEventTopicAuditLogDestination
(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities) add a Event Topic audit log destinationvoid
addFileAuditLogDestination
(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities) add a File audit log destinationvoid
addSLF4JAuditLogDestination
(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities) add a SLF4J audit logvoid
clearAuditLogDestinations
(String serverToBeConfiguredName) Clear the audit log destinations associated with the server being configuredvoid
configureAccessService
(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker, Map<String, Object> accessServiceOptions) Configure an access servicevoid
configureAllAccessServices
(String className, String methodName, String serverToBeConfiguredName, Map<String, Object> accessServiceOptions) Configure all access servicesvoid
configureEngineService
(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker, Map<String, Object> engineServiceOptions, List<EngineConfig> engines) Configure an engine servicevoid
configureViewService
(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker, Map<String, Object> viewServiceOptions) Configure an view servicevoid
deactivateServerPermanently
(String className, String methodName, String destinationPlatformName, String serverToBeDeactivatedName) Deactivate the stored configuration for the named server on the named destination platform permanently.void
deactivateServerTemporarily
(String className, String methodName, String destinationPlatformName, String serverToBeDeactivatedName) Deactivate the stored configuration for the named server on the named destination platform temporarily.void
deleteAuditLogDestination
(String className, String methodName, String serverToBeConfiguredName, String auditLogDestinationName) Delete an audit log destination that is identified with the supplied destination namevoid
deployOMAGServerConfig
(String className, String methodName, String destinationPlatformName, String serverToBeDeployedName) Deploy an OMAG Server configuration onto a target platform.void
disableAccessService
(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker) Disable an access servicevoid
disableEngineService
(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker) Disable an view servicevoid
disableViewService
(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker) Disable an view servicegetActiveConfiguration
(String className, String methodName, String serverToRetrieveName) Get the active configuration of the named servergetKnownPlatforms
(String userId, String methodName, AuditLog auditLog) Get the server configurations associated with the platforms that this view service knows about as well as the services it supports.getResourceEndpoints - returns a list of the configured resource endpoints.getStoredConfiguration
(String className, String methodName, String serverToBeRetrievedName) Get the stored configuration for the named serverGet the supported severities for the audit logvoid
removeCohortRegistration
(String serverToBeConfiguredName, String cohortName) Unregister this server from an open metadata repository cohort.void
setDefaultAuditLog
(String className, String methodName, String serverToBeConfiguredName) set the default audit logvoid
setEnterpriseAccessConfig
(String className, String methodName, String serverToBeConfiguredName, EnterpriseAccessConfig enterpriseAccessConfig) set the Enterprise Access configvoid
setEventBus
(String className, String methodName, String serverToBeConfiguredName, String connectorProvider, String topicURLRoot, Map<String, Object> configurationProperties) set the Event busvoid
setGraphLocalRepository
(String className, String methodName, String serverToBeConfiguredName, Map<String, Object> storageProperties) Set the local repository to be graph for the named servervoid
setInMemLocalRepository
(String className, String methodName, String serverToBeConfiguredName) Set the local repository to be in memory for the named servervoid
setOMAGServerConfig
(String className, String methodName, String serverToBeConfiguredName, OMAGServerConfig omagServerConfig) Set an OMAG Server's configurationvoid
setPluginRepositoryConnection
(String className, String methodName, String serverToBeConfiguredName, Connection connection) Provide the connection to the local repository - used when the local repository mode is set to plugin repository.void
setReadOnlyLocalRepository
(String className, String methodName, String serverToBeConfiguredName) Set the local repository to be read only for the named servervoid
updateAuditLogDestination
(String className, String methodName, String serverToBeConfiguredName, String auditLogDestinationName, Connection auditLogDestination) Update an audit log destination that is identified with the supplied destination name with the supplied connection object.
-
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 useridmetadataServerURL
- url of the platform to issue admin calls to store configurationresourceEndpoints
- list of platforms
-
-
Method Details
-
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 performedmethodName
- The name of the method being invokedauditLog
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- 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 ServerAuthorViewServiceExceptionSet the local repository to be graph for the named server- Parameters:
className
- class Name for diagnostic purposesmethodName
- current operationserverToBeConfiguredName
- name of the server being configuredstorageProperties
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- 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 purposesmethodName
- current operationserverToBeRetrievedName
- 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 purposesmethodName
- current operationdestinationPlatformName
- platform onto which the server is to be deployedserverToBeDeployedName
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to be configuredomagServerConfig
- 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 ServerAuthorViewServiceExceptionConfigure an access service- Parameters:
className
- class Name for diagnostic purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredserviceURLMarker
- identifier of the access service to configureaccessServiceOptions
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredserviceURLMarker
- 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 ServerAuthorViewServiceExceptionConfigure all access services- Parameters:
className
- class Name for diagnostic purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredaccessServiceOptions
- 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 ServerAuthorViewServiceExceptionConfigure an view service- Parameters:
className
- class Name for diagnostic purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredserviceURLMarker
- identifier of the view service to configureviewServiceOptions
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredserviceURLMarker
- 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 ServerAuthorViewServiceExceptionConfigure an engine service- Parameters:
className
- class Name for diagnostic purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredserviceURLMarker
- identifier of the engine service to configureengineServiceOptions
- engine service optionsengines
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredserviceURLMarker
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredenterpriseAccessConfig
- 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 ServerAuthorViewServiceExceptionset the Event bus- Parameters:
className
- class Name for diagnostic purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredconnectorProvider
- connector provider nametopicURLRoot
- topic URL rootconfigurationProperties
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredsupportedSeverities
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredsupportedSeverities
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredsupportedSeverities
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredsupportedSeverities
- 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 purposesmethodName
- current operationserverToBeConfiguredName
- name of the server to being configuredconnection
- 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 diagnosticsmethodName
- the current operationserverToBeConfiguredName
- name of the server to be configured.auditLogDestinationName
- name of the audit log destination to be updatedauditLogDestination
- 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 diagnosticsmethodName
- the current operationserverToBeConfiguredName
- 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 diagnosticsmethodName
- the current operationserverToRetrieveName
- 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 diagnosticsmethodName
- action being performeddestinationPlatformName
- name of the platform name on which the configuration should be activatedserverToBeActivatedName
- 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 diagnosticsmethodName
- action being performeddestinationPlatformName
- name of the platform name on which the configuration should be activatedserverToBeDeactivatedName
- 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 diagnosticsmethodName
- action being performeddestinationPlatformName
- name of the platform name on which the configuration should be activatedserverToBeDeactivatedName
- server name of the configuration to deactivate
-
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 configuredcohortName
- 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 configuredcohortName
- name of the cohort.- Throws:
ServerAuthorViewServiceException
- error occurred during the unregistration of the cohort
-