Interface RestProvider

All Known Implementing Classes:
AbstractRestProvider, RestProviderImpl

public interface RestProvider
  • Method Details

    • call

      <REQ, RES> RestResponse<RES> call(String method, String urlTemplate, REQ request, Class<RES> responseType, Map<String,String> queryParams) throws RestException
      Helper method for performing REST requests with optional REST parameter map.

      This method has a long list of parameters. It is only intended for internal use.

      Type Parameters:
      REQ - type of the request entity
      RES - type of the responseType entity
      Parameters:
      method - the HTTP method to be used, i.e. GET, PUT, POST.
      urlTemplate - the REST URL urlTemplate.
      request - optional: The request body to be sent to the server. May be null.
      responseType - optional: expected response type. In case no responseType body is expected, responseType may be null.
      queryParams - optional: The REST query parameters values. May be null.
      Returns:
      the responseType entity received from the server, or null if responseType is null.
      Throws:
      RestException
    • authenticate

      RestProvider authenticate(String username, String password)
      Parameters:
      username - username used for authentication
      password - password used for authentication
      Returns:
      authenticated RESTful provider
    • authenticate

      RestProvider authenticate(String token)
      Parameters:
      token - token used for authentication
      Returns:
      authenticated RESTful provider
    • authenticate

      RestProvider authenticate(Authentication authentication)
      Parameters:
      authentication - Authentication object
      Returns:
      authenticated RESTful provider
    • configure

      void configure(RestProvider.Configuration configuration)
      Parameters:
      configuration - RestProvider.Configuration configuration to use for the provider