Class BaseRestDriver<U extends UserIdentityModel,​G extends GroupIdentityModel>

java.lang.Object
com.exclamationlabs.connid.base.connector.driver.rest.BaseRestDriver<U,​G>
All Implemented Interfaces:
Driver<U,​G>

public abstract class BaseRestDriver<U extends UserIdentityModel,​G extends GroupIdentityModel>
extends Object
implements Driver<U,​G>
Abstract class for drivers that need to make calls to RESTful web services to manage user and group information.
  • Field Details

  • Constructor Details

  • Method Details

    • initialize

      public void initialize​(BaseConnectorConfiguration config, Authenticator auth) throws org.identityconnectors.framework.common.exceptions.ConnectorException
      Description copied from interface: Driver
      Receives the configuration and authenticator objects that may be needed by the driver. In this method, any additional initialization that needs to be done to prep the Driver for repeated usage should also be done.
      Specified by:
      initialize in interface Driver<U extends UserIdentityModel,​G extends GroupIdentityModel>
      Parameters:
      config - Reference to Configuration object so that this driver has access to configuration properties and the access token.
      auth - Reference to the Authenticator object in case this Driver needs to make a call to reauthenticate (often because of a timeout or token expiration condition).
      Throws:
      org.identityconnectors.framework.common.exceptions.ConnectorException - If a problem occurred that prevented Driver from completing it's initialization.
    • getFaultProcessor

      protected abstract RestFaultProcessor getFaultProcessor()
      Return the fault processor that will be used to analyze and respond to HTTP error responses.
    • createClient

      protected org.apache.http.client.HttpClient createClient()
      Normal HTTP Client. If need arises for a secure HTTPS Client backed by a cert/keystore, etc. such as with FIS, a separate utility class should be added to possibly provide that support (look at FIS codebase for an example).
    • usesBearerAuthorization

      protected boolean usesBearerAuthorization()
      Override this and return true if the RESTful services you are calling require Authorization: Bearer [token] in the HTTP header. If true, this header will be added to all requests, with the token coming from value stored in ConnectorConfiguration getCredentialAccessToken().
    • usesTokenAuthorization

      protected boolean usesTokenAuthorization()
      Override this and return true if the RESTful services you are calling require Authorization: Token token=[token] in the HTTP header. If true, this header will be added to all requests, with the token coming from value stored in ConnectorConfiguration getCredentialAccessToken().
    • getBaseServiceUrl

      protected abstract String getBaseServiceUrl()
      This method should return the base Service URL for RESTful endpoints that this driver invokes. If not used and full URL needs to be fully reconstructed for every different RESTful API call, have this method return empty string (not null).
      Returns:
      Empty string or String containing a beginning portion of the RESTful URL that will need to be invoked
    • executeRequest

      public <T> T executeRequest​(org.apache.http.client.methods.HttpRequestBase request, Class<T> returnType)
    • executeRequest

      public <T> T executeRequest​(org.apache.http.client.methods.HttpRequestBase request, Class<T> returnType, boolean isRetry)
    • executeGetRequest

      protected <T> T executeGetRequest​(String restUri, Class<T> expectedResponseType)
    • executePostRequest

      protected <T> T executePostRequest​(String restUri, Class<T> expectedResponseType, Object requestBody)
    • executePutRequest

      protected <T> T executePutRequest​(String restUri, Class<T> expectedResponseType, Object requestBody)
    • executePatchRequest

      protected <T> T executePatchRequest​(String restUri, Class<T> expectedResponseType, Object requestBody)
    • executeDeleteRequest

      protected <T> T executeDeleteRequest​(String restUri, Class<T> expectedResponseType)
    • executeDeleteRequest

      protected <T> T executeDeleteRequest​(String restUri, Class<T> expectedResponseType, Object requestBody)
    • executeGetRequest

      protected <T> T executeGetRequest​(String restUri, Class<T> expectedResponseType, Map<String,​String> additionalHeaders)
    • executePostRequest

      protected <T> T executePostRequest​(String restUri, Class<T> expectedResponseType, Object requestBody, Map<String,​String> additionalHeaders)
    • executePutRequest

      protected <T> T executePutRequest​(String restUri, Class<T> expectedResponseType, Object requestBody, Map<String,​String> additionalHeaders)
    • executePatchRequest

      protected <T> T executePatchRequest​(String restUri, Class<T> expectedResponseType, Object requestBody, Map<String,​String> additionalHeaders)
    • executeDeleteRequest

      protected <T> T executeDeleteRequest​(String restUri, Class<T> expectedResponseType, Map<String,​String> additionalHeaders)
    • executeDeleteRequest

      protected <T> T executeDeleteRequest​(String restUri, Class<T> expectedResponseType, Object requestBody, Map<String,​String> additionalHeaders)