Package com.adaptris.core.http.server
Class RawStatusProvider
- java.lang.Object
-
- com.adaptris.core.http.server.RawStatusProvider
-
- All Implemented Interfaces:
HttpStatusProvider
public class RawStatusProvider extends java.lang.Object implements HttpStatusProvider
Static implementation ofHttpStatusProvider
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.adaptris.core.http.server.HttpStatusProvider
HttpStatusProvider.HttpStatus, HttpStatusProvider.Status
-
-
Constructor Summary
Constructors Constructor Description RawStatusProvider()
RawStatusProvider(int status)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getStatus
public HttpStatusProvider.Status getStatus(AdaptrisMessage msg)
Description copied from interface:HttpStatusProvider
Get the method that should be used with the HTTP request.- Specified by:
getStatus
in interfaceHttpStatusProvider
- Parameters:
msg
- theAdaptrisMessage
if required to derive the method.- Returns:
- the
HttpStatusProvider.Status
.
-
getCode
public int getCode()
-
setCode
public void setCode(int status)
Set the HTTP Status to use.- Parameters:
status
- the status, which defaults to 500
-
getText
public java.lang.String getText()
-
setText
public void setText(java.lang.String txt)
Set the optional response text that will be sent with the response code.Note that for
StandardResponseProducer
any values configured here will be ignored as that will useHttpServletResponse.setStatus(int)
method only. This field is included only for completeness, a sensible default will be made available based on theHttpStatusProvider.HttpStatus
selected.- Parameters:
txt
- the text to be sent (e.g.OK
, if the status code is 200).
-
-