Class PlatformServicesClient
java.lang.Object
org.odpi.openmetadata.platformservices.client.PlatformServicesClient
PlatformServicesClient is the client for issuing queries to the OMAG Server Platform platform-services interface
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlatformServicesClient(String platformName, String platformRootURL, String secretStoreProvider, String secretStoreLocation, String secretStoreCollection, AuditLog auditLog) Create a new client with bearer token from supplied secrets store.PlatformServicesClient(String platformName, String platformRootURL, Map<String, SecretsStoreConnector> secretsStoreConnectorMap, AuditLog auditLog) Create a new client with bearer token from supplied secrets store. -
Method Summary
Modifier and TypeMethodDescriptionactivateWithStoredConfig(String serverName) Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this server.activateWithSuppliedConfig(OMAGServerConfig configuration) Activate the open metadata and governance services using the supplied configuration document.voidaddOpenMetadataArchive(String serverName, Connection connection) Add a new open metadata archive to running repository.voidaddOpenMetadataArchiveFile(String serverName, String fileName) Add a new open metadata archive to running repository.voidClear the connection object for platform security.Retrieve a list of the access services registered on the platformgetActiveConfiguration(String serverName) Return the configuration used for the current active instance of the server.Retrieve a list of the active servers on the platformgetActiveServerStatus(String serverName) Return the status of a running server (use platform services to find out if the server is running).getActiveServicesForServer(String serverName) Retrieve a list of the active services on a serverRetrieve a list of the services known on the platformRetrieve a list of the common services supported on the platformgetConnectorType(String connectorProviderClassName) Return the connector type for the requested connector provider after validating that the connector provider is available on the OMAGServerPlatform's class path.Retrieve a list of the engine services registered on the platformRetrieve a list of the governance services supported on the platformRetrieve a list of the integration services registered on the platformRetrieve a list of the known servers on the platformReturn details of when the platform was built.Retrieve the platform's owning organizationRetrieve the platform originReturn the connection object for platform security connector.Return the start time for this instance of the platform.Return public details about the platform.getServerStatus(String serverName) Retrieve the server statusRetrieve a list of the view services registered on the platformbooleanisServerKnown(String serverName) Return a flag to indicate if this server has ever run on this OMAG Server Platform instance.voidsetPlatformSecurityConnection(Connection connection) Set up a platform security connector.voidTemporarily shutdown all running servers.voidShutdown any active servers and unregister them from any cohorts.voidshutdownAndUnregisterServer(String serverName) Permanently deactivate any open metadata and governance services and unregister from any cohorts.voidShutdown the platform.voidshutdownServer(String serverName) Temporarily deactivate any open metadata and governance services.
-
Field Details
-
auditLog
-
-
Constructor Details
-
PlatformServicesClient
public PlatformServicesClient(String platformName, String platformRootURL, String secretStoreProvider, String secretStoreLocation, String secretStoreCollection, AuditLog auditLog) throws InvalidParameterException Create a new client with bearer token from supplied secrets store.- Parameters:
platformName- name of the platform to connect toplatformRootURL- the network address of the server running the OMAG PlatformsecretStoreProvider- class name of the secrets storesecretStoreLocation- location (networkAddress) of the secrets storesecretStoreCollection- name of the collection of secrets to use to connect to the remote serverauditLog- destination for log messages.- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
PlatformServicesClient
public PlatformServicesClient(String platformName, String platformRootURL, Map<String, SecretsStoreConnector> secretsStoreConnectorMap, AuditLog auditLog) throws InvalidParameterExceptionCreate a new client with bearer token from supplied secrets store.- Parameters:
platformName- name of the platform to connect toplatformRootURL- the network address of the server running the OMAS REST servicessecretsStoreConnectorMap- connectors to secrets storesauditLog- destination for log messages.- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
getPlatformStartTime
public Date getPlatformStartTime() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedExceptionReturn the start time for this instance of the platform.- Returns:
- start date/time
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getPlatformBuildProperties
Return details of when the platform was built.- Returns:
- start date/time
- Throws:
PropertyServerException- there is a problem reported in the open metadata server(s)
-
getPublicProperties
Return public details about the platform.- Returns:
- start date/time
- Throws:
PropertyServerException- there is a problem reported in the open metadata server(s)
-
getPlatformOrigin
public String getPlatformOrigin() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve the platform origin- Returns:
- origin and version
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getPlatformOrganizationName
public String getPlatformOrganizationName() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve the platform's owning organization- Returns:
- name of organization
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
setPlatformSecurityConnection
public void setPlatformSecurityConnection(Connection connection) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Set up a platform security connector. This connector provides additional authorization checks on API requests to the platform.- Parameters:
connection- connection object that defines the platform security connector- Throws:
UserNotAuthorizedException- the supplied user id (from bearer token) is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
clearPlatformSecurityConnection
public void clearPlatformSecurityConnection() throws UserNotAuthorizedException, InvalidParameterException, PropertyServerExceptionClear the connection object for platform security. This means there is no platform security set up and there will be no authorization checks within the platform. All security will have to come from the surrounding deployment environment. This is the default state.- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
getPlatformSecurityConnection
public Connection getPlatformSecurityConnection() throws UserNotAuthorizedException, InvalidParameterException, PropertyServerExceptionReturn the connection object for platform security connector. Null is returned if no platform security has been set up.- Returns:
- Platform security connection
- Throws:
UserNotAuthorizedException- the supplied user id (from bearer token) is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
getConnectorType
public ConnectorType getConnectorType(String connectorProviderClassName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the connector type for the requested connector provider after validating that the connector provider is available on the OMAGServerPlatform's class path. This method is for tools that are configuring connectors into an Egeria server. It does not validate that the connector will load and initialize.- Parameters:
connectorProviderClassName- name of the connector provider class- Returns:
- ConnectorType bean or exceptions that occur when trying to create the connector
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user id (from bearer token) is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getAccessServices
public List<RegisteredOMAGService> getAccessServices() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the access services registered on the platform- Returns:
- List of access services
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user user id (from bearer token) is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getEngineServices
public List<RegisteredOMAGService> getEngineServices() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the engine services registered on the platform- Returns:
- List of engine services
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getViewServices
public List<RegisteredOMAGService> getViewServices() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the view services registered on the platform- Returns:
- List of view services
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getGovernanceServices
public List<RegisteredOMAGService> getGovernanceServices() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the governance services supported on the platform- Returns:
- List of governance services
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getIntegrationServices
public List<RegisteredOMAGService> getIntegrationServices() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the integration services registered on the platform- Returns:
- List of integration services
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getCommonServices
public List<RegisteredOMAGService> getCommonServices() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the common services supported on the platform- Returns:
- List of common services
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getAllServices
public List<RegisteredOMAGService> getAllServices() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the services known on the platform- Returns:
- List of common services
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
activateWithStoredConfig
public String activateWithStoredConfig(String serverName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this server.- Parameters:
serverName- server to start- Returns:
- success message
- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the server.
-
activateWithSuppliedConfig
public String activateWithSuppliedConfig(OMAGServerConfig configuration) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Activate the open metadata and governance services using the supplied configuration document.- Parameters:
configuration- properties used to initialize the services- Returns:
- success message
- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the server.
-
shutdownServer
public void shutdownServer(String serverName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Temporarily deactivate any open metadata and governance services.- Parameters:
serverName- server to start- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
shutdownAllServers
public void shutdownAllServers() throws UserNotAuthorizedException, InvalidParameterException, PropertyServerExceptionTemporarily shutdown all running servers.- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
shutdownAndUnregisterServer
public void shutdownAndUnregisterServer(String serverName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Permanently deactivate any open metadata and governance services and unregister from any cohorts.- Parameters:
serverName- server to start- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
shutdownAndUnregisterAllServers
public void shutdownAndUnregisterAllServers() throws UserNotAuthorizedException, InvalidParameterException, PropertyServerExceptionShutdown any active servers and unregister them from any cohorts.- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
shutdownPlatform
public void shutdownPlatform() throws UserNotAuthorizedException, InvalidParameterException, PropertyServerExceptionShutdown the platform.- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
getKnownServers
public List<String> getKnownServers() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the known servers on the platform- Returns:
- List of server names
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
isServerKnown
public boolean isServerKnown(String serverName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return a flag to indicate if this server has ever run on this OMAG Server Platform instance.- Parameters:
serverName- server of interest- Returns:
- flag
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getActiveServers
public List<String> getActiveServers() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRetrieve a list of the active servers on the platform- Returns:
- List of server names
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getServerStatus
public ServerStatus getServerStatus(String serverName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the server status- Parameters:
serverName- the name of the server- Returns:
- The server status
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getActiveConfiguration
public OMAGServerConfig getActiveConfiguration(String serverName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Return the configuration used for the current active instance of the server. Null is returned if the server instance is not running.- Parameters:
serverName- server to start- Returns:
- configuration properties used to initialize the server or null if not running
- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
getActiveServerStatus
public ServerServicesStatus getActiveServerStatus(String serverName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Return the status of a running server (use platform services to find out if the server is running).- Parameters:
serverName- server to start- Returns:
- status of the server
- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
getActiveServicesForServer
public List<String> getActiveServicesForServer(String serverName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the active services on a server- Parameters:
serverName- name of the server- Returns:
- List of service names
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
addOpenMetadataArchiveFile
public void addOpenMetadataArchiveFile(String serverName, String fileName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Add a new open metadata archive to running repository.- Parameters:
serverName- server to startfileName- name of the open metadata archive file.- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-
addOpenMetadataArchive
public void addOpenMetadataArchive(String serverName, Connection connection) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Add a new open metadata archive to running repository.- Parameters:
serverName- server to startconnection- connection for the open metadata archive.- Throws:
UserNotAuthorizedException- the supplied user is not authorized to issue this command.InvalidParameterException- invalid parameter.PropertyServerException- unusual state in the platform.
-