public class DelegatedStatusService extends StatusService
DebugRepresentation
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DEBUG_HEADER
The default debug header.
|
static String |
PASSTHROUGH_ATTRIBUTE
Response attribute to signify to upstream instances that the status has
already been handled for a
Response . |
Constructor and Description |
---|
DelegatedStatusService()
Constructor without support for source code viewing.
|
DelegatedStatusService(String sourceCodeUri)
Constructor using default debug header.
|
DelegatedStatusService(String sourceCodeUri,
String debugHeader)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
capture(int statusCode,
String application,
String internalUriTemplate)
Captures (internally redirects) a status code to a URI within an
application.
|
protected Representation |
createDebugRepresentation(Status status,
Request request,
Response response)
Create a debug representation for a conversation.
|
ConcurrentMap<Integer,Restlet> |
getHandlers()
A map of status codes to target restlets.
|
boolean |
isDebugging()
Whether we should show debugging information on errors.
|
boolean |
isFallback()
Whether we are a fallback status service.
|
void |
removeHandler(int status)
Removes the handler for a status code.
|
void |
setDebugging(boolean isDebugging)
Whether we should show debugging information on errors.
|
void |
setFallback(boolean isFallback)
Whether we are a fallback status service.
|
void |
setHandler(int statusCode,
Restlet errorHandler)
Sets the handler for a status code.
|
Representation |
toRepresentation(Status status,
Request request,
Response response) |
createInboundFilter, getConnegService, getContactEmail, getConverterService, getHomeRef, getMetadataService, getRepresentation, getStatus, getStatus, isOverwriting, setConnegService, setContactEmail, setConverterService, setHomeRef, setMetadataService, setOverwriting, toRepresentation, toStatus, toStatus
createOutboundFilter, getContext, isEnabled, isStarted, isStopped, setContext, setEnabled, start, stop
public static final String PASSTHROUGH_ATTRIBUTE
Response
.public static final String DEFAULT_DEBUG_HEADER
public DelegatedStatusService(String sourceCodeUri)
sourceCodeUri
- The source code viewer URI or nullpublic DelegatedStatusService(String sourceCodeUri, String debugHeader)
sourceCodeUri
- The source code viewer URI or nulldebugHeader
- The debug header or nullpublic DelegatedStatusService()
public ConcurrentMap<Integer,Restlet> getHandlers()
public boolean isDebugging()
setDebugging(boolean)
public void setDebugging(boolean isDebugging)
isDebugging
- True if debuggingisDebugging()
public boolean isFallback()
setFallback(boolean)
public void setFallback(boolean isFallback)
isFallback
- True if we are a fallback status serviceisFallback()
public void setHandler(int statusCode, Restlet errorHandler)
statusCode
- The status codeerrorHandler
- The error handlerpublic void capture(int statusCode, String application, String internalUriTemplate)
This is handled via a CapturingRedirector
with mode
Redirector.MODE_SERVER_OUTBOUND
.
statusCode
- The status codeapplication
- The internal application name, or null to use current applicationinternalUriTemplate
- The internal URI template to which we will redirectpublic void removeHandler(int status)
status
- The status codepublic Representation toRepresentation(Status status, Request request, Response response)
toRepresentation
in class StatusService
protected Representation createDebugRepresentation(Status status, Request request, Response response)
Override this to install a custom implementation.
status
- The statusrequest
- The requestresponse
- The responseCopyright © 2009-2016 Three Crickets LLC.