Class MetadataHighwayServicesClient

  • All Implemented Interfaces:
    AuditLoggingComponent

    public class MetadataHighwayServicesClient
    extends java.lang.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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected AuditLog auditLog  
    • Constructor Summary

      Constructors 
      Constructor Description
      MetadataHighwayServicesClient​(java.lang.String serverName, java.lang.String restURLRoot)
      Create a new client with no authentication embedded in the HTTP request.
      MetadataHighwayServicesClient​(java.lang.String serverName, java.lang.String restURLRoot, java.lang.String userId, java.lang.String password)
      Create a new client that passes userId and password in each HTTP request.
    • Field Detail

    • Constructor Detail

      • MetadataHighwayServicesClient

        public MetadataHighwayServicesClient​(java.lang.String serverName,
                                             java.lang.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 server
        restURLRoot - 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​(java.lang.String serverName,
                                             java.lang.String restURLRoot,
                                             java.lang.String userId,
                                             java.lang.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 server
        restURLRoot - 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 requests
        password - caller's userId embedded in all HTTP requests
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.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:
        setAuditLog in interface AuditLoggingComponent
        Parameters:
        auditLog - audit log object
      • getCohortDescriptions

        public java.util.List<CohortDescription> getCohortDescriptions​(java.lang.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 problem
        org.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 MemberRegistration getLocalRegistration​(java.lang.String serverName,
                                                       java.lang.String userId,
                                                       java.lang.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:
        serverName - the name of the server
        userId - calling user
        cohortName - the name of the cohort
        Returns:
        MemberRegistration local registration
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException - one of the supplied parameters caused a problem
        org.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 java.util.List<MemberRegistration> getRemoteRegistrations​(java.lang.String serverName,
                                                                         java.lang.String userId,
                                                                         java.lang.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:
        serverName - the name of the server
        userId - calling user
        cohortName - the name of the cohort
        Returns:
        MemberRegistration local registration
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException - one of the supplied parameters caused a problem
        org.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