Package org.attribyte.api.http
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 TypeMethodDescriptionvoidinit(String prefix, Properties props, org.attribyte.api.Logger logger) Initializes the client.Sends a request with default options.send(Request request, RequestOptions options) Sends a request with specified options.voidshutdown()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
Sends a request with default options.- Parameters:
request- The request.- Returns:
- The response.
- Throws:
IOException- on I/O error.
-
send
Sends a request with specified options.- Parameters:
request- The request.options- The request options.- Returns:
- The response.
- Throws:
IOException- on I/O error.
-
shutdown
Releases resources, interrupts threads, etc. Called when application using the client is terminated.- Throws:
Exception- on shutdown exception.
-