Class MetadataHighwayServicesClient
- java.lang.Object
-
- org.odpi.openmetadata.repositoryservices.clients.MetadataHighwayServicesClient
-
- All Implemented Interfaces:
AuditLoggingComponent
public class MetadataHighwayServicesClient extends Object implements 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
Constructors Constructor Description MetadataHighwayServicesClient(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CohortDescription>getCohortDescriptions(String userId)Returns the descriptions of all cohorts the server is a member of.MemberRegistrationgetLocalRegistration(String serverName, String userId, String cohortName)Returns the registration of the local server in the specified cohortList<MemberRegistration>getRemoteRegistrations(String serverName, String userId, String cohortName)Returns the remote member registrations seen by the local server in the specified cohortvoidsetAuditLog(AuditLog auditLog)Receive an audit log object that can be used to record audit log messages.
-
-
-
Field Detail
-
auditLog
protected AuditLog auditLog
-
-
Constructor Detail
-
MetadataHighwayServicesClient
public MetadataHighwayServicesClient(String serverName, String restURLRoot) throws 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:
InvalidParameterException- bad input parameters
-
MetadataHighwayServicesClient
public MetadataHighwayServicesClient(String serverName, String restURLRoot, 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:
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:
InvalidParameterException- bad input parameters
-
-
Method Detail
-
setAuditLog
public void setAuditLog(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 interfaceAuditLoggingComponent- Parameters:
auditLog- audit log object
-
getCohortDescriptions
public List<CohortDescription> getCohortDescriptions(String userId) throws InvalidParameterException, RepositoryErrorException, 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:
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 serverName, String userId, String cohortName) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException
Returns the registration of the local server in the specified cohort- Parameters:
serverName- the name of the serveruserId- calling usercohortName- 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
-
getRemoteRegistrations
public List<MemberRegistration> getRemoteRegistrations(String serverName, String userId, String cohortName) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException
Returns the remote member registrations seen by the local server in the specified cohort- Parameters:
serverName- the name of the serveruserId- calling usercohortName- 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
-
-