Interface Client

All Known Subinterfaces:
AsyncClient
All Known Implementing Classes:
JdkClient, JettyClient

public interface Client
Defines the HTTP client interface.

Implementation must support concurrent use.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    init(String prefix, Properties props, org.attribyte.api.Logger logger)
    Initializes the client.
    send(Request request)
    Sends a request with default options.
    send(Request request, RequestOptions options)
    Sends a request with specified options.
    void
    Releases resources, interrupts threads, etc.
  • Method Details

    • init

      void init(String prefix, Properties props, org.attribyte.api.Logger logger) throws org.attribyte.api.InitializationException
      Initializes the client. Must be called before first use.
      Parameters:
      prefix - A prefix applied to all property names.
      props - A properties file.
      logger - A logger for messages.
      Throws:
      org.attribyte.api.InitializationException - on initialization error.
    • send

      Response send(Request request) throws IOException
      Sends a request with default options.
      Parameters:
      request - The request.
      Returns:
      The response.
      Throws:
      IOException - on I/O error.
    • send

      Response send(Request request, RequestOptions options) throws IOException
      Sends a request with specified options.
      Parameters:
      request - The request.
      options - The request options.
      Returns:
      The response.
      Throws:
      IOException - on I/O error.
    • shutdown

      void shutdown() throws Exception
      Releases resources, interrupts threads, etc. Called when application using the client is terminated.
      Throws:
      Exception - on shutdown exception.