Class MetadataHighwayServicesClient
java.lang.Object
org.odpi.openmetadata.repositoryservices.clients.MetadataHighwayServicesClient
- All Implemented Interfaces:
AuditLoggingComponent
The MetadataHighwayServicesClient supports the OMRS Metadata Highway REST API.
Requests to this client are translated one-for-one to requests to the metadata highway service since
the OMRS REST API has a one-to-one correspondence with the metadata highway API.
The URLs for the REST APIs are of this form:
- restURLroot - serverURLroot + "/servers/" + serverName
- rootServiceNameInURL - "/open-metadata/repository-services"
- operationSpecificURL - operation specific part of the URL
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetadataHighwayServicesClient(String serverName, String restURLRoot, String secretsStoreProvider, String secretsStoreLocation, String secretsStoreCollection, AuditLog auditLog) Create a new client with bearer token authentication embedded in the HTTP request.MetadataHighwayServicesClient(String serverName, String restURLRoot, Map<String, SecretsStoreConnector> secretsStoreConnectorMap, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionbooleanconnectToCohort(String cohortName) A new server needs to register the metadataCollectionId for its metadata repository with the other servers in the open metadata repository.booleandisconnectFromCohort(String cohortName) Disconnect communications from a specific cohort.Returns the descriptions of all cohorts the server is a member of.Return the component description that is used by this connector in the audit log.getLocalRegistration(String cohortName) Returns the registration of the local server in the specified cohort.getRemoteRegistrations(String cohortName) Returns the remote member registrations seen by the local server in the specified cohort.voidsetAuditLog(AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.booleanunregisterFromCohort(String cohortName) Unregister from a specific cohort and disconnect from cohort communications.
-
Field Details
-
auditLog
-
-
Constructor Details
-
MetadataHighwayServicesClient
public MetadataHighwayServicesClient(String serverName, String restURLRoot, String secretsStoreProvider, String secretsStoreLocation, String secretsStoreCollection, AuditLog auditLog) throws InvalidParameterException Create a new client with bearer token authentication embedded in the HTTP request.- Parameters:
serverName- the name of the remote serverrestURLRoot- the network address of the server running the repository services. This is of the form serverURLroot + "/servers/" + serverName.secretsStoreProvider- secrets store connector for bearer tokensecretsStoreLocation- secrets store location for bearer tokensecretsStoreCollection- secrets store collection for bearer tokenauditLog- destination for log messages.- Throws:
InvalidParameterException- bad input parameters
-
MetadataHighwayServicesClient
public MetadataHighwayServicesClient(String serverName, String restURLRoot, Map<String, SecretsStoreConnector> secretsStoreConnectorMap, AuditLog auditLog) throws InvalidParameterExceptionCreate a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- the name of the remote serverrestURLRoot- the network address of the server running the repository services. This is of the form serverURLroot + "/servers/" + serverName.secretsStoreConnectorMap- connectors to secrets storesauditLog- destination for log messages.- Throws:
InvalidParameterException- bad input parameters
-
-
Method Details
-
setAuditLog
Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.- Specified by:
setAuditLogin interfaceAuditLoggingComponent- Parameters:
auditLog- audit log object
-
getConnectorComponentDescription
Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescriptionin interfaceAuditLoggingComponent- Returns:
- id, name, description, wiki page URL.
-
getCohortDescriptions
public List<CohortDescription> getCohortDescriptions() throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedExceptionReturns the descriptions of all cohorts the server is a member of.- Returns:
- List of CohortDescription object describing cohorts
- Throws:
InvalidParameterException- one of the supplied parameters caused a problemRepositoryErrorException- there is a problem communicating with the remote server.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
getLocalRegistration
public MemberRegistration getLocalRegistration(String cohortName) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Returns the registration of the local server in the specified cohort.- Parameters:
cohortName- the name of the cohort- Returns:
- MemberRegistration local registration
- Throws:
InvalidParameterException- one of the supplied parameters caused a problemRepositoryErrorException- there is a problem communicating with the remote server.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
connectToCohort
public boolean connectToCohort(String cohortName) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException A new server needs to register the metadataCollectionId for its metadata repository with the other servers in the open metadata repository. It only needs to do this once and uses a timestamp to record that the registration event has been sent. If the server has already registered in the past, it sends a reregistration request.- Parameters:
cohortName- name of cohort- Returns:
- boolean to indicate that the request has been issued. If false it is likely that the cohort name is not known
- Throws:
InvalidParameterException- one of the supplied parameters caused a problemRepositoryErrorException- there is a problem communicating with the remote server.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
getRemoteRegistrations
public List<MemberRegistration> getRemoteRegistrations(String cohortName) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Returns the remote member registrations seen by the local server in the specified cohort.- Parameters:
cohortName- the name of the cohort- Returns:
- MemberRegistration local registration
- Throws:
InvalidParameterException- one of the supplied parameters caused a problemRepositoryErrorException- there is a problem communicating with the remote server.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
disconnectFromCohort
public boolean disconnectFromCohort(String cohortName) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Disconnect communications from a specific cohort.- Parameters:
cohortName- name of cohort- Returns:
- boolean flag to indicate success.
- Throws:
InvalidParameterException- one of the supplied parameters caused a problemRepositoryErrorException- there is a problem communicating with the remote server.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
unregisterFromCohort
public boolean unregisterFromCohort(String cohortName) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Unregister from a specific cohort and disconnect from cohort communications.- Parameters:
cohortName- name of cohort- Returns:
- boolean flag to indicate success.
- Throws:
InvalidParameterException- one of the supplied parameters caused a problemRepositoryErrorException- there is a problem communicating with the remote server.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-