public class RawStatusProvider extends java.lang.Object implements HttpStatusProvider
HttpStatusProvider
that allows a numeric status code.In the adapter configuration file this class is aliased as http-raw-status which is the preferred alternative to the fully qualified classname when building your configuration.
HttpStatusProvider.HttpStatus, HttpStatusProvider.Status
Constructor and Description |
---|
RawStatusProvider() |
RawStatusProvider(int status) |
Modifier and Type | Method and Description |
---|---|
int |
getCode() |
HttpStatusProvider.Status |
getStatus(AdaptrisMessage msg)
Get the method that should be used with the HTTP request.
|
java.lang.String |
getText() |
void |
setCode(int status)
Set the HTTP Status to use.
|
void |
setText(java.lang.String txt)
Set the optional response text that will be sent with the response code.
|
public RawStatusProvider()
public RawStatusProvider(int status)
public HttpStatusProvider.Status getStatus(AdaptrisMessage msg)
HttpStatusProvider
getStatus
in interface HttpStatusProvider
msg
- the AdaptrisMessage
if required to derive the method.HttpStatusProvider.Status
.public int getCode()
public void setCode(int status)
status
- the status, which defaults to 500public java.lang.String getText()
public void setText(java.lang.String txt)
Note that for StandardResponseProducer
any values configured here will be ignored as that
will use HttpServletResponse.setStatus(int)
method only. This field is included only for
completeness, a sensible default will be made available based on the HttpStatusProvider.HttpStatus
selected.
txt
- the text to be sent (e.g. OK
, if the status code is 200).