Interface Connection

All Superinterfaces:
AutoCloseable, Closeable, LoggingCapable, ObfuscationCapable
All Known Subinterfaces:
PooledConnection
All Known Implementing Classes:
DefaultConnection

public interface Connection extends Closeable, LoggingCapable, ObfuscationCapable
Represents a connection to the Online Payments platform server. Thread-safe.
  • Method Details

    • close

      void close() throws IOException
      Releases any system resources associated with this object. Should be called when this object is about to go out of scope.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • get

      <R> R get(URI uri, List<RequestHeader> requestHeaders, ResponseHandler<R> responseHandler)
      Send a GET request to the Online Payments platform.
      Parameters:
      uri - The URI to call, including any necessary query parameters.
      requestHeaders - An optional list of request headers.
      responseHandler - A handler for the response.
      Throws:
      CommunicationException - when an exception occurred communicating with the Online Payments platform
    • delete

      <R> R delete(URI uri, List<RequestHeader> requestHeaders, ResponseHandler<R> responseHandler)
      Send a DELETE request to the Online Payments platform.
      Parameters:
      uri - The URI to call, including any necessary query parameters.
      requestHeaders - An optional list of request headers.
      responseHandler - A handler for the response.
      Throws:
      CommunicationException - when an exception occurred communicating with the Online Payments platform
    • post

      <R> R post(URI uri, List<RequestHeader> requestHeaders, String body, ResponseHandler<R> responseHandler)
      Send a POST request to the Online Payments platform.
      Parameters:
      uri - The URI to call, including any necessary query parameters.
      requestHeaders - An optional list of request headers.
      body - The optional body to send.
      responseHandler - A handler for the response.
      Throws:
      CommunicationException - when an exception occurred communicating with the Online Payments platform
    • post

      <R> R post(URI uri, List<RequestHeader> requestHeaders, MultipartFormDataObject multipart, ResponseHandler<R> responseHandler)
      Send a multipart/form-data POST request to the Online Payments platform.

      The content type of the request will be be part of the given request header list. If the connection creates its own content type, it should be multipart.getContentType(). Otherwise, authentication failures will occur.

      Parameters:
      uri - The URI to call, including any necessary query parameters.
      requestHeaders - An optional list of request headers.
      multipart - The multipart/form-data request to send.
      responseHandler - A handler for the response.
      Throws:
      CommunicationException - when an exception occurred communicating with the Online Payments platform
    • put

      <R> R put(URI uri, List<RequestHeader> requestHeaders, String body, ResponseHandler<R> responseHandler)
      Send a PUT request to the Online Payments platform.
      Parameters:
      uri - The URI to call, including any necessary query parameters.
      requestHeaders - An optional list of request headers.
      body - The optional body to send.
      responseHandler - A handler for the response.
      Throws:
      CommunicationException - when an exception occurred communicating with the Online Payments platform
    • put

      <R> R put(URI uri, List<RequestHeader> requestHeaders, MultipartFormDataObject multipart, ResponseHandler<R> responseHandler)
      Send a multipart/form-data PUT request to the Online Payments platform.

      The content type of the request will be be part of the given request header list. If the connection creates its own content type, it should be multipart.getContentType(). Otherwise, authentication failures will occur.

      Parameters:
      uri - The URI to call, including any necessary query parameters.
      requestHeaders - An optional list of request headers.
      multipart - The multipart/form-data request to send.
      responseHandler - A handler for the response.
      Throws:
      CommunicationException - when an exception occurred communicating with the Online Payments platform