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 Summary
Constructors Constructor Description ServerAuthorViewHandler()Default constructor for ServerAuthorViewHandlerServerAuthorViewHandler(String localServerUserId, String metadataServerURL, List<ResourceEndpointConfig> resourceEndpoints)ServerAuthorViewHandler constructor with configured resourceEndpoints
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateWithStoredConfig(String className, String methodName, String destinationPlatformName, String serverToBeActivatedName)Activate the stored configuration for the named server on the named destination platformvoidaddAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, Connection connection)add an audit log destination specified by a connectionvoidaddCohortRegistration(String serverToBeConfiguredName, String cohortName)Enable registration of server to an open metadata repository cohort using the default topic structure (DEDICATED_TOPICS).voidaddConsoleAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities)add a console audit logvoidaddEventTopicAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities)add a Event Topic audit log destinationvoidaddFileAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities)add a File audit log destinationvoidaddSLF4JAuditLogDestination(String className, String methodName, String serverToBeConfiguredName, List<String> supportedSeverities)add a SLF4J audit logvoidconfigureAccessService(String className, String methodName, String serverToBeConfiguredName, String serviceURLMarker, Map<String,Object> accessServiceOptions)Configure an access servicevoidconfigureAllAccessServices(String className, String methodName, String serverToBeConfiguredName, Map<String,Object> accessServiceOptions)Configure all access servicesvoiddeactivateServerPermanently(String className, String methodName, String destinationPlatformName, String serverToBeDeactivatedName)Deactivate the stored configuration for the named server on the named destination platform permanently.voiddeactivateServerTemporarily(String className, String methodName, String destinationPlatformName, String serverToBeDeactivatedName)Deactivate the stored configuration for the named server on the named destination platform temporarily.voiddeployOMAGServerConfig(String className, String methodName, String destinationPlatformName, String serverToBeDeployedName)Deploy an OMAG Server configuration onto a target platform.OMAGServerConfiggetActiveConfiguration(String className, String methodName, String serverToRetrieveName)Get the active configuration of the named serverSet<Platform>getKnownPlatforms(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.Map<String,List<ResourceEndpoint>>getResourceEndpoints()getResourceEndpoints - returns a list of the configured resource endpoints.OMAGServerConfiggetStoredConfiguration(String className, String methodName, String serverToBeRetrievedName)Get the stored configuration for the named serverList<OMRSAuditLogReportSeverity>getSupportedAuditLogSeverities()Get the supported severities for the audit logvoidsetDefaultAuditLog(String className, String methodName, String serverToBeConfiguredName)set the default audit logvoidsetEnterpriseAccessConfig(String className, String methodName, String serverToBeConfiguredName, EnterpriseAccessConfig enterpriseAccessConfig)set the Enterprise Access configvoidsetEventBus(String className, String methodName, String serverToBeConfiguredName, String connectorProvider, String topicURLRoot, Map<String,Object> configurationProperties)set the Event busvoidsetGraphLocalRepository(String className, String methodName, String serverToBeConfiguredName, Map<String,Object> storageProperties)Set the local repository to be graph for the named servervoidsetInMemLocalRepository(String className, String methodName, String serverToBeConfiguredName)Set the local repository to be in memory for the named servervoidsetOMAGServerConfig(String className, String methodName, String serverToBeConfiguredName, OMAGServerConfig omagServerConfig)Set an OMAG Server's configurationvoidsetReadOnlyLocalRepository(String className, String methodName, String serverToBeConfiguredName)Set the local repository to be read only for the named server
-
-
-
Constructor Detail
-
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 Detail
-
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 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 ServerAuthorViewServiceException
Set 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
-
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 ServerAuthorViewServiceException
Configure 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
-
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 purposesmethodName- current operationserverToBeConfiguredName- name of the server to being configuredaccessServiceOptions- access service options to apply to all access services- 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 ServerAuthorViewServiceException
set 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
-
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 retrive 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
public List<OMRSAuditLogReportSeverity> getSupportedAuditLogSeverities()
Get the supported severities for the audit log- Returns:
- the list of the supported severities for the audit log
-
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:
cohortName- name of the cohort.- Throws:
ServerAuthorViewServiceException- error occurred during the registration of the cohort
-
-