Class OciRestApi

  • All Implemented Interfaces:
    RestApi

    @Deprecated(since="2.5.0",
                forRemoval=true)
    public class OciRestApi
    extends RestApiBase
    Deprecated, for removal: This API element is subject to removal in a future version.
    OCI SDK instead
    OCI specific REST API. This class uses HTTP Signatures to sign requests.
    • Method Detail

      • builder

        public static OciRestApi.Builder builder()
        Deprecated, for removal: This API element is subject to removal in a future version.
        A new builder to configure instances.
        Returns:
        a new builder
      • create

        public static OciRestApi create()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Create API with default configuration.
        Returns:
        a new REST API with default configuration
      • create

        public static OciRestApi create​(Config config)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Create OCI REST API from configuration.
        Parameters:
        config - configuration
        Returns:
        a new REST API configured from config
      • responseSupplier

        protected Supplier<Single<WebClientResponse>> responseSupplier​(Http.RequestMethod method,
                                                                       String path,
                                                                       ApiRequest<?> request,
                                                                       String requestId)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: RestApiBase
        Create a response supplier from the request. This method checks if there is a payload, and prepares the supplier based on this information.
        Overrides:
        responseSupplier in class RestApiBase
        Parameters:
        method - HTTP method to invoke
        path - path to invoke
        request - request that may contain a JSON entity
        requestId - request ID to use for this request
        Returns:
        supplier of response that is used with fault tolerance
      • requestBytesPayload

        protected Supplier<Single<WebClientResponse>> requestBytesPayload​(String path,
                                                                          ApiRequest<?> request,
                                                                          Http.RequestMethod method,
                                                                          String requestId,
                                                                          WebClientRequestBuilder requestBuilder,
                                                                          Flow.Publisher<DataChunk> publisher)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: RestApiBase
        Create a supplier for a response with publisher request. Defaults to "() -> clientRequest.submit(publisher)". Also configures content type and accept headers.
        Overrides:
        requestBytesPayload in class RestApiBase
        Parameters:
        path - path requested
        request - API request
        method - HTTP method
        requestId - ID of this request
        requestBuilder - WebClient request builder
        publisher - publisher to be used as request entity
        Returns:
        supplier of a web client response
      • readErrorFailedEntity

        protected Throwable readErrorFailedEntity​(String path,
                                                  ApiRequest<?> request,
                                                  Http.RequestMethod method,
                                                  String requestId,
                                                  WebClientResponse response,
                                                  Throwable it)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: RestApiBase
        Read error information when we failed to read resposen entity.
        Overrides:
        readErrorFailedEntity in class RestApiBase
        Parameters:
        path - requested path
        request - original request
        method - HTTP method
        requestId - ID of the request
        response - actual response where we do not expect an entity
        it - throwable that caused this problem (such as parsing exception)
        Returns:
        throwable to be used in response
      • readError

        protected Throwable readError​(String path,
                                      ApiRequest<?> request,
                                      Http.RequestMethod method,
                                      String requestId,
                                      WebClientResponse response)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: RestApiBase
        Read error with no entity (content length set to 0).
        Overrides:
        readError in class RestApiBase
        Parameters:
        path - requested path
        request - original API request
        method - HTTP method
        requestId - request ID
        response - web client response with entity consumed
        Returns:
        a throwable to be used in response
      • readError

        protected Throwable readError​(String path,
                                      ApiRequest<?> request,
                                      Http.RequestMethod method,
                                      String requestId,
                                      WebClientResponse response,
                                      String entity)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: RestApiBase
        Read error with an entity that failed to be parsed into a JSON object.
        Overrides:
        readError in class RestApiBase
        Parameters:
        path - requested path
        request - original API request
        method - HTTP method
        requestId - request ID
        response - web client response with entity consumed
        entity - entity as a string
        Returns:
        a throwable to be used in response
      • readError

        protected Throwable readError​(String path,
                                      ApiRequest<?> request,
                                      Http.RequestMethod method,
                                      String requestId,
                                      WebClientResponse response,
                                      JsonObject json)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: RestApiBase
        Read error with a JSON entity.
        Overrides:
        readError in class RestApiBase
        Parameters:
        path - requested path
        request - original API request
        method - HTTP method
        requestId - request ID
        response - web client response with entity consumed
        json - entity as a JSON object
        Returns:
        a throwable to be used in response
      • requestJsonPayload

        protected Supplier<Single<WebClientResponse>> requestJsonPayload​(String path,
                                                                         ApiRequest<?> request,
                                                                         Http.RequestMethod method,
                                                                         String requestId,
                                                                         WebClientRequestBuilder requestBuilder,
                                                                         JsonObject jsonObject)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: RestApiBase
        Create a supplier for a response with JSON request. Defaults to "() -> clientRequest.submit(jsonObject)". Also configures content type and accept headers.
        Overrides:
        requestJsonPayload in class RestApiBase
        Parameters:
        path - path requested
        request - API request
        method - HTTP method
        requestId - ID of this request
        requestBuilder - WebClient request builder
        jsonObject - JSON object that should be sent as a request entity
        Returns:
        supplier of a web client response