Class FFDCRESTClientBase

  • Direct Known Subclasses:
    FFDCRESTClient

    public class FFDCRESTClientBase
    extends java.lang.Object
    RESTClient is responsible for issuing calls to the OMAS REST APIs.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected FFDCRESTClientBase​(java.lang.String serverName, java.lang.String serverPlatformURLRoot)
      Constructor for no authentication.
      protected FFDCRESTClientBase​(java.lang.String serverName, java.lang.String serverPlatformURLRoot, java.lang.String userId, java.lang.String password)
      Constructor for simple userId and password authentication.
      protected FFDCRESTClientBase​(java.lang.String serverName, java.lang.String serverPlatformURLRoot, java.lang.String userId, java.lang.String password, AuditLog auditLog)
      Constructor for simple userId and password authentication with audit log.
      protected FFDCRESTClientBase​(java.lang.String serverName, java.lang.String serverPlatformURLRoot, AuditLog auditLog)
      Constructor for no authentication with audit log.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected <T> T callDeleteRESTCall​(java.lang.String methodName, java.lang.Class<T> returnClass, java.lang.String urlTemplate, java.lang.Object requestBody, java.lang.Object... params)
      Issue a Delete REST call that returns a response object.
      protected <T> T callDeleteRESTCall​(java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, java.lang.String urlTemplate, java.lang.Object... params)
      Issue a Delete REST call that returns a response object.
      protected <T> T callGetRESTCall​(java.lang.String methodName, java.lang.Class<T> returnClass, java.lang.String urlTemplate, java.lang.Object... params)
      Issue a GET REST call that returns a response object.
      protected <T> T callGetRESTCall​(java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, java.lang.String urlTemplate, java.lang.Object... params)
      Issue a GET REST call that returns a response object.
      protected <T> T callGetRESTCallNoParams​(java.lang.String methodName, java.lang.Class<T> returnClass, java.lang.String urlTemplate)
      Issue a GET REST call that returns a response object.
      protected <T> T callPostRESTCall​(java.lang.String methodName, java.lang.Class<T> returnClass, java.lang.String urlTemplate, java.lang.Object requestBody, java.lang.Object... params)
      Issue a POST REST call that returns a response object.
      protected <T> T callPostRESTCall​(java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, java.lang.String urlTemplate, java.lang.Object requestBody, java.lang.Object... params)
      Issue a POST REST call that returns a response object.
      <T> T callPostRESTCallNoParams​(java.lang.String methodName, java.lang.Class<T> returnClass, java.lang.String urlTemplate, java.lang.Object requestBody)
      Issue a POST REST call that returns a response object.
      protected <T> T callPutRESTCall​(java.lang.String methodName, java.lang.Class<T> returnClass, java.lang.String urlTemplate, java.lang.Object requestBody, java.lang.Object... params)
      Issue a PUT REST call that returns a response object.
      protected <T> T callPutRESTCall​(java.lang.String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, java.lang.String urlTemplate, java.lang.Object requestBody, java.lang.Object... params)
      Issue a PUT REST call that returns a response object.
      • Methods inherited from class java.lang.Object

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

      • serverName

        protected java.lang.String serverName
      • serverPlatformURLRoot

        protected java.lang.String serverPlatformURLRoot
    • Constructor Detail

      • FFDCRESTClientBase

        protected FFDCRESTClientBase​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot,
                                     AuditLog auditLog)
                              throws InvalidParameterException
        Constructor for no authentication with audit log.
        Parameters:
        serverName - name of the OMAG Server to call
        serverPlatformURLRoot - URL root of the server platform where the OMAG Server is running.
        auditLog - destination for log messages.
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
      • FFDCRESTClientBase

        protected FFDCRESTClientBase​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot)
                              throws InvalidParameterException
        Constructor for no authentication.
        Parameters:
        serverName - name of the OMAG Server to call
        serverPlatformURLRoot - URL root of the server platform where the OMAG Server is running.
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
      • FFDCRESTClientBase

        protected FFDCRESTClientBase​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot,
                                     java.lang.String userId,
                                     java.lang.String password,
                                     AuditLog auditLog)
                              throws InvalidParameterException
        Constructor for simple userId and password authentication with audit log.
        Parameters:
        serverName - name of the OMAG Server to call
        serverPlatformURLRoot - URL root of the server platform where the OMAG Server is running.
        userId - user id for the HTTP request
        password - password for the HTTP request
        auditLog - destination for log messages.
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
      • FFDCRESTClientBase

        protected FFDCRESTClientBase​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot,
                                     java.lang.String userId,
                                     java.lang.String password)
                              throws InvalidParameterException
        Constructor for simple userId and password authentication.
        Parameters:
        serverName - name of the OMAG Server to call
        serverPlatformURLRoot - URL root of the server platform where the OMAG Server is running.
        userId - user id for the HTTP request
        password - password for the HTTP request
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
    • Method Detail

      • callGetRESTCallNoParams

        protected <T> T callGetRESTCallNoParams​(java.lang.String methodName,
                                                java.lang.Class<T> returnClass,
                                                java.lang.String urlTemplate)
                                         throws PropertyServerException
        Issue a GET REST call that returns a response object.
        Type Parameters:
        T - return type
        Parameters:
        methodName - name of the method being called.
        returnClass - class of the response object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callGetRESTCall

        protected <T> T callGetRESTCall​(java.lang.String methodName,
                                        java.lang.Class<T> returnClass,
                                        java.lang.String urlTemplate,
                                        java.lang.Object... params)
                                 throws PropertyServerException
        Issue a GET REST call that returns a response object.
        Type Parameters:
        T - return type
        Parameters:
        methodName - name of the method being called.
        returnClass - class of the response object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        params - a list of parameters that are slotted into the url template.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callGetRESTCall

        protected <T> T callGetRESTCall​(java.lang.String methodName,
                                        org.springframework.core.ParameterizedTypeReference<T> responseType,
                                        java.lang.String urlTemplate,
                                        java.lang.Object... params)
                                 throws PropertyServerException
        Issue a GET REST call that returns a response object. It's working only with SpringRESTClientConnector
        Type Parameters:
        T - return type
        Parameters:
        methodName - name of the method being called.
        responseType - class of the response object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        params - a list of parameters that are slotted into the url template.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callPostRESTCallNoParams

        public <T> T callPostRESTCallNoParams​(java.lang.String methodName,
                                              java.lang.Class<T> returnClass,
                                              java.lang.String urlTemplate,
                                              java.lang.Object requestBody)
                                       throws PropertyServerException
        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
        Parameters:
        methodName - name of the method being called.
        returnClass - class of the response object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        requestBody - request body for the request.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callPostRESTCall

        protected <T> T callPostRESTCall​(java.lang.String methodName,
                                         java.lang.Class<T> returnClass,
                                         java.lang.String urlTemplate,
                                         java.lang.Object requestBody,
                                         java.lang.Object... params)
                                  throws PropertyServerException
        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
        Parameters:
        methodName - name of the method being called.
        returnClass - class of the response object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        requestBody - request body for the request.
        params - a list of parameters that are slotted into the url template.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callPostRESTCall

        protected <T> T callPostRESTCall​(java.lang.String methodName,
                                         org.springframework.core.ParameterizedTypeReference<T> responseType,
                                         java.lang.String urlTemplate,
                                         java.lang.Object requestBody,
                                         java.lang.Object... params)
                                  throws PropertyServerException
        Issue a POST REST call that returns a response object. This is typically a create, update, or find with complex parameters. It's working only with SpringRESTClientConnector
        Type Parameters:
        T - return type
        Parameters:
        methodName - name of the method being called.
        responseType - class of the response for generic object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        requestBody - request body for the request.
        params - a list of parameters that are slotted into the url template.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callPutRESTCall

        protected <T> T callPutRESTCall​(java.lang.String methodName,
                                        java.lang.Class<T> returnClass,
                                        java.lang.String urlTemplate,
                                        java.lang.Object requestBody,
                                        java.lang.Object... params)
                                 throws PropertyServerException
        Issue a PUT REST call that returns a response object. This is typically an update.
        Type Parameters:
        T - return type
        Parameters:
        methodName - name of the method being called.
        returnClass - class of the response object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        requestBody - request body for the request.
        params - a list of parameters that are slotted into the url template.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callPutRESTCall

        protected <T> T callPutRESTCall​(java.lang.String methodName,
                                        org.springframework.core.ParameterizedTypeReference<T> responseType,
                                        java.lang.String urlTemplate,
                                        java.lang.Object requestBody,
                                        java.lang.Object... params)
                                 throws PropertyServerException
        Issue a PUT REST call that returns a response object. This is typically an update. It's working only with SpringRESTClientConnector
        Type Parameters:
        T - return type
        Parameters:
        methodName - name of the method being called.
        responseType - class of the response for generic object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        requestBody - request body for the request.
        params - a list of parameters that are slotted into the url template.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callDeleteRESTCall

        protected <T> T callDeleteRESTCall​(java.lang.String methodName,
                                           java.lang.Class<T> returnClass,
                                           java.lang.String urlTemplate,
                                           java.lang.Object requestBody,
                                           java.lang.Object... params)
                                    throws PropertyServerException
        Issue a Delete REST call that returns a response object.
        Type Parameters:
        T - return type
        Parameters:
        methodName - name of the method being called.
        returnClass - class of the response object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        requestBody - body of request
        params - a list of parameters that are slotted into the url template.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.
      • callDeleteRESTCall

        protected <T> T callDeleteRESTCall​(java.lang.String methodName,
                                           org.springframework.core.ParameterizedTypeReference<T> responseType,
                                           java.lang.String urlTemplate,
                                           java.lang.Object... params)
                                    throws PropertyServerException
        Issue a Delete REST call that returns a response object.
        Type Parameters:
        T - return type
        Parameters:
        methodName - name of the method being called.
        responseType - class of the response for generic object.
        urlTemplate - template of the URL for the REST API call with place-holders for the parameters.
        params - a list of parameters that are slotted into the url template.
        Returns:
        response object
        Throws:
        PropertyServerException - something went wrong with the REST call stack.