Class OMAGServerConfigurationClient
java.lang.Object
org.odpi.openmetadata.adminservices.client.OMAGServerConfigurationClient
- Direct Known Subclasses:
CohortMemberConfigurationClient
,GovernanceServerConfigurationClient
,ViewServerConfigurationClient
OMAGServerConfigurationClient provides common services to configure an OMAG Server.
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
Callers user id to pass on each request to the config document store.protected InvalidParameterHandler
Handler for validating parameters passed on requests.protected NullRequestBody
protected AdminServicesRESTClient
REST client for calling the Administration Services on the platform.protected String
Name of the server being configured.protected String
URL of the platform that can pass on administration requests to the configuration document store. -
Constructor Summary
ConstructorDescriptionOMAGServerConfigurationClient
(String adminUserId, String serverName, String serverPlatformRootURL) Create a new client with no authentication embedded in the HTTP request.OMAGServerConfigurationClient
(String adminUserId, String serverName, String serverPlatformRootURL, String connectionUserId, String connectionPassword) Create a new client that passes a connection userId and password in each HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuditLogDestination
(Connection connection) Add an audit log destination that is defined by the supplied connection object.void
addConsoleAuditLogDestination
(List<String> supportedSeverities) Set up the console audit log for the server.void
addEventTopicAuditLogDestination
(String topicName, List<String> supportedSeverities) Add an audit log destination that sends each log record as an event on the supplied event topic.void
addEventTopicAuditLogDestination
(List<String> supportedSeverities) Add an audit log destination that sends each log record as an event on the supplied event topic.void
addFileAuditLogDestination
(String directoryName, List<String> supportedSeverities) Add an audit log destination that creates log records as JSON files in a shared directory.void
addFileAuditLogDestination
(List<String> supportedSeverities) Add an audit log destination that creates log records as JSON files in a shared directory.void
addJDBCAuditLogDestination
(List<String> supportedSeverities, String jdbcConnectionString) Add an audit log destination that creates log records as JSON files in a shared directory.void
addSLF4JAuditLogDestination
(List<String> supportedSeverities) Add an audit log destination that creates slf4j records.void
clearAuditLogDestination
(String connectionName) Delete an audit log destination that is defined by the supplied audit log destination connection namevoid
Clears all audit log destinations for this server.void
Remove the configuration for the server.void
Clear the connection object for the server security connection which means the server does no authorization checks when a request is made to this server.void
deployOMAGServerConfig
(String destinationPlatformURLRoot) Push the configuration for the server to another OMAG Server Platform.Return the basic server properties in a single request.Return the complete set of configuration properties in use by the server.Return the complete set of configuration properties in use by a running instance of the server.Return the connection object for the server security connector.Return the derived server type that is classified based on the configuration values.void
setAuditLogDestinations
(List<Connection> auditLogDestinations) Set up all audit log destinations for this server.void
setBasicServerProperties
(String organizationName, String serverDescription, String serverUserId, String serverPassword, String serverURLRoot, int maxPageSize) Set up the basic server properties in a single request.void
Set up the default audit log for the server.void
setEventBus
(String connectorProvider, String topicURLRoot, Map<String, Object> configurationProperties) Set up the default event bus for embedding in event-driven connector.void
setMaxPageSize
(int maxPageSize) Set an upper limit in the page size that can be requested on a REST call to the server.void
setOMAGServerConfig
(OMAGServerConfig serverConfig) Set up the configuration properties for an OMAG Server in a single command.void
setOrganizationName
(String organizationName) Set up the name of the organization that is running this server.void
setServerDescription
(String description) Set up the description of this server.void
setServerPassword
(String serverPassword) Set up the password to use in the header of HTTP requests with the server's userId.void
setServerSecurityConnection
(Connection connection) Override the default server security connector.void
setServerType
(String serverType) Set up the descriptive type of the server.void
setServerURLRoot
(String serverURLRoot) Set up the root URL for this server that is used to construct full URL paths to calls for this server's REST interfaces.void
setServerUserId
(String serverUserId) Set up the user id to use when there is no external user driving the work (for example when processing events from another server).void
updateAuditLogDestination
(String suppliedConnectionName, Connection connection) Replace an audit log destination connection identified by the supplied audit log destination connection name with the supplied audit log destination connection.
-
Field Details
-
adminUserId
Callers user id to pass on each request to the config document store. -
serverName
Name of the server being configured. -
serverPlatformRootURL
URL of the platform that can pass on administration requests to the configuration document store. -
invalidParameterHandler
Handler for validating parameters passed on requests. -
restClient
REST client for calling the Administration Services on the platform. -
nullRequestBody
-
-
Constructor Details
-
OMAGServerConfigurationClient
public OMAGServerConfigurationClient(String adminUserId, String serverName, String serverPlatformRootURL) throws OMAGInvalidParameterException Create a new client with no authentication embedded in the HTTP request.- Parameters:
adminUserId
- administrator's (end user's) userId to associate with calls.serverName
- name of the server to connect toserverPlatformRootURL
- the network address of the server running the admin services- Throws:
OMAGInvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
OMAGServerConfigurationClient
public OMAGServerConfigurationClient(String adminUserId, String serverName, String serverPlatformRootURL, String connectionUserId, String connectionPassword) throws OMAGInvalidParameterException Create a new client that passes a connection userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is passed as the admin userId.- Parameters:
adminUserId
- administrator's (end user's) userId to associate with calls.serverName
- name of the server to connect toserverPlatformRootURL
- the network address of the server running the admin servicesconnectionUserId
- caller's system userId embedded in all HTTP requestsconnectionPassword
- caller's system password embedded in all HTTP requests- Throws:
OMAGInvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
clearOMAGServerConfig
public void clearOMAGServerConfig() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionRemove the configuration for the server.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
getServerTypeClassification
public ServerTypeClassificationSummary getServerTypeClassification() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionReturn the derived server type that is classified based on the configuration values.- Returns:
- server classification description
- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setServerURLRoot
public void setServerURLRoot(String serverURLRoot) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up the root URL for this server that is used to construct full URL paths to calls for this server's REST interfaces. Typically, this is the URL root of the OMAG Server Platform Where the server is deployed to. However, it may be a DNS name - particularly if the server is deployed to multiple platforms for high availability (HA). The default value is ""https://localhost:9443"".- Parameters:
serverURLRoot
- String url.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setEventBus
public void setEventBus(String connectorProvider, String topicURLRoot, Map<String, Object> configurationProperties) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionSet up the default event bus for embedding in event-driven connector. The resulting connector will be used in the OMRS Topic Connector for each cohort, the in and out topics for each Access Service and the local repository's event mapper.- Parameters:
connectorProvider
- connector provider for the event bus (if it is null then Kafka is assumed).topicURLRoot
- the common root of the topics used by the open metadata server.configurationProperties
- property name/value pairs used to configure the connection to the event bus connector- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setServerType
public void setServerType(String serverType) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up the descriptive type of the server. This value is added to distributed events to make it easier to understand the source of events. The default value is derived from the type of server that is being configured. If this method is called, it overrides the default value.- Parameters:
serverType
- short description for the type of server.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setOrganizationName
public void setOrganizationName(String organizationName) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up the name of the organization that is running this server. This value is added to distributed events to make it easier to understand the source of events. The default value is null.- Parameters:
organizationName
- String name of the organization.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setServerDescription
public void setServerDescription(String description) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up the description of this server. The default value is null.- Parameters:
description
- String description of the server- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setServerUserId
public void setServerUserId(String serverUserId) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up the user id to use when there is no external user driving the work (for example when processing events from another server). It is also used in the header of HTTP requests if the password is also set.- Parameters:
serverUserId
- String user that the server will use on connections and requests not associated with an end user.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setServerPassword
public void setServerPassword(String serverPassword) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up the password to use in the header of HTTP requests with the server's userId.- Parameters:
serverPassword
- String password that the server will use on connections.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setMaxPageSize
public void setMaxPageSize(int maxPageSize) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set an upper limit in the page size that can be requested on a REST call to the server. The default value is 1000. The value is validated server side.- Parameters:
maxPageSize
- max number of elements that can be returned on a request.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setBasicServerProperties
public void setBasicServerProperties(String organizationName, String serverDescription, String serverUserId, String serverPassword, String serverURLRoot, int maxPageSize) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up the basic server properties in a single request.- Parameters:
organizationName
- String name of the organization.serverDescription
- String description of the serverserverUserId
- String user that the server will use on connections and requests not associated with an end user.serverPassword
- String password that the server will use on connections.serverURLRoot
- String url.maxPageSize
- max number of elements that can be returned on a request.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
getBasicServerProperties
public BasicServerProperties getBasicServerProperties() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionReturn the basic server properties in a single request.- Returns:
- basic server properties
- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setDefaultAuditLog
public void setDefaultAuditLog() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionSet up the default audit log for the server. This adds the console audit log destination.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
addConsoleAuditLogDestination
public void addConsoleAuditLogDestination(List<String> supportedSeverities) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up the console audit log for the server. This writes selected parts of the audit log record to stdout.- Parameters:
supportedSeverities
- list of severities that should be logged to this destination (empty list means all)- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
addSLF4JAuditLogDestination
public void addSLF4JAuditLogDestination(List<String> supportedSeverities) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Add an audit log destination that creates slf4j records.- Parameters:
supportedSeverities
- list of severities that should be logged to this destination (empty list means all)- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
addFileAuditLogDestination
public void addFileAuditLogDestination(List<String> supportedSeverities) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Add an audit log destination that creates log records as JSON files in a shared directory.- Parameters:
supportedSeverities
- list of severities that should be logged to this destination (empty list means all)- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
addJDBCAuditLogDestination
public void addJDBCAuditLogDestination(List<String> supportedSeverities, String jdbcConnectionString) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Add an audit log destination that creates log records as JSON files in a shared directory.- Parameters:
supportedSeverities
- list of severities that should be logged to this destination (empty list means all)jdbcConnectionString
- connection string used to connect to the JDBC data base- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
addFileAuditLogDestination
public void addFileAuditLogDestination(String directoryName, List<String> supportedSeverities) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Add an audit log destination that creates log records as JSON files in a shared directory.- Parameters:
directoryName
- optional directory namesupportedSeverities
- list of severities that should be logged to this destination (empty list means all)- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
addEventTopicAuditLogDestination
public void addEventTopicAuditLogDestination(List<String> supportedSeverities) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Add an audit log destination that sends each log record as an event on the supplied event topic.- Parameters:
supportedSeverities
- list of severities that should be logged to this destination (empty list means all)- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
addEventTopicAuditLogDestination
public void addEventTopicAuditLogDestination(String topicName, List<String> supportedSeverities) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Add an audit log destination that sends each log record as an event on the supplied event topic.- Parameters:
topicName
- name of topic for audit log entriessupportedSeverities
- list of severities that should be logged to this destination (empty list means all)- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
addAuditLogDestination
public void addAuditLogDestination(Connection connection) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Add an audit log destination that is defined by the supplied connection object.- Parameters:
connection
- connection object that defines the audit log destination- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
updateAuditLogDestination
public void updateAuditLogDestination(String suppliedConnectionName, Connection connection) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Replace an audit log destination connection identified by the supplied audit log destination connection name with the supplied audit log destination connection.- Parameters:
suppliedConnectionName
- the qualified name of the audit log destination to update.connection
- connection object that replaces the existing one.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
clearAuditLogDestination
public void clearAuditLogDestination(String connectionName) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Delete an audit log destination that is defined by the supplied audit log destination connection name- Parameters:
connectionName
- the qualified name of the audit log destination connection to delete.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setAuditLogDestinations
public void setAuditLogDestinations(List<Connection> auditLogDestinations) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Set up all audit log destinations for this server. Any existing definitions are overwritten- Parameters:
auditLogDestinations
- list of connections- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
clearAuditLogDestinations
public void clearAuditLogDestinations() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionClears all audit log destinations for this server.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setServerSecurityConnection
public void setServerSecurityConnection(Connection connection) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException Override the default server security connector.- Parameters:
connection
- connection object that defines the server security connector- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
clearServerSecurityConnection
public void clearServerSecurityConnection() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionClear the connection object for the server security connection which means the server does no authorization checks when a request is made to this server.- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
getServerSecurityConnection
public Connection getServerSecurityConnection() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionReturn the connection object for the server security connector. Null is returned if the server does not have a server security connection.- Returns:
- server security connection
- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
setOMAGServerConfig
public void setOMAGServerConfig(OMAGServerConfig serverConfig) throws OMAGNotAuthorizedException, OMAGConfigurationErrorException, OMAGInvalidParameterException Set up the configuration properties for an OMAG Server in a single command.- Parameters:
serverConfig
- configuration for the server- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
deployOMAGServerConfig
public void deployOMAGServerConfig(String destinationPlatformURLRoot) throws OMAGNotAuthorizedException, OMAGConfigurationErrorException, OMAGInvalidParameterException Push the configuration for the server to another OMAG Server Platform.- Parameters:
destinationPlatformURLRoot
- location of the platform where the config is to be deployed to- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
getOMAGServerConfig
public OMAGServerConfig getOMAGServerConfig() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionReturn the complete set of configuration properties in use by the server.- Returns:
- OMAGServerConfig properties
- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-
getOMAGServerInstanceConfig
public OMAGServerConfig getOMAGServerInstanceConfig() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionReturn the complete set of configuration properties in use by a running instance of the server.- Returns:
- OMAGServerConfig properties
- Throws:
OMAGNotAuthorizedException
- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException
- invalid parameter.OMAGConfigurationErrorException
- unusual state in the admin server.
-