Class SubjectAreaRestClient


  • public class SubjectAreaRestClient
    extends FFDCRESTClient
    RESTClient is responsible for issuing calls to the Subject Area OMAS REST APIs. In this class with methods there is a parameter "urnTemplate" below is an example for a better understanding. For example "/servers/%s/open-metadata/access-services/subject-area/users/%s/categories/%s" where first %s - serverName, second %s - userId and third %s - guid This URN will be a continuation of serverPlatformURLRoot, which was set when creating the object
    • Constructor Summary

      Constructors 
      Constructor Description
      SubjectAreaRestClient​(java.lang.String serverName, java.lang.String serverPlatformURLRoot)
      SubjectAreaRestClient​(java.lang.String serverName, java.lang.String serverPlatformURLRoot, java.lang.String userId, java.lang.String password)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.odpi.openmetadata.accessservices.subjectarea.utils.QueryBuilder createFindQuery​(java.lang.String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest)
      Method for constructing a query (https://en.wikipedia.org/wiki/Query_string) using the information described in the findRequest page size and startingFrom need to set by the caller.
      org.odpi.openmetadata.accessservices.subjectarea.utils.QueryBuilder createFindQuery​(java.lang.String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, org.odpi.openmetadata.accessservices.subjectarea.utils.QueryParams queryParams)
      Method for constructing a query (https://en.wikipedia.org/wiki/Query_string) using the information described in the findRequest page size and startingFrom need to set by the caller.
      <T> GenericResponse<T> deleteRESTCall​(java.lang.String userId, java.lang.String guid, java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, java.lang.String urnTemplate)
      Issue a Delete REST call
      <T> GenericResponse<T> findRESTCall​(java.lang.String userId, java.lang.String guid, java.lang.String methodName, java.lang.String urnTemplate, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, java.lang.Integer maximumPageSizeOnRestCall)
      Issue a GET REST call that returns a response found objects using the information described in findRequest
      <T> GenericResponse<T> findRESTCall​(java.lang.String userId, java.lang.String methodName, java.lang.String urnTemplate, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, org.odpi.openmetadata.accessservices.subjectarea.utils.QueryParams queryParams)
      Issue a GET REST call that returns a response found objects using the information described in findRequest, specifying the maximum amount that the downstream server supports.
      <T> GenericResponse<T> findRESTCall​(java.lang.String userId, java.lang.String methodName, java.lang.String urnTemplate, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, org.odpi.openmetadata.accessservices.subjectarea.utils.QueryParams queryParams, java.lang.Integer maximumPageSizeOnRestCall)
      Issue a GET REST call that returns a response found objects using the information described in findRequest, specifying the maximum amount that the downstream server supports.
      <T> GenericResponse<T> getByIdRESTCall​(java.lang.String userId, java.lang.String guid, java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, java.lang.String urnTemplate)
      Issue a GET REST call that returns a response object by guid.
      <T> GenericResponse<T> getByIdRESTCall​(java.lang.String userId, java.lang.String guid, java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, java.lang.String urnTemplate, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest)
      Issue a GET REST call that returns a response object by guid.
      <T> GenericResponse<T> getByIdRESTCall​(java.lang.String userId, java.lang.String guid, java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, java.lang.String urnTemplate, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, java.lang.Integer maximumPageSizeOnRestCall, org.odpi.openmetadata.accessservices.subjectarea.utils.QueryParams queryParams)
      Issue a GET REST call that returns a response object by guid.
      java.lang.String getServerName()  
      java.lang.String getServerPlatformURLRoot()  
      <T> GenericResponse<T> postRESTCall​(java.lang.String userId, java.lang.String methodName, java.lang.String urnTemplate, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, T requestBody)
      Issue a POST REST call that returns a response object.
      <T> GenericResponse<T> putRESTCall​(java.lang.String userId, java.lang.String guid, java.lang.String methodName, java.lang.String urnTemplate, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, T requestBody)
      Issue a PUT REST call that returns a response object.
      <T> GenericResponse<T> restoreRESTCall​(java.lang.String userId, java.lang.String guid, java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type, java.lang.String urnTemplate)
      Issue a restore object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • postRESTCall

        public <T> GenericResponse<T> postRESTCall​(java.lang.String userId,
                                                   java.lang.String methodName,
                                                   java.lang.String urnTemplate,
                                                   org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type,
                                                   T requestBody)
                                            throws PropertyServerException,
                                                   UserNotAuthorizedException,
                                                   InvalidParameterException
        Issue a POST REST call that returns a response object. This is typically a create, update, or find with complex parameters.
        Type Parameters:
        T - return type for results in GenericResponse
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        methodName - name of the method being called.
        type - class of the response for generic object. Descried using ParameterizedTypeReference An example can be seen here ResponseParameterization.getParameterizedType()
        urnTemplate - template of the URN for the REST API call with place-holders for the parameters.
        requestBody - request body for the request.
        Returns:
        GenericResponse with T result
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
        UserNotAuthorizedException - the requesting user is not authorized to issue this request.
        InvalidParameterException - one of the parameters is null or invalid
      • putRESTCall

        public <T> GenericResponse<T> putRESTCall​(java.lang.String userId,
                                                  java.lang.String guid,
                                                  java.lang.String methodName,
                                                  java.lang.String urnTemplate,
                                                  org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type,
                                                  T requestBody)
                                           throws InvalidParameterException,
                                                  PropertyServerException,
                                                  UserNotAuthorizedException
        Issue a PUT REST call that returns a response object. This is typically an update.
        Type Parameters:
        T - return type for results in GenericResponse
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - unique identifier of the update object
        methodName - name of the method being called.
        type - class of the response for generic object. Descried using ParameterizedTypeReference An example can be seen here ResponseParameterization.getParameterizedType()
        urnTemplate - template of the URN for the REST API call with place-holders for the parameters.
        requestBody - request body for the request.
        Returns:
        GenericResponse with T result
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
        UserNotAuthorizedException - the requesting user is not authorized to issue this request.
        InvalidParameterException - one of the parameters is null or invalid
      • getByIdRESTCall

        public <T> GenericResponse<T> getByIdRESTCall​(java.lang.String userId,
                                                      java.lang.String guid,
                                                      java.lang.String methodName,
                                                      org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type,
                                                      java.lang.String urnTemplate)
                                               throws InvalidParameterException,
                                                      PropertyServerException,
                                                      UserNotAuthorizedException
        Issue a GET REST call that returns a response object by guid. This is a get for a single object.
        Type Parameters:
        T - return type for results in GenericResponse
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - unique identifier of the received object
        methodName - name of the method being called.
        type - class of the response for generic object. Descried using ParameterizedTypeReference An example can be seen here ResponseParameterization.getParameterizedType()
        urnTemplate - template of the URN for the REST API call with place-holders for the parameters.
        Returns:
        GenericResponse with T result
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
        UserNotAuthorizedException - the requesting user is not authorized to issue this request.
        InvalidParameterException - one of the parameters is null or invalid
      • getByIdRESTCall

        public <T> GenericResponse<T> getByIdRESTCall​(java.lang.String userId,
                                                      java.lang.String guid,
                                                      java.lang.String methodName,
                                                      org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type,
                                                      java.lang.String urnTemplate,
                                                      org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest)
                                               throws InvalidParameterException,
                                                      PropertyServerException,
                                                      UserNotAuthorizedException
        Issue a GET REST call that returns a response object by guid.
        Type Parameters:
        T - return type for results in GenericResponse
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - unique identifier of the received object
        methodName - name of the method being called.
        type - class of the response for generic object. Descried using ParameterizedTypeReference An example can be seen here ResponseParameterization.getParameterizedType()
        urnTemplate - template of the URN for the REST API call with place-holders for the parameters.
        findRequest - search specification
        Returns:
        GenericResponse with T result
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
        UserNotAuthorizedException - the requesting user is not authorized to issue this request.
        InvalidParameterException - one of the parameters is null or invalid
      • getByIdRESTCall

        public <T> GenericResponse<T> getByIdRESTCall​(java.lang.String userId,
                                                      java.lang.String guid,
                                                      java.lang.String methodName,
                                                      org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type,
                                                      java.lang.String urnTemplate,
                                                      org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest,
                                                      java.lang.Integer maximumPageSizeOnRestCall,
                                                      org.odpi.openmetadata.accessservices.subjectarea.utils.QueryParams queryParams)
                                               throws InvalidParameterException,
                                                      PropertyServerException,
                                                      UserNotAuthorizedException
        Issue a GET REST call that returns a response object by guid.
        Type Parameters:
        T - return type for results in GenericResponse
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - unique identifier of the received object
        methodName - name of the method being called.
        type - class of the response for generic object. Descried using ParameterizedTypeReference An example can be seen here ResponseParameterization.getParameterizedType()
        urnTemplate - template of the URN for the REST API call with place-holders for the parameters.
        maximumPageSizeOnRestCall - maximum page size that can be used on rest calls, null and 0 mean no limit set.
        findRequest - search specification
        queryParams - QueryParams
        Returns:
        GenericResponse with T result
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
        UserNotAuthorizedException - the requesting user is not authorized to issue this request.
        InvalidParameterException - one of the parameters is null or invalid
      • findRESTCall

        public <T> GenericResponse<T> findRESTCall​(java.lang.String userId,
                                                   java.lang.String methodName,
                                                   java.lang.String urnTemplate,
                                                   org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type,
                                                   org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest,
                                                   org.odpi.openmetadata.accessservices.subjectarea.utils.QueryParams queryParams)
                                            throws InvalidParameterException,
                                                   PropertyServerException,
                                                   UserNotAuthorizedException
        Issue a GET REST call that returns a response found objects using the information described in findRequest, specifying the maximum amount that the downstream server supports.
        Type Parameters:
        T - return type for results in GenericResponse
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        methodName - name of the method being called.
        urnTemplate - template of the URN for the REST API call with place-holders for the parameters.
        type - class of the response for generic object. Descried using ParameterizedTypeReference An example can be seen here ResponseParameterization.getParameterizedType()
        findRequest - FindRequest
        queryParams - QueryParams
        Returns:
        GenericResponse with T results
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
        UserNotAuthorizedException - the requesting user is not authorized to issue this request.
        InvalidParameterException - one of the parameters is null or invalid
      • findRESTCall

        public <T> GenericResponse<T> findRESTCall​(java.lang.String userId,
                                                   java.lang.String methodName,
                                                   java.lang.String urnTemplate,
                                                   org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type,
                                                   org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest,
                                                   org.odpi.openmetadata.accessservices.subjectarea.utils.QueryParams queryParams,
                                                   java.lang.Integer maximumPageSizeOnRestCall)
                                            throws InvalidParameterException,
                                                   PropertyServerException,
                                                   UserNotAuthorizedException
        Issue a GET REST call that returns a response found objects using the information described in findRequest, specifying the maximum amount that the downstream server supports.
        Type Parameters:
        T - return type for results in GenericResponse
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        methodName - name of the method being called.
        urnTemplate - template of the URN for the REST API call with place-holders for the parameters.
        type - class of the response for generic object. Descried using ParameterizedTypeReference An example can be seen here ResponseParameterization.getParameterizedType()
        findRequest - FindRequest
        maximumPageSizeOnRestCall - maximum page size that can be used on rest calls, null and 0 mean no limit set.
        queryParams - QueryParams
        Returns:
        GenericResponse with T results
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
        UserNotAuthorizedException - the requesting user is not authorized to issue this request.
        InvalidParameterException - one of the parameters is null or invalid
      • findRESTCall

        public <T> GenericResponse<T> findRESTCall​(java.lang.String userId,
                                                   java.lang.String guid,
                                                   java.lang.String methodName,
                                                   java.lang.String urnTemplate,
                                                   org.springframework.core.ParameterizedTypeReference<GenericResponse<T>> type,
                                                   org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest,
                                                   java.lang.Integer maximumPageSizeOnRestCall)
                                            throws InvalidParameterException,
                                                   PropertyServerException,
                                                   UserNotAuthorizedException
        Issue a GET REST call that returns a response found objects using the information described in findRequest
        Type Parameters:
        T - return type for results in GenericResponse
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - unique identifier of the object to which the found objects should relate
        methodName - name of the method being called.
        urnTemplate - template of the URN for the REST API call with place-holders for the parameters.
        type - class of the response for generic object. Descried using ParameterizedTypeReference An example can be seen here ResponseParameterization.getParameterizedType()
        findRequest - FindRequest
        maximumPageSizeOnRestCall - maximum number of results
        Returns:
        GenericResponse with T results
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
        UserNotAuthorizedException - the requesting user is not authorized to issue this request.
        InvalidParameterException - one of the parameters is null or invalid
      • createFindQuery

        public org.odpi.openmetadata.accessservices.subjectarea.utils.QueryBuilder createFindQuery​(java.lang.String methodName,
                                                                                                   org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest)
                                                                                            throws InvalidParameterException
        Method for constructing a query (https://en.wikipedia.org/wiki/Query_string) using the information described in the findRequest page size and startingFrom need to set by the caller.
        Parameters:
        methodName - name of the method being called.
        findRequest - FindRequest
        Returns:
        query
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
      • createFindQuery

        public org.odpi.openmetadata.accessservices.subjectarea.utils.QueryBuilder createFindQuery​(java.lang.String methodName,
                                                                                                   org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest,
                                                                                                   org.odpi.openmetadata.accessservices.subjectarea.utils.QueryParams queryParams)
                                                                                            throws InvalidParameterException
        Method for constructing a query (https://en.wikipedia.org/wiki/Query_string) using the information described in the findRequest page size and startingFrom need to set by the caller.
        Parameters:
        methodName - name of the method being called.
        findRequest - FindRequest
        queryParams - QueryParams
        Returns:
        query
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
      • getServerName

        public java.lang.String getServerName()
      • getServerPlatformURLRoot

        public java.lang.String getServerPlatformURLRoot()