Package com.adaptris.core.http.client
Class ExactMatch
- java.lang.Object
-
- com.adaptris.core.http.client.StatusEvaluatorImpl
-
- com.adaptris.core.http.client.ExactMatch
-
- All Implemented Interfaces:
StatusEvaluator
public class ExactMatch extends StatusEvaluatorImpl
Implementation ofStatusEvaluator
for use withBranchingHttpRequestService
.Matches a service id against an exact http response code. e.g. statusCode=200 to match
HTTP OK
. It's an exact match; you probably don't want to use it, as you'll have to specify one for202 Accepted
, one for201 Created
etc. even though they're all would logically point to the same success ervice id.In the adapter configuration file this class is aliased as http-status-exact-match which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.http.client.StatusEvaluatorImpl
log
-
-
Constructor Summary
Constructors Constructor Description ExactMatch()
ExactMatch(int code, java.lang.String serviceId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getStatusCode()
boolean
matches(int responseCode)
Do we match the http statusvoid
setStatusCode(int s)
-
Methods inherited from class com.adaptris.core.http.client.StatusEvaluatorImpl
getServiceId, serviceId, setServiceId
-
-
-
-
Method Detail
-
matches
public boolean matches(int responseCode)
Description copied from interface:StatusEvaluator
Do we match the http status- Parameters:
responseCode
- the HTTP server response code (e.g. 500)- Returns:
- true/false.
-
getStatusCode
public int getStatusCode()
- Returns:
- the responseCode
-
setStatusCode
public void setStatusCode(int s)
- Parameters:
s
- the responseCode to set
-
-