Class HttpCaller
- java.lang.Object
-
- org.bardframework.commons.web.utils.HttpCaller
-
public class HttpCaller extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected StringbodyTemplateprotected intconnectTimeoutSecondsprotected booleandisableprotected Map<String,String>headersprotected StringhttpMethodprotected org.slf4j.LoggerLOGGERprotected booleanlogResponseprotected intreadTimeoutSecondsprotected StringurlTemplate
-
Constructor Summary
Constructors Constructor Description HttpCaller(String httpMethod, String urlTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpCallResultcall(Map<String,String> args)HttpCallResultcall(Map<String,String> headers, Map<String,String> args)call with custom headersStringgetBodyTemplate()intgetConnectTimeoutSeconds()Map<String,String>getHeaders()StringgetHttpMethod()intgetReadTimeoutSeconds()StringgetUrlTemplate()booleanisDisable()booleanisLogResponse()voidsetBodyTemplate(String bodyTemplate)voidsetConnectTimeoutSeconds(int connectTimeoutSeconds)voidsetDisable(boolean disable)voidsetHeaders(Map<String,String> headers)voidsetLogResponse(boolean logResponse)voidsetReadTimeoutSeconds(int readTimeoutSeconds)
-
-
-
Field Detail
-
LOGGER
protected final org.slf4j.Logger LOGGER
-
httpMethod
protected final String httpMethod
-
urlTemplate
protected final String urlTemplate
-
bodyTemplate
protected String bodyTemplate
-
connectTimeoutSeconds
protected int connectTimeoutSeconds
-
readTimeoutSeconds
protected int readTimeoutSeconds
-
logResponse
protected boolean logResponse
-
disable
protected boolean disable
-
-
Method Detail
-
call
public HttpCallResult call(Map<String,String> args) throws IOException
- Throws:
IOException
-
call
public HttpCallResult call(Map<String,String> headers, Map<String,String> args) throws IOException
call with custom headers- Throws:
IOException
-
getHttpMethod
public String getHttpMethod()
-
getUrlTemplate
public String getUrlTemplate()
-
getBodyTemplate
public String getBodyTemplate()
-
setBodyTemplate
public void setBodyTemplate(String bodyTemplate)
-
getConnectTimeoutSeconds
public int getConnectTimeoutSeconds()
-
setConnectTimeoutSeconds
public void setConnectTimeoutSeconds(int connectTimeoutSeconds)
-
getReadTimeoutSeconds
public int getReadTimeoutSeconds()
-
setReadTimeoutSeconds
public void setReadTimeoutSeconds(int readTimeoutSeconds)
-
isLogResponse
public boolean isLogResponse()
-
setLogResponse
public void setLogResponse(boolean logResponse)
-
isDisable
public boolean isDisable()
-
setDisable
public void setDisable(boolean disable)
-
-