| org.restlet.Filter com.noelios.restlet.StatusFilter
All known Subclasses: com.noelios.restlet.component.ComponentStatusFilter, com.noelios.restlet.application.ApplicationStatusFilter,
StatusFilter | public class StatusFilter extends Filter (Code) | | Filter associating a response entity based on the status. In order to
customize the default representation, just subclass this class and override
the "getRepresentation" method. If any exception occurs during the call
handling, a "server internal error" status is automatically associated to the
call. Of course, you can personalize the representation of this error. Also,
if no status is set (null), then the "success ok" status is assumed.
See Also: Tutorial: Displaying
* error pages author: Jerome Louvel (contact@noelios.com) |
Method Summary | |
public void | afterHandle(Request request, Response response) Allows filtering after its handling by the target Restlet. | public void | doHandle(Request request, Response response) Handles the call by distributing it to the next Restlet. | public Representation | getRepresentation(Status status, Request request, Response response) Returns a representation for the given status. In order to
customize the default representation, this method can be overriden.
Parameters: status - The status to represent. Parameters: request - The request handled. Parameters: response - The response updated. | public Status | getStatus(Throwable throwable, Request request, Response response) Returns a status for a given exception or error. |
StatusFilter | public StatusFilter(Context context, boolean overwrite, String email, String homeUri)(Code) | | Constructor.
Parameters: context - The context. Parameters: overwrite - Indicates whether an existing representation should beoverwritten. Parameters: email - Email address of the administrator to contact in case oferror. Parameters: homeUri - The home URI to propose in case of error. |
afterHandle | public void afterHandle(Request request, Response response)(Code) | | Allows filtering after its handling by the target Restlet. Does nothing
by default.
Parameters: request - The request to handle. Parameters: response - The response to update. |
doHandle | public void doHandle(Request request, Response response)(Code) | | Handles the call by distributing it to the next Restlet.
Parameters: request - The request to handle. Parameters: response - The response to update. |
getRepresentation | public Representation getRepresentation(Status status, Request request, Response response)(Code) | | Returns a representation for the given status. In order to
customize the default representation, this method can be overriden.
Parameters: status - The status to represent. Parameters: request - The request handled. Parameters: response - The response updated. The representation of the given status. |
getStatus | public Status getStatus(Throwable throwable, Request request, Response response)(Code) | | Returns a status for a given exception or error. By default it returns an
Status.SERVER_ERROR_INTERNAL status and logs a severe message.
In order to customize the default behavior, this method can be overriden.
Parameters: throwable - The exception or error caught. Parameters: request - The request handled. Parameters: response - The response updated. The representation of the given status. |
|
|