public abstract class HttpRequestServiceImpl extends ServiceImp
StandaloneProducer
or StandaloneRequestor
.
Note that this service just wraps a StandardHttpProducer
instance but doesn't expose all the possible settings available
for the normal StandardHttpProducer
. If you need those features, than continue using the producer wrapped as a
StandaloneProducer
or StandaloneRequestor
.
String parameters in this service will use the InterlokMessage.resolve(String)
which allows you to specify metadata
values as part of a constant string e.g. setUrl("%message{http_url}")
will use the metadata value associated with the key
http_url
.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
HttpRequestServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected StandardHttpProducer |
buildProducer(AdaptrisMessage msg) |
protected void |
closeService() |
HttpAuthenticator |
getAuthenticator() |
java.lang.String |
getContentType() |
java.lang.String |
getMethod() |
RequestHeaderProvider<java.net.HttpURLConnection> |
getRequestHeaderProvider() |
ResponseHeaderHandler<java.net.HttpURLConnection> |
getResponseHeaderHandler() |
java.lang.String |
getUrl() |
protected void |
initService() |
void |
prepare()
Prepare for initialisation.
|
void |
setAuthenticator(HttpAuthenticator auth) |
void |
setContentType(java.lang.String ct) |
void |
setMethod(java.lang.String m) |
void |
setRequestHeaderProvider(RequestHeaderProvider<java.net.HttpURLConnection> handler)
Specify how we want to generate the initial set of HTTP Headers.
|
void |
setResponseHeaderHandler(ResponseHeaderHandler<java.net.HttpURLConnection> handler)
Specify how we handle headers from the HTTP response.
|
void |
setUrl(java.lang.String s) |
<T extends HttpRequestServiceImpl> |
withAuthenticator(HttpAuthenticator auth) |
<T extends HttpRequestServiceImpl> |
withContentType(java.lang.String s) |
<T extends HttpRequestServiceImpl> |
withMethod(java.lang.String s) |
<T extends HttpRequestServiceImpl> |
withRequestHeaderProvider(RequestHeaderProvider<java.net.HttpURLConnection> s) |
<T extends HttpRequestServiceImpl> |
withResponseHeaderHandler(ResponseHeaderHandler<java.net.HttpURLConnection> s) |
<T extends HttpRequestServiceImpl> |
withUrl(java.lang.String s) |
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public void prepare() throws CoreException
ComponentLifecycleExtension
CoreException
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
protected StandardHttpProducer buildProducer(AdaptrisMessage msg)
public ResponseHeaderHandler<java.net.HttpURLConnection> getResponseHeaderHandler()
public void setResponseHeaderHandler(ResponseHeaderHandler<java.net.HttpURLConnection> handler)
handler
- the handler, default is a DiscardResponseHeaders
.public <T extends HttpRequestServiceImpl> T withResponseHeaderHandler(ResponseHeaderHandler<java.net.HttpURLConnection> s)
public RequestHeaderProvider<java.net.HttpURLConnection> getRequestHeaderProvider()
public void setRequestHeaderProvider(RequestHeaderProvider<java.net.HttpURLConnection> handler)
handler
- the handler, default is a NoRequestHeaders
public <T extends HttpRequestServiceImpl> T withRequestHeaderProvider(RequestHeaderProvider<java.net.HttpURLConnection> s)
public java.lang.String getUrl()
public void setUrl(java.lang.String s)
s
- the url to set; can be of the form %message{key1}
to use the metadata value associated with key1
public <T extends HttpRequestServiceImpl> T withUrl(java.lang.String s)
public java.lang.String getContentType()
public void setContentType(java.lang.String ct)
ct
- the contentType to set; can be of the form %message{key1}
to use the metadata value associated with
key1
public <T extends HttpRequestServiceImpl> T withContentType(java.lang.String s)
public java.lang.String getMethod()
public void setMethod(java.lang.String m)
m
- the method to set; can be of the form %message{key1}
to use the metadata value associated with
key1
public <T extends HttpRequestServiceImpl> T withMethod(java.lang.String s)
public HttpAuthenticator getAuthenticator()
public void setAuthenticator(HttpAuthenticator auth)
auth
- the authenticator to setpublic <T extends HttpRequestServiceImpl> T withAuthenticator(HttpAuthenticator auth)