@ComponentProfile(summary="Make a HTTP request to a remote server using standard JRE components", tag="service,http,https,branching", branchSelector=true, metadata="adphttpresponse") public class BranchingHttpRequestService extends HttpRequestServiceImpl
This service allows you to branch based on the HTTP status code
returned by the web server. Use a specific
StatusEvaluator
to determine the appropriate value for AdaptrisMessage.setNextServiceId(String)
. It differs from
wrapping HttpRequestService
with a BranchingServiceEnabler
as it allows you more fine-grained control based on
HTTP status codes.
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
.
In the adapter configuration file this class is aliased as branching-http-request-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
BranchingHttpRequestService() |
BranchingHttpRequestService(java.lang.String url) |
Modifier and Type | Method and Description |
---|---|
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.String |
getDefaultServiceId() |
java.util.List<StatusEvaluator> |
getStatusMatches() |
boolean |
isBranching()
Returns true if the implementation supports branching.
|
void |
setDefaultServiceId(java.lang.String s) |
void |
setStatusMatches(java.util.List<StatusEvaluator> matchers) |
BranchingHttpRequestService |
withDefaultServiceId(java.lang.String s) |
BranchingHttpRequestService |
withStatusMatches(java.util.List<StatusEvaluator> matchers) |
BranchingHttpRequestService |
withStatusMatches(StatusEvaluator... matchers) |
buildProducer, closeService, getAuthenticator, getContentType, getMethod, getRequestHeaderProvider, getResponseHeaderHandler, getUrl, initService, prepare, setAuthenticator, setContentType, setMethod, setRequestHeaderProvider, setResponseHeaderHandler, setUrl, withAuthenticator, withContentType, withMethod, withRequestHeaderProvider, withResponseHeaderHandler, withUrl
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public BranchingHttpRequestService()
public BranchingHttpRequestService(java.lang.String url)
public boolean isBranching()
Service
Returns true if the implementation supports branching.
isBranching
in interface Service
isBranching
in class ServiceImp
BranchingServiceCollection
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
spublic java.util.List<StatusEvaluator> getStatusMatches()
public void setStatusMatches(java.util.List<StatusEvaluator> matchers)
matchers
- the statusMatches to setpublic BranchingHttpRequestService withStatusMatches(java.util.List<StatusEvaluator> matchers)
public BranchingHttpRequestService withStatusMatches(StatusEvaluator... matchers)
public java.lang.String getDefaultServiceId()
public void setDefaultServiceId(java.lang.String s)
s
- the defaultServiceId to setpublic BranchingHttpRequestService withDefaultServiceId(java.lang.String s)