Package org.forgerock.http.handler
Class Handlers
java.lang.Object
org.forgerock.http.handler.Handlers
Utility methods for creating common types of handlers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DescribableHandler
asDescribableHandler
(Handler handler) Adapts aHandler
to aDescribableHandler
without adding support for API Descriptions if it is not already implemented.static DescribableHandler
Creates aHandler
which wraps the provided filters around the provided target handler.static DescribableHandler
Creates aHandler
which wraps the provided filters around the provided target handler.static DescribableHandler
Creates a "filtered handler" instance.static Handler
A common HTTP FrameworkHandler
responding 403 Forbidden.static Handler
A common HTTP FrameworkHandler
responding 500 Internal Server Error.
-
Method Details
-
filtered
Creates a "filtered handler" instance.It will invoke the
first
filter, giving it thehandler
handler asnext
.- Parameters:
handler
- The filtered instancefilter
- the filter to apply- Returns:
- a new
Handler
instance that filters the givenhandler
.
-
chainOf
Creates aHandler
which wraps the provided filters around the provided target handler.- Parameters:
handler
- The target handler which will be invoked once processing has reached the end of the filter chain.filters
- The list of filters to be processed before invoking the target.- Returns:
- A
Handler
. - See Also:
-
chainOf
Creates aHandler
which wraps the provided filters around the provided target handler.- Parameters:
handler
- The target handler which will be invoked once processing has reached the end of the filter chain.filters
- The list of filters to be processed before invoking the target.- Returns:
- A
Handler
. - See Also:
-
asDescribableHandler
Adapts aHandler
to aDescribableHandler
without adding support for API Descriptions if it is not already implemented.- Parameters:
handler
- The handler.- Returns:
- The describable handler.
-
internalServerErrorHandler
A common HTTP FrameworkHandler
responding 500 Internal Server Error.- Parameters:
cause
- The cause of the internal server error.- Returns:
- The handler.
-
forbiddenHandler
A common HTTP FrameworkHandler
responding 403 Forbidden.- Returns:
- The handler.
-