Package com.onlinepayments.communication
Interface Connection
- All Superinterfaces:
AutoCloseable,Closeable,LoggingCapable,ObfuscationCapable
- All Known Subinterfaces:
PooledConnection
- All Known Implementing Classes:
DefaultConnection
Represents a connection to the Online Payments platform server. Thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases any system resources associated with this object.<R> Rdelete(URI uri, List<RequestHeader> requestHeaders, ResponseHandler<R> responseHandler) Send a DELETE request to the Online Payments platform.<R> Rget(URI uri, List<RequestHeader> requestHeaders, ResponseHandler<R> responseHandler) Send a GET request to the Online Payments platform.<R> Rpost(URI uri, List<RequestHeader> requestHeaders, MultipartFormDataObject multipart, ResponseHandler<R> responseHandler) Send a multipart/form-data POST request to the Online Payments platform.<R> Rpost(URI uri, List<RequestHeader> requestHeaders, String body, ResponseHandler<R> responseHandler) Send a POST request to the Online Payments platform.<R> Rput(URI uri, List<RequestHeader> requestHeaders, MultipartFormDataObject multipart, ResponseHandler<R> responseHandler) Send a multipart/form-data PUT request to the Online Payments platform.<R> Rput(URI uri, List<RequestHeader> requestHeaders, String body, ResponseHandler<R> responseHandler) Send a PUT request to the Online Payments platform.Methods inherited from interface com.onlinepayments.logging.LoggingCapable
disableLogging, enableLoggingMethods inherited from interface com.onlinepayments.logging.ObfuscationCapable
setBodyObfuscator, setHeaderObfuscator
-
Method Details
-
close
Releases any system resources associated with this object. Should be called when this object is about to go out of scope.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
get
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
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
-