Class SpringRESTClientConnector

java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.restclients.RESTClientConnector
org.odpi.openmetadata.adapters.connectors.restclients.spring.SpringRESTClientConnector
All Implemented Interfaces:
org.odpi.openmetadata.adapters.connectors.restclients.RESTClientCalls

public class SpringRESTClientConnector extends org.odpi.openmetadata.adapters.connectors.restclients.RESTClientConnector
RESTClient is responsible for issuing calls to the server's REST APIs. It is supported through a connector because there are often changes in this integration, and it saves maintenance work if all Egeria clients use this connector.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

    org.odpi.openmetadata.frameworks.connectors.ConnectorBase.ProtectedConnection
  • Field Summary

    Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

    connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, securedProperties
  • Constructor Summary

    Constructors
    Constructor
    Description
    This constructor is work in progress as part of the upgrade of Egeria to use security.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    callDeleteRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params)
    Issue a DELETE REST call that returns a response object.
    <T> T
    callDeleteRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params)
    Issue a DELETE REST call that returns a response object.
    <T> T
    callDeleteRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody)
    Issue a DELETE REST call that returns a response object.
    <T> T
    callGetRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object... params)
    Issue a GET REST call that returns a response object.
    <T> T
    callGetRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object... params)
    Issue a GET REST call that returns a response object.
    <T> T
    callGetRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate)
    Issue a GET REST call that returns a response object.
    <T> T
    callPostRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params)
    Issue a POST REST call that returns a response object.
    <T> T
    callPostRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params)
    Issue a POST REST call that returns a response object.
    <T> T
    callPostRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody)
    Issue a POST REST call that returns a response object.
    <T> T
    callPutRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params)
    Issue a PUT REST call that returns a response object.
    <T> T
    callPutRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params)
    Issue a PUT REST call that returns a response object.
    void
    initialize(String connectorInstanceId, org.odpi.openmetadata.frameworks.connectors.properties.ConnectionProperties connectionProperties)
    Initialize the connector.

    Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

    disconnect, equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initializeConnectedAssetProperties, isActive, start, toString

    Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector

    clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • initialize

      public void initialize(String connectorInstanceId, org.odpi.openmetadata.frameworks.connectors.properties.ConnectionProperties connectionProperties)
      Initialize the connector.
      Overrides:
      initialize in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Parameters:
      connectorInstanceId - - unique id for the connector instance - useful for messages etc
      connectionProperties - - POJO for the configuration used to create the connector.
    • callGetRESTCallNoParams

      public <T> T callGetRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a GET REST call that returns a response object.
      Type Parameters:
      T - type of the return object
      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:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callGetRESTCall

      public <T> T callGetRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object... params) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a GET REST call that returns a response object.
      Type Parameters:
      T - type of the return object
      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:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callPostRESTCallNoParams

      public <T> T callPostRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a POST REST call that returns a response object. This is typically a create, update, or find with complex parameters.
      Type Parameters:
      T - type of the return object
      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:
      Object
      Throws:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callPostRESTCall

      public <T> T callPostRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a POST REST call that returns a response object. This is typically a create, update, or find with complex parameters.
      Type Parameters:
      T - type of the return object
      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:
      Object
      Throws:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callPutRESTCall

      public <T> T callPutRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a PUT REST call that returns a response object. This is typically an update.
      Type Parameters:
      T - type of the return object
      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:
      Object
      Throws:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callDeleteRESTCallNoParams

      public <T> T callDeleteRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a DELETE REST call that returns a response object.
      Type Parameters:
      T - type of the return object
      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:
      Object
      Throws:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callDeleteRESTCall

      public <T> T callDeleteRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a DELETE REST call that returns a response object.
      Type Parameters:
      T - type of the return object
      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:
      Object
      Throws:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callPostRESTCall

      public <T> T callPostRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a POST REST call that returns a response object. This is typically a create, update, or find with complex parameters.
      Type Parameters:
      T - type of the return object
      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:
      Object
      Throws:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callGetRESTCall

      public <T> T callGetRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object... params) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a GET REST call that returns a response object.
      Type Parameters:
      T - type of the return object
      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:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callDeleteRESTCall

      public <T> T callDeleteRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a DELETE REST call that returns a response object.
      Type Parameters:
      T - type of the return object
      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:
      Object
      Throws:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.
    • callPutRESTCall

      public <T> T callPutRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params) throws org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException
      Issue a PUT REST call that returns a response object. This is typically an update.
      Type Parameters:
      T - type of the return object
      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:
      Object
      Throws:
      org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions.RESTServerException - something went wrong with the REST call stack.