Interface UrlRequestJob


public interface UrlRequestJob
Represents the url request job for a URL request. Allows you to override the response data for the URL request.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    An identifier of the UrlRequestJob.
    static interface 
    The options needed to initialize UrlRequestJob.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Notifies the engine that all the response data chunks are written and the request should be completed.
    void
    Notifies the engine that an error occurred during writing the response data and the request should be failed.
    id()
    Returns the identifier of this URL request job.
    void
    write(byte[] data)
    Appends a chunk of the response data to the URL request.
  • Method Details

    • id

      Returns the identifier of this URL request job.
    • write

      void write(byte[] data)
      Appends a chunk of the response data to the URL request. This method may be called multiple times to append several chunks. When all the chunks are written either the complete() or fail() method must be called to indicate that the request is completed or failed.
      Parameters:
      data - the response data bytes
      Throws:
      ObjectClosedException - when the URL request is already completed or failed
    • complete

      void complete()
      Notifies the engine that all the response data chunks are written and the request should be completed.
      Throws:
      ObjectClosedException - when the URL request is already completed or failed
    • fail

      void fail()
      Notifies the engine that an error occurred during writing the response data and the request should be failed.
      Throws:
      ObjectClosedException - when the URL request is already completed or failed