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
-
Constructor Summary
ConstructorDescriptionPlatformServicesClient
(String platformName, String platformRootURL) Create a new client with no authentication embedded in the HTTP request.PlatformServicesClient
(String platformName, String platformRootURL, String userId, String password) Create a new client that passes userId and password in each HTTP request.PlatformServicesClient
(String platformName, String platformRootURL, String userId, String password, AuditLog auditLog) Create a new client that passes userId and password in each HTTP request.PlatformServicesClient
(String platformName, String platformRootURL, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionactivateWithStoredConfig
(String userId, String serverName) Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this server.activateWithSuppliedConfig
(String userId, OMAGServerConfig configuration) Activate the open metadata and governance services using the supplied configuration document.void
addOpenMetadataArchive
(String userId, String serverName, Connection connection) Add a new open metadata archive to running repository.void
addOpenMetadataArchiveFile
(String userId, String serverName, String fileName) Add a new open metadata archive to running repository.void
Clear the connection object for platform security.getAccessServices
(String userId) Retrieve a list of the access services registered on the platformgetActiveConfiguration
(String userId, String serverName) Return the configuration used for the current active instance of the server.getActiveServers
(String userId) Retrieve a list of the active servers on the platformgetActiveServerStatus
(String userId, String serverName) Return the status of a running server (use platform services to find out if the server is running).getActiveServicesForServer
(String userId, String serverName) Retrieve a list of the active services on a servergetAllServices
(String userId) Retrieve a list of the services known on the platformgetCommonServices
(String userId) Retrieve a list of the common services supported on the platformgetConnectorType
(String userId, 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.getEngineServices
(String userId) Retrieve a list of the engine services registered on the platformgetGovernanceServices
(String userId) Retrieve a list of the governance services supported on the platformgetIntegrationServices
(String userId) Retrieve a list of the integration services registered on the platformgetKnownServers
(String userId) Retrieve a list of the known servers on the platformgetPlatformBuildProperties
(String userId) Return details of then the platform was built.getPlatformOrigin
(String userId) Retrieve the platform origingetPlatformSecurityConnection
(String userId) Return the connection object for platform security connector.getPlatformStartTime
(String userId) Return the start time for this instance of the platform.getServerStatus
(String userId, String serverName) Retrieve the server statusgetViewServices
(String userId) Retrieve a list of the view services registered on the platformboolean
isServerKnown
(String userId, String serverName) Return a flag to indicate if this server has ever run on this OMAG Server Platform instance.void
setPlatformSecurityConnection
(String userId, Connection connection) Set up a platform security connector.void
shutdownAllServers
(String userId) Temporarily shutdown all running servers.void
Shutdown any active servers and unregister them from any cohorts.void
shutdownAndUnregisterServer
(String userId, String serverName) Permanently deactivate any open metadata and governance services and unregister from any cohorts.void
shutdownPlatform
(String userId) Shutdown the platform.void
shutdownServer
(String userId, String serverName) Temporarily deactivate any open metadata and governance services.
-
Field Details
-
auditLog
-
-
Constructor Details
-
PlatformServicesClient
public PlatformServicesClient(String platformName, String platformRootURL, AuditLog auditLog) throws InvalidParameterException Create a new client with no authentication embedded in the HTTP request.- Parameters:
platformName
- name of the platform to connect toplatformRootURL
- the network address of the server running the OMAG PlatformauditLog
- logging destination- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
PlatformServicesClient
public PlatformServicesClient(String platformName, String platformRootURL) throws InvalidParameterException Create a new client with no authentication embedded in the HTTP request.- Parameters:
platformName
- name of the platform to connect toplatformRootURL
- the network address of the server running the OMAS REST services- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
PlatformServicesClient
public PlatformServicesClient(String platformName, String platformRootURL, String userId, String password, AuditLog auditLog) throws InvalidParameterException Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
platformName
- name of the platform to connect toplatformRootURL
- the network address of the platformuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requestsauditLog
- logging destination- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
PlatformServicesClient
public PlatformServicesClient(String platformName, String platformRootURL, String userId, String password) throws InvalidParameterException Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
platformName
- name of the server to connect toplatformRootURL
- the network address of the platformuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
getPlatformStartTime
public Date getPlatformStartTime(String userId) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the start time for this instance of the platform.- Parameters:
userId
- calling user- 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
public BuildProperties getPlatformBuildProperties(String userId) throws InvalidParameterException, PropertyServerException Return details of then the platform was built.- Parameters:
userId
- calling user- Returns:
- start date/time
- Throws:
InvalidParameterException
- one of the parameters is invalidPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getPlatformOrigin
public String getPlatformOrigin(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the platform origin- Parameters:
userId
- calling user- 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)
-
setPlatformSecurityConnection
public void setPlatformSecurityConnection(String userId, 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:
userId
- calling userconnection
- connection object that defines the platform security connector- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
clearPlatformSecurityConnection
public void clearPlatformSecurityConnection(String userId) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Clear 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.- Parameters:
userId
- calling user- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
getPlatformSecurityConnection
public Connection getPlatformSecurityConnection(String userId) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Return the connection object for platform security connector. Null is returned if no platform security has been set up.- Parameters:
userId
- calling user- Returns:
- Platform security connection
- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
getConnectorType
public ConnectorType getConnectorType(String userId, 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:
userId
- calling userconnectorProviderClassName
- 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 is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getAccessServices
public List<RegisteredOMAGService> getAccessServices(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the access services registered on the platform- Parameters:
userId
- calling user- Returns:
- List of access 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)
-
getEngineServices
public List<RegisteredOMAGService> getEngineServices(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the engine services registered on the platform- Parameters:
userId
- calling user- 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(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the view services registered on the platform- Parameters:
userId
- calling user- 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(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the governance services supported on the platform- Parameters:
userId
- calling user- 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(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the integration services registered on the platform- Parameters:
userId
- calling user- 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(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the common services supported on the platform- Parameters:
userId
- calling user- 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(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the services known on the platform- Parameters:
userId
- calling user- 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 userId, String serverName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this server.- Parameters:
userId
- calling userserverName
- server to start- Returns:
- success message
- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the server.
-
activateWithSuppliedConfig
public String activateWithSuppliedConfig(String userId, OMAGServerConfig configuration) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Activate the open metadata and governance services using the supplied configuration document.- Parameters:
userId
- calling userconfiguration
- properties used to initialize the services- Returns:
- success message
- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the server.
-
shutdownServer
public void shutdownServer(String userId, String serverName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Temporarily deactivate any open metadata and governance services.- Parameters:
userId
- calling userserverName
- server to start- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
shutdownAllServers
public void shutdownAllServers(String userId) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Temporarily shutdown all running servers.- Parameters:
userId
- user that is issuing the request- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
shutdownAndUnregisterServer
public void shutdownAndUnregisterServer(String userId, String serverName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Permanently deactivate any open metadata and governance services and unregister from any cohorts.- Parameters:
userId
- calling userserverName
- server to start- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
shutdownAndUnregisterAllServers
public void shutdownAndUnregisterAllServers(String userId) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Shutdown any active servers and unregister them from any cohorts.- Parameters:
userId
- user that is issuing the request- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
shutdownPlatform
public void shutdownPlatform(String userId) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Shutdown the platform.- Parameters:
userId
- user that is issuing the request- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
getKnownServers
public List<String> getKnownServers(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the known servers on the platform- Parameters:
userId
- calling user- 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 userId, String serverName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return a flag to indicate if this server has ever run on this OMAG Server Platform instance.- Parameters:
userId
- calling userserverName
- 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(String userId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the active servers on the platform- Parameters:
userId
- calling user- 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 userId, String serverName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the server status- Parameters:
userId
- calling userserverName
- 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 userId, 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:
userId
- calling userserverName
- server to start- Returns:
- configuration properties used to initialize the server or null if not running
- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
getActiveServerStatus
public ServerServicesStatus getActiveServerStatus(String userId, 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:
userId
- calling userserverName
- server to start- Returns:
- status of the server
- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
getActiveServicesForServer
public List<String> getActiveServicesForServer(String userId, String serverName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve a list of the active services on a server- Parameters:
userId
- calling userserverName
- 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 userId, String serverName, String fileName) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Add a new open metadata archive to running repository.- Parameters:
userId
- calling userserverName
- server to startfileName
- name of the open metadata archive file.- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-
addOpenMetadataArchive
public void addOpenMetadataArchive(String userId, String serverName, Connection connection) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Add a new open metadata archive to running repository.- Parameters:
userId
- calling userserverName
- server to startconnection
- connection for the open metadata archive.- Throws:
UserNotAuthorizedException
- the supplied userId is not authorized to issue this command.InvalidParameterException
- invalid parameter.PropertyServerException
- unusual state in the platform.
-