Package net.officefloor.web
Class HttpRouteSectionSource
- java.lang.Object
-
- net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
-
- net.officefloor.web.HttpRouteSectionSource
-
- All Implemented Interfaces:
SectionSource
@PrivateSource public class HttpRouteSectionSource extends AbstractSectionSource
SectionSource
to handle HTTP routing.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpRouteSectionSource.Interception
Obtains the interception details.static class
HttpRouteSectionSource.Redirect
Redirect.static class
HttpRouteSectionSource.RouteInput
Route input information.-
Nested classes/interfaces inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
AbstractSectionSource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NOT_FOUND_INPUT_NAME
Name ofSectionInput
for not found resource.static java.lang.String
UNHANDLED_OUTPUT_NAME
Name ofSectionOutput
for unhandledHttpRequest
.
-
Constructor Summary
Constructors Constructor Description HttpRouteSectionSource(java.lang.String contextPath)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRouteSectionSource.Redirect
addRedirect(boolean isSecure, HttpRouteSectionSource.RouteInput routeInput, java.lang.Class<?> parameterType)
Adds aHttpRouteSectionSource.Redirect
.HttpRouteSectionSource.RouteInput
addRoute(boolean isSecure, HttpMethod method, java.lang.String path)
Adds a route.HttpRouteSectionSource.Interception
getInterception()
Obtains theHttpRouteSectionSource.Interception
.boolean
isPathParameters(java.lang.String path)
Indicates if the path contains parameters.protected void
loadSpecification(AbstractSectionSource.SpecificationContext context)
Loads theSectionSourceSpecification
.void
setHttpEscalationHandler(HttpEscalationHandler escalationHandler)
Specifies theHttpEscalationHandler
void
sourceSection(SectionDesigner designer, SectionSourceContext context)
Sources theOfficeSection
by constructing it via the inputSectionDesigner
.-
Methods inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
getSpecification
-
-
-
-
Field Detail
-
UNHANDLED_OUTPUT_NAME
public static final java.lang.String UNHANDLED_OUTPUT_NAME
Name ofSectionOutput
for unhandledHttpRequest
.- See Also:
- Constant Field Values
-
NOT_FOUND_INPUT_NAME
public static final java.lang.String NOT_FOUND_INPUT_NAME
Name ofSectionInput
for not found resource.- See Also:
- Constant Field Values
-
-
Method Detail
-
setHttpEscalationHandler
public void setHttpEscalationHandler(HttpEscalationHandler escalationHandler)
Specifies theHttpEscalationHandler
- Parameters:
escalationHandler
-HttpEscalationHandler
. May benull
.
-
getInterception
public HttpRouteSectionSource.Interception getInterception()
Obtains theHttpRouteSectionSource.Interception
.- Returns:
HttpRouteSectionSource.Interception
.
-
isPathParameters
public boolean isPathParameters(java.lang.String path)
Indicates if the path contains parameters.- Parameters:
path
- Path.- Returns:
true
should the path contain parameters.
-
addRoute
public HttpRouteSectionSource.RouteInput addRoute(boolean isSecure, HttpMethod method, java.lang.String path)
Adds a route.- Parameters:
isSecure
- Indicates if a secure connection is required for the route.method
-HttpMethod
.path
- Route path.- Returns:
HttpRouteSectionSource.RouteInput
for the route.
-
addRedirect
public HttpRouteSectionSource.Redirect addRedirect(boolean isSecure, HttpRouteSectionSource.RouteInput routeInput, java.lang.Class<?> parameterType) throws java.lang.Exception
Adds aHttpRouteSectionSource.Redirect
.- Parameters:
isSecure
- Indicates to redirect to a secure port.routeInput
-HttpRouteSectionSource.RouteInput
to redirect to.parameterType
- Type of parameter passed to the redirectManagedFunction
to source values for constructing the path. May benull
.- Returns:
HttpRouteSectionSource.Redirect
.- Throws:
java.lang.Exception
- If fails to add the redirect.
-
loadSpecification
protected void loadSpecification(AbstractSectionSource.SpecificationContext context)
Description copied from class:AbstractSectionSource
Loads theSectionSourceSpecification
.- Specified by:
loadSpecification
in classAbstractSectionSource
- Parameters:
context
-AbstractSectionSource.SpecificationContext
.
-
sourceSection
public void sourceSection(SectionDesigner designer, SectionSourceContext context) throws java.lang.Exception
Description copied from interface:SectionSource
Sources theOfficeSection
by constructing it via the inputSectionDesigner
.- Parameters:
designer
-SectionDesigner
to construct the structure of theOfficeSection
.context
-SectionSourceContext
to source details to construct theOfficeSection
.- Throws:
java.lang.Exception
- If fails to construct theOfficeSection
.
-
-