Class AsyncRequestWrapperImpl.AsyncResponseWrapperImpl

java.lang.Object
org.apache.olingo.client.core.communication.request.AsyncRequestWrapperImpl.AsyncResponseWrapperImpl
All Implemented Interfaces:
AsyncResponseWrapper<R>
Direct Known Subclasses:
AsyncBatchRequestWrapperImpl.AsyncResponseWrapperImpl
Enclosing class:
AsyncRequestWrapperImpl<R extends ODataResponse>

public class AsyncRequestWrapperImpl.AsyncResponseWrapperImpl extends Object implements AsyncResponseWrapper<R>
  • Field Details

    • location

      protected URI location
    • response

      protected R extends ODataResponse response
    • retryAfter

      protected int retryAfter
    • preferenceApplied

      protected boolean preferenceApplied
  • Constructor Details

    • AsyncResponseWrapperImpl

      public AsyncResponseWrapperImpl()
    • AsyncResponseWrapperImpl

      public AsyncResponseWrapperImpl(org.apache.http.HttpResponse res)
      Constructor.
      Parameters:
      res - HTTP response.
  • Method Details

    • isPreferenceApplied

      public boolean isPreferenceApplied()
      Description copied from interface: AsyncResponseWrapper
      Checks for preference applied.
      Specified by:
      isPreferenceApplied in interface AsyncResponseWrapper<R extends ODataResponse>
      Returns:
      'TRUE' if respond-async preference has been applied; 'FALSE' otherwise.
    • isDone

      public boolean isDone()
      Description copied from interface: AsyncResponseWrapper
      Checks if asynchronous processing has been terminated.
      Specified by:
      isDone in interface AsyncResponseWrapper<R extends ODataResponse>
      Returns:
      'TRUE' the process has been terminated; 'FALSE' otherwise.
    • getODataResponse

      public R getODataResponse()
      Description copied from interface: AsyncResponseWrapper
      Gets the real response.
      If asynchronous processing has been terminated then the response will be returned immediately. This method retries after a delay, specified by the 'Retry-After' header indicating the time, in seconds, the client should wait before retry. If there isn't any 'Retry-After' response header available, a default of 5 seconds will be chosen. The query will be retried for a maximum of five times.
      Specified by:
      getODataResponse in interface AsyncResponseWrapper<R extends ODataResponse>
      Returns:
      real OData response.
    • delete

      public ODataDeleteResponse delete()
      Description copied from interface: AsyncResponseWrapper
      DeleteA DELETE request sent to the status monitor resource requests that the asynchronous processing be canceled. A 200 OK or to a 204 No Content response indicates that the asynchronous processing has been successfully canceled.
      Specified by:
      delete in interface AsyncResponseWrapper<R extends ODataResponse>
      Returns:
      OData delete response.
    • asyncDelete

      Description copied from interface: AsyncResponseWrapper
      A client can request that the DELETE should be executed asynchronously. A 202 Accepted response indicates that the cancellation is being processed asynchronously; the client can use the returned Location header (which MUST be different from the status monitor resource of the initial request) to query for the status of the cancellation. If a delete request is not supported by the service, the service returns 405 Method Not Allowed.
      Specified by:
      asyncDelete in interface AsyncResponseWrapper<R extends ODataResponse>
      Returns:
      OData delete response.
    • forceNextMonitorCheck

      public AsyncResponseWrapper<R> forceNextMonitorCheck(URI uri)
      Description copied from interface: AsyncResponseWrapper
      Specifies the location for the next monitor check.
      Overrides the location value retrieved among headers and nullifies the previous valid response (if exists).
      Specified by:
      forceNextMonitorCheck in interface AsyncResponseWrapper<R extends ODataResponse>
      Parameters:
      uri - monitor location.
      Returns:
      the current async response wrapper.