Class OMAGServerOperationsClient
- java.lang.Object
-
- org.odpi.openmetadata.adminservices.client.OMAGServerOperationsClient
-
public class OMAGServerOperationsClient extends Object
OMAGServerOperationsClient provides services to start and stop an OMAG Server.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringadminUserIdprotected InvalidParameterHandlerinvalidParameterHandlerprotected NullRequestBodynullRequestBodyprotected org.odpi.openmetadata.adminservices.client.AdminServicesRESTClientrestClientprotected StringserverNameprotected StringserverPlatformRootURL
-
Constructor Summary
Constructors Constructor Description OMAGServerOperationsClient(String adminUserId, String serverName, String serverPlatformRootURL)Create a new client with no authentication embedded in the HTTP request.OMAGServerOperationsClient(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringactivateWithStoredConfig()Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this server.StringactivateWithSuppliedConfig(OMAGServerConfig configuration)Activate the open metadata and governance services using the supplied configuration document.voidaddOpenMetadataArchive(Connection connection)Add a new open metadata archive to running repository.voidaddOpenMetadataArchiveFile(String fileName)Add a new open metadata archive to running repository.voiddeactivatePermanently()Permanently deactivate any open metadata and governance services and unregister from any cohorts.voiddeactivateTemporarily()Temporarily deactivate any open metadata and governance services.OMAGServerConfiggetActiveConfiguration()Return the configuration used for the current active instance of the server.ServerServicesStatusgetServerStatus()Return the status of a running server (use platform services to find out if the server is running).
-
-
-
Field Detail
-
adminUserId
protected String adminUserId
-
serverName
protected String serverName
-
serverPlatformRootURL
protected String serverPlatformRootURL
-
invalidParameterHandler
protected InvalidParameterHandler invalidParameterHandler
-
restClient
protected org.odpi.openmetadata.adminservices.client.AdminServicesRESTClient restClient
-
nullRequestBody
protected NullRequestBody nullRequestBody
-
-
Constructor Detail
-
OMAGServerOperationsClient
public OMAGServerOperationsClient(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.
-
OMAGServerOperationsClient
public OMAGServerOperationsClient(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 Detail
-
activateWithStoredConfig
public String activateWithStoredConfig() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException
Activate the Open Metadata and Governance (OMAG) server using the configuration document stored for this server.- Returns:
- success message
- Throws:
OMAGNotAuthorizedException- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException- invalid parameter.OMAGConfigurationErrorException- unusual state in the admin server.
-
activateWithSuppliedConfig
public String activateWithSuppliedConfig(OMAGServerConfig configuration) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException
Activate the open metadata and governance services using the supplied configuration document.- Parameters:
configuration- properties used to initialize the services- Returns:
- success message
- Throws:
OMAGNotAuthorizedException- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException- invalid parameter.OMAGConfigurationErrorException- unusual state in the admin server.
-
deactivateTemporarily
public void deactivateTemporarily() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionTemporarily deactivate any open metadata and governance services.- Throws:
OMAGNotAuthorizedException- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException- invalid parameter.OMAGConfigurationErrorException- unusual state in the admin server.
-
deactivatePermanently
public void deactivatePermanently() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorExceptionPermanently deactivate any open metadata and governance services and unregister from any cohorts.- Throws:
OMAGNotAuthorizedException- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException- invalid parameter.OMAGConfigurationErrorException- unusual state in the admin server.
-
getActiveConfiguration
public OMAGServerConfig getActiveConfiguration() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException
Return the configuration used for the current active instance of the server. Null is returned if the server instance is not running.- Returns:
- configuration properties used to initialize the server or null if not running
- Throws:
OMAGNotAuthorizedException- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException- invalid parameter.OMAGConfigurationErrorException- unusual state in the admin server.
-
getServerStatus
public ServerServicesStatus getServerStatus() throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException
Return the status of a running server (use platform services to find out if the server is running).- Returns:
- status 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.
-
addOpenMetadataArchiveFile
public void addOpenMetadataArchiveFile(String fileName) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException
Add a new open metadata archive to running repository.- Parameters:
fileName- name of the open metadata archive file.- Throws:
OMAGNotAuthorizedException- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException- invalid parameter.OMAGConfigurationErrorException- unusual state in the admin server.
-
addOpenMetadataArchive
public void addOpenMetadataArchive(Connection connection) throws OMAGNotAuthorizedException, OMAGInvalidParameterException, OMAGConfigurationErrorException
Add a new open metadata archive to running repository.- Parameters:
connection- connection for the open metadata archive.- Throws:
OMAGNotAuthorizedException- the supplied userId is not authorized to issue this command.OMAGInvalidParameterException- invalid parameter.OMAGConfigurationErrorException- unusual state in the admin server.
-
-