Package org.killbill.billing.client
Class KillBillHttpClient
- java.lang.Object
-
- org.killbill.billing.client.KillBillHttpClient
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class KillBillHttpClient extends Object implements Closeable
-
-
Field Summary
Fields Modifier and Type Field Description static StringACCEPT_HTMLstatic StringACCEPT_JSONstatic StringACCEPT_XMLstatic StringAUDIT_OPTION_COMMENTstatic StringAUDIT_OPTION_CREATED_BYstatic StringAUDIT_OPTION_REASONstatic StringCONTENT_TYPE_JSONstatic StringCONTENT_TYPE_XMLstatic StringCONTROL_PLUGIN_NAMEstatic Map<String,Collection<String>>DEFAULT_EMPTY_QUERYstatic intDEFAULT_HTTP_TIMEOUT_SECstatic StringHTTP_HEADER_ACCEPTstatic StringHTTP_HEADER_CONTENT_TYPEstatic StringRBAC_OPTION_PASSWORDstatic StringRBAC_OPTION_USERNAMEstatic StringTENANT_OPTION_API_KEYstatic StringTENANT_OPTION_API_SECRET
-
Constructor Summary
Constructors Constructor Description KillBillHttpClient()KillBillHttpClient(String kbServerUrl, String username, String password, String apiKey, String apiSecret)KillBillHttpClient(String kbServerUrl, String username, String password, String apiKey, String apiSecret, String proxyHost, Integer proxyPort)KillBillHttpClient(String kbServerUrl, String username, String password, String apiKey, String apiSecret, String proxyHost, Integer proxyPort, Integer connectTimeOut, Integer readTimeOut)KillBillHttpClient(String kbServerUrl, String username, String password, String apiKey, String apiSecret, String proxyHost, Integer proxyPort, Integer connectTimeOut, Integer readTimeOut, Boolean strictSSL, String SSLProtocol)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()<T> TdoDelete(String uri, Object body, Class<T> returnClass, RequestOptions requestOptions)<T> TdoDelete(String uri, Object body, Class<T> returnClass, RequestOptions requestOptions, int timeoutSec)HttpResponse<InputStream>doDelete(String uri, Object body, RequestOptions options)HttpResponse<InputStream>doDelete(String uri, RequestOptions requestOptions)HttpResponse<InputStream>doGet(String uri, OutputStream outputStream, RequestOptions requestOptions)<T> TdoGet(String uri, Class<T> returnClass, RequestOptions requestOptions)<T> TdoGet(String uri, Class<T> returnClass, RequestOptions requestOptions, int timeoutSec)HttpResponse<InputStream>doGet(String uri, RequestOptions requestOptions)HttpResponse<InputStream>doHead(String uri, RequestOptions requestOptions)HttpResponse<InputStream>doHead(String uri, RequestOptions requestOptions, int timeoutSec)HttpResponse<InputStream>doOptions(String uri, RequestOptions requestOptions)HttpResponse<InputStream>doOptions(String uri, RequestOptions requestOptions, int timeoutSec)<T> TdoPost(String uri, Object body, Class<T> returnClass, RequestOptions requestOptions)<T> TdoPost(String uri, Object body, Class<T> returnClass, RequestOptions requestOptions, int timeoutSec)HttpResponse<InputStream>doPost(String uri, Object body, RequestOptions requestOptions)<T> TdoPut(String uri, Object body, Class<T> returnClass, RequestOptions options)<T> TdoPut(String uri, Object body, Class<T> returnClass, RequestOptions options, int timeoutSec)HttpResponse<InputStream>doPut(String uri, Object body, RequestOptions options)
-
-
-
Field Detail
-
DEFAULT_HTTP_TIMEOUT_SEC
public static final int DEFAULT_HTTP_TIMEOUT_SEC
- See Also:
- Constant Field Values
-
DEFAULT_EMPTY_QUERY
public static final Map<String,Collection<String>> DEFAULT_EMPTY_QUERY
-
AUDIT_OPTION_CREATED_BY
public static final String AUDIT_OPTION_CREATED_BY
- See Also:
- Constant Field Values
-
AUDIT_OPTION_REASON
public static final String AUDIT_OPTION_REASON
- See Also:
- Constant Field Values
-
AUDIT_OPTION_COMMENT
public static final String AUDIT_OPTION_COMMENT
- See Also:
- Constant Field Values
-
TENANT_OPTION_API_KEY
public static final String TENANT_OPTION_API_KEY
- See Also:
- Constant Field Values
-
TENANT_OPTION_API_SECRET
public static final String TENANT_OPTION_API_SECRET
- See Also:
- Constant Field Values
-
RBAC_OPTION_USERNAME
public static final String RBAC_OPTION_USERNAME
- See Also:
- Constant Field Values
-
RBAC_OPTION_PASSWORD
public static final String RBAC_OPTION_PASSWORD
- See Also:
- Constant Field Values
-
CONTROL_PLUGIN_NAME
public static final String CONTROL_PLUGIN_NAME
- See Also:
- Constant Field Values
-
HTTP_HEADER_ACCEPT
public static final String HTTP_HEADER_ACCEPT
- See Also:
- Constant Field Values
-
HTTP_HEADER_CONTENT_TYPE
public static final String HTTP_HEADER_CONTENT_TYPE
- See Also:
- Constant Field Values
-
ACCEPT_HTML
public static final String ACCEPT_HTML
- See Also:
- Constant Field Values
-
ACCEPT_JSON
public static final String ACCEPT_JSON
- See Also:
- Constant Field Values
-
ACCEPT_XML
public static final String ACCEPT_XML
- See Also:
- Constant Field Values
-
CONTENT_TYPE_JSON
public static final String CONTENT_TYPE_JSON
- See Also:
- Constant Field Values
-
CONTENT_TYPE_XML
public static final String CONTENT_TYPE_XML
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KillBillHttpClient
public KillBillHttpClient(String kbServerUrl, String username, String password, String apiKey, String apiSecret, String proxyHost, Integer proxyPort, Integer connectTimeOut, Integer readTimeOut)
- Parameters:
kbServerUrl- Kill Bill urlusername- Kill Bill usernamepassword- Kill Bill passwordapiKey- Kill Bill api keyapiSecret- Kill Bill api secretproxyHost- hostname of a proxy server that the client should useproxyPort- port number of a proxy server that the client should useconnectTimeOut- connect timeout in millisecondsreadTimeOut- read timeout in milliseconds
-
KillBillHttpClient
public KillBillHttpClient(String kbServerUrl, String username, String password, String apiKey, String apiSecret, String proxyHost, Integer proxyPort, Integer connectTimeOut, Integer readTimeOut, Boolean strictSSL, String SSLProtocol)
- Parameters:
kbServerUrl- Kill Bill urlusername- Kill Bill usernamepassword- Kill Bill passwordapiKey- Kill Bill api keyapiSecret- Kill Bill api secretproxyHost- hostname of a proxy server that the client should useproxyPort- port number of a proxy server that the client should useconnectTimeOut- connect timeout in millisecondsreadTimeOut- read timeout in millisecondsstrictSSL- whether to bypass SSL certificates validationSSLProtocol- SSL protocol to use
-
KillBillHttpClient
public KillBillHttpClient(String kbServerUrl, String username, String password, String apiKey, String apiSecret)
-
KillBillHttpClient
public KillBillHttpClient(String kbServerUrl, String username, String password, String apiKey, String apiSecret, String proxyHost, Integer proxyPort)
-
KillBillHttpClient
public KillBillHttpClient()
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
doPost
public HttpResponse<InputStream> doPost(String uri, Object body, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doPost
public <T> T doPost(String uri, Object body, Class<T> returnClass, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doPost
public <T> T doPost(String uri, Object body, Class<T> returnClass, RequestOptions requestOptions, int timeoutSec) throws KillBillClientException
- Throws:
KillBillClientException
-
doPut
public HttpResponse<InputStream> doPut(String uri, Object body, RequestOptions options) throws KillBillClientException
- Throws:
KillBillClientException
-
doPut
public <T> T doPut(String uri, Object body, Class<T> returnClass, RequestOptions options) throws KillBillClientException
- Throws:
KillBillClientException
-
doPut
public <T> T doPut(String uri, Object body, Class<T> returnClass, RequestOptions options, int timeoutSec) throws KillBillClientException
- Throws:
KillBillClientException
-
doDelete
public HttpResponse<InputStream> doDelete(String uri, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doDelete
public HttpResponse<InputStream> doDelete(String uri, Object body, RequestOptions options) throws KillBillClientException
- Throws:
KillBillClientException
-
doDelete
public <T> T doDelete(String uri, Object body, Class<T> returnClass, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doDelete
public <T> T doDelete(String uri, Object body, Class<T> returnClass, RequestOptions requestOptions, int timeoutSec) throws KillBillClientException
- Throws:
KillBillClientException
-
doGet
public HttpResponse<InputStream> doGet(String uri, OutputStream outputStream, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doGet
public HttpResponse<InputStream> doGet(String uri, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doGet
public <T> T doGet(String uri, Class<T> returnClass, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doGet
public <T> T doGet(String uri, Class<T> returnClass, RequestOptions requestOptions, int timeoutSec) throws KillBillClientException
- Throws:
KillBillClientException
-
doHead
public HttpResponse<InputStream> doHead(String uri, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doHead
public HttpResponse<InputStream> doHead(String uri, RequestOptions requestOptions, int timeoutSec) throws KillBillClientException
- Throws:
KillBillClientException
-
doOptions
public HttpResponse<InputStream> doOptions(String uri, RequestOptions requestOptions) throws KillBillClientException
- Throws:
KillBillClientException
-
doOptions
public HttpResponse<InputStream> doOptions(String uri, RequestOptions requestOptions, int timeoutSec) throws KillBillClientException
- Throws:
KillBillClientException
-
-