Class MetadataHighwayServicesClient
java.lang.Object
org.odpi.openmetadata.repositoryservices.clients.MetadataHighwayServicesClient
- All Implemented Interfaces:
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
public class MetadataHighwayServicesClient
extends Object
implements org.odpi.openmetadata.frameworks.auditlog.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"
- userIdInURL - optional - "/users/{0}"
- operationSpecificURL - operation specific part of the URL
-
Constructor Summary
ConstructorsConstructorDescriptionMetadataHighwayServicesClient(String serverName, String restURLRoot) Create a new client with no authentication embedded in the HTTP request.MetadataHighwayServicesClient(String serverName, String restURLRoot, String userId, String password) Create a new client that passes userId and password in each HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionbooleanconnectToCohort(String userId, 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 userId, String cohortName) Disconnect communications from a specific cohort.List<org.odpi.openmetadata.repositoryservices.properties.CohortDescription>getCohortDescriptions(String userId) Returns the descriptions of all cohorts the server is a member of.org.odpi.openmetadata.frameworks.auditlog.ComponentDescriptionReturn the component description that is used by this connector in the audit log.org.odpi.openmetadata.repositoryservices.connectors.stores.cohortregistrystore.properties.MemberRegistrationgetLocalRegistration(String userId, String cohortName) Returns the registration of the local server in the specified cohort.List<org.odpi.openmetadata.repositoryservices.connectors.stores.cohortregistrystore.properties.MemberRegistration>getRemoteRegistrations(String userId, String cohortName) Returns the remote member registrations seen by the local server in the specified cohort.voidsetAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.booleanunregisterFromCohort(String userId, String cohortName) Unregister from a specific cohort and disconnect from cohort communications.
-
Constructor Details
-
MetadataHighwayServicesClient
public MetadataHighwayServicesClient(String serverName, String restURLRoot) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException Create 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.- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- bad input parameters
-
MetadataHighwayServicesClient
public MetadataHighwayServicesClient(String serverName, String restURLRoot, String userId, String password) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.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:
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.userId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requests- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- bad input parameters
-
-
Method Details
-
setAuditLog
public void setAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) 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 interfaceorg.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent- Parameters:
auditLog- audit log object
-
getConnectorComponentDescription
public org.odpi.openmetadata.frameworks.auditlog.ComponentDescription getConnectorComponentDescription()Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescriptionin interfaceorg.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent- Returns:
- id, name, description, wiki page URL.
-
getCohortDescriptions
public List<org.odpi.openmetadata.repositoryservices.properties.CohortDescription> getCohortDescriptions(String userId) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException Returns the descriptions of all cohorts the server is a member of.- Parameters:
userId- calling user- Returns:
- List of CohortDescription object describing cohorts
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- one of the supplied parameters caused a problemorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- there is a problem communicating with the remote server.org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
getLocalRegistration
public org.odpi.openmetadata.repositoryservices.connectors.stores.cohortregistrystore.properties.MemberRegistration getLocalRegistration(String userId, String cohortName) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException Returns the registration of the local server in the specified cohort.- Parameters:
userId- calling usercohortName- the name of the cohort- Returns:
- MemberRegistration local registration
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- one of the supplied parameters caused a problemorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- there is a problem communicating with the remote server.org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
connectToCohort
public boolean connectToCohort(String userId, String cohortName) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.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:
userId- calling usercohortName- 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:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- one of the supplied parameters caused a problemorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- there is a problem communicating with the remote server.org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
getRemoteRegistrations
public List<org.odpi.openmetadata.repositoryservices.connectors.stores.cohortregistrystore.properties.MemberRegistration> getRemoteRegistrations(String userId, String cohortName) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException Returns the remote member registrations seen by the local server in the specified cohort.- Parameters:
userId- calling usercohortName- the name of the cohort- Returns:
- MemberRegistration local registration
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- one of the supplied parameters caused a problemorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- there is a problem communicating with the remote server.org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
disconnectFromCohort
public boolean disconnectFromCohort(String userId, String cohortName) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException Disconnect communications from a specific cohort.- Parameters:
userId- calling usercohortName- name of cohort- Returns:
- boolean flag to indicate success.
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- one of the supplied parameters caused a problemorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- there is a problem communicating with the remote server.org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-
unregisterFromCohort
public boolean unregisterFromCohort(String userId, String cohortName) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException Unregister from a specific cohort and disconnect from cohort communications.- Parameters:
userId- calling usercohortName- name of cohort- Returns:
- boolean flag to indicate success.
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- one of the supplied parameters caused a problemorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- there is a problem communicating with the remote server.org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException- the user is not authorized to perform the operation requested
-