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
SectionSourceto handle HTTP routing.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpRouteSectionSource.InterceptionObtains the interception details.static classHttpRouteSectionSource.RedirectRedirect.static classHttpRouteSectionSource.RouteInputRoute 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.StringNOT_FOUND_INPUT_NAMEName ofSectionInputfor not found resource.static java.lang.StringUNHANDLED_OUTPUT_NAMEName ofSectionOutputfor 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.RedirectaddRedirect(boolean isSecure, HttpRouteSectionSource.RouteInput routeInput, java.lang.Class<?> parameterType)Adds aHttpRouteSectionSource.Redirect.HttpRouteSectionSource.RouteInputaddRoute(boolean isSecure, HttpMethod method, java.lang.String path)Adds a route.HttpRouteSectionSource.InterceptiongetInterception()Obtains theHttpRouteSectionSource.Interception.booleanisPathParameters(java.lang.String path)Indicates if the path contains parameters.protected voidloadSpecification(AbstractSectionSource.SpecificationContext context)Loads theSectionSourceSpecification.voidsetHttpEscalationHandler(HttpEscalationHandler escalationHandler)Specifies theHttpEscalationHandlervoidsourceSection(SectionDesigner designer, SectionSourceContext context)Sources theOfficeSectionby 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 ofSectionOutputfor unhandledHttpRequest.- See Also:
- Constant Field Values
-
NOT_FOUND_INPUT_NAME
public static final java.lang.String NOT_FOUND_INPUT_NAME
Name ofSectionInputfor 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:
trueshould 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.RouteInputfor 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.RouteInputto redirect to.parameterType- Type of parameter passed to the redirectManagedFunctionto 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:AbstractSectionSourceLoads theSectionSourceSpecification.- Specified by:
loadSpecificationin classAbstractSectionSource- Parameters:
context-AbstractSectionSource.SpecificationContext.
-
sourceSection
public void sourceSection(SectionDesigner designer, SectionSourceContext context) throws java.lang.Exception
Description copied from interface:SectionSourceSources theOfficeSectionby constructing it via the inputSectionDesigner.- Parameters:
designer-SectionDesignerto construct the structure of theOfficeSection.context-SectionSourceContextto source details to construct theOfficeSection.- Throws:
java.lang.Exception- If fails to construct theOfficeSection.
-
-