Class WebArchitectEmployer
- java.lang.Object
-
- net.officefloor.web.WebArchitectEmployer
-
- All Implemented Interfaces:
WebArchitect
public class WebArchitectEmployer extends java.lang.Object implements WebArchitect
WebArchitectimplementation.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_CONTEXT_PATHName ofPropertyspecifying the context path.-
Fields inherited from interface net.officefloor.web.build.WebArchitect
HANDLER_INPUT_NAME, HANDLER_SECTION_NAME
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OfficeManagedObjectaddHttpApplicationObject(java.lang.Class<?> objectClass)Adds an object to be lazily created and stored within theHttpApplicationState.OfficeManagedObjectaddHttpApplicationObject(java.lang.Class<?> objectClass, java.lang.String bindName)Adds an object to be lazily created and stored within theHttpApplicationState.OfficeManagedObjectaddHttpArgument(java.lang.String parameterName, HttpValueLocation location)Adds a HTTP argument.voidaddHttpInputExplorer(HttpInputExplorer explorer)Adds aHttpInputExplorer.OfficeManagedObjectaddHttpObject(java.lang.Class<?> objectClass, java.lang.String... acceptedContentTypes)Adds a HTTPObjectto be parsed from theHttpRequest.voidaddHttpObjectAnnotationAlias(java.lang.Class<?> httpObjectAnnotationAliasClass, java.lang.String... acceptedContentTypes)Adds anotherClassas an alias for theHttpObjectannotation.voidaddHttpObjectParser(HttpObjectParserFactory objectParserFactory)Manually adds aHttpObjectParserFactory.voidaddHttpObjectResponder(HttpObjectResponderFactory objectResponderFactory)Adds aHttpObjectResponderFactory.OfficeManagedObjectaddHttpRequestObject(java.lang.Class<?> objectClass, boolean isLoadParameters)Adds an object to be lazily created and stored within theHttpRequestState.OfficeManagedObjectaddHttpRequestObject(java.lang.Class<?> objectClass, boolean isLoadParameters, java.lang.String bindName)Adds an object to be lazily created and stored within theHttpRequestState.OfficeManagedObjectaddHttpSessionObject(java.lang.Class<?> objectClass)Adds an object to be lazily created and stored within theHttpSession.OfficeManagedObjectaddHttpSessionObject(java.lang.Class<?> objectClass, java.lang.String bindName)Adds an object to be lazily created and stored within theHttpSession.voidchainServicer(OfficeFlowSinkNode flowSinkNode, OfficeFlowSourceNode notHandledOutput)Chains aOfficeSectionInputto the end of the servicing chain to handle aHttpRequest.<H> AcceptNegotiatorBuilder<H>createAcceptNegotiator()Creates theAcceptNegotiatorBuilderto build anAcceptNegotiator.static WebArchitectemployWebArchitect(java.lang.String contextPath, OfficeArchitect officeArchitect, OfficeSourceContext officeSourceContext)Employs aWebArchitect.static WebArchitectemployWebArchitect(OfficeArchitect officeArchitect, OfficeSourceContext officeSourceContext)Employs aWebArchitect.HttpUrlContinuationgetHttpInput(boolean isSecure, java.lang.String applicationPath)Creates aHttpUrlContinuationinto the web application.HttpInputgetHttpInput(boolean isSecure, java.lang.String httpMethodName, java.lang.String applicationPath)Creates aHttpInputinto the application.voidinformOfficeArchitect()Informs theOfficeArchitectof the web architect.voidintercept(OfficeFlowSinkNode flowSinkNode, OfficeFlowSourceNode flowSourceNode)Intercepts allHttpRequestinstances before servicing.booleanisPathParameters(java.lang.String path)Indicates if the path contains path parameters.voidreroute(OfficeFlowSourceNode flowSourceNode)Runs theServerHttpConnectionthrough routing again.voidsetDefaultHttpObjectParser(HttpObjectParserServiceFactory objectParserServiceFactory)Specifies the defaultHttpObjectParserServiceFactory.voidsetDefaultHttpObjectResponder(HttpObjectResponderServiceFactory objectResponderServiceFactory)Specifies the defaultHttpObjectResponderServiceFactory.
-
-
-
Field Detail
-
PROPERTY_CONTEXT_PATH
public static final java.lang.String PROPERTY_CONTEXT_PATH
Name ofPropertyspecifying the context path.- See Also:
- Constant Field Values
-
-
Method Detail
-
employWebArchitect
public static WebArchitect employWebArchitect(OfficeArchitect officeArchitect, OfficeSourceContext officeSourceContext)
Employs aWebArchitect.- Parameters:
officeArchitect-OfficeArchitect.officeSourceContext-OfficeSourceContextused to sourcePropertyvalues to configure theWebArchitect.- Returns:
WebArchitect.
-
employWebArchitect
public static WebArchitect employWebArchitect(java.lang.String contextPath, OfficeArchitect officeArchitect, OfficeSourceContext officeSourceContext)
Employs aWebArchitect.- Parameters:
contextPath- Context path for the web application. May benullfor no context path.officeArchitect-OfficeArchitect.officeSourceContext-OfficeSourceContextused to sourcePropertyvalues to configure theWebArchitect.- Returns:
WebArchitect.
-
addHttpArgument
public OfficeManagedObject addHttpArgument(java.lang.String parameterName, HttpValueLocation location)
Description copied from interface:WebArchitectAdds a HTTP argument.- Specified by:
addHttpArgumentin interfaceWebArchitect- Parameters:
parameterName- Name of the parameter.location-HttpValueLocationto obtain the argument value. May benullto obtain from anywhere on theHttpRequest.- Returns:
OfficeManagedObject.
-
addHttpApplicationObject
public OfficeManagedObject addHttpApplicationObject(java.lang.Class<?> objectClass, java.lang.String bindName)
Description copied from interface:WebArchitectAdds an object to be lazily created and stored within theHttpApplicationState.- Specified by:
addHttpApplicationObjectin interfaceWebArchitect- Parameters:
objectClass- Class of the object.bindName- Name to bind the object within theHttpApplicationState.- Returns:
OfficeManagedObject.
-
addHttpApplicationObject
public OfficeManagedObject addHttpApplicationObject(java.lang.Class<?> objectClass)
Description copied from interface:WebArchitectAdds an object to be lazily created and stored within the
HttpApplicationState.The bound name is arbitrarily chosen but will be unique for the object.
- Specified by:
addHttpApplicationObjectin interfaceWebArchitect- Parameters:
objectClass- Class of the object.- Returns:
OfficeManagedObject.
-
addHttpSessionObject
public OfficeManagedObject addHttpSessionObject(java.lang.Class<?> objectClass, java.lang.String bindName)
Description copied from interface:WebArchitectAdds an object to be lazily created and stored within theHttpSession.- Specified by:
addHttpSessionObjectin interfaceWebArchitect- Parameters:
objectClass- Class of the object.bindName- Name to bind the object within theHttpSession.- Returns:
OfficeManagedObject.
-
addHttpSessionObject
public OfficeManagedObject addHttpSessionObject(java.lang.Class<?> objectClass)
Description copied from interface:WebArchitectAdds an object to be lazily created and stored within the
HttpSession.The bound name is arbitrarily chosen but will be unique for the object.
- Specified by:
addHttpSessionObjectin interfaceWebArchitect- Parameters:
objectClass- Class of the object.- Returns:
OfficeManagedObject.
-
addHttpRequestObject
public OfficeManagedObject addHttpRequestObject(java.lang.Class<?> objectClass, boolean isLoadParameters, java.lang.String bindName)
Description copied from interface:WebArchitectAdds an object to be lazily created and stored within theHttpRequestState.- Specified by:
addHttpRequestObjectin interfaceWebArchitect- Parameters:
objectClass- Class of the object.isLoadParameters- Indicates whether to load the HTTP parameters to instantiated objects.bindName- Name to bind the object within theHttpRequestState.- Returns:
OfficeManagedObject.
-
addHttpRequestObject
public OfficeManagedObject addHttpRequestObject(java.lang.Class<?> objectClass, boolean isLoadParameters)
Description copied from interface:WebArchitectAdds an object to be lazily created and stored within the
HttpRequestState.The bound name is arbitrarily chosen but will be unique for the object.
- Specified by:
addHttpRequestObjectin interfaceWebArchitect- Parameters:
objectClass- Class of the object.isLoadParameters- Indicates whether to load the HTTP parameters to instantiated objects.- Returns:
OfficeManagedObject.
-
addHttpObjectParser
public void addHttpObjectParser(HttpObjectParserFactory objectParserFactory)
Description copied from interface:WebArchitectManually adds a
HttpObjectParserFactory.Typically these should be configured via
HttpObjectParserServiceFactory, so can be plugged in as required.- Specified by:
addHttpObjectParserin interfaceWebArchitect- Parameters:
objectParserFactory-HttpObjectParserFactory.
-
setDefaultHttpObjectParser
public void setDefaultHttpObjectParser(HttpObjectParserServiceFactory objectParserServiceFactory)
Description copied from interface:WebArchitectSpecifies the defaultHttpObjectParserServiceFactory.- Specified by:
setDefaultHttpObjectParserin interfaceWebArchitect- Parameters:
objectParserServiceFactory- DefaultHttpObjectParserServiceFactory.
-
addHttpObjectAnnotationAlias
public void addHttpObjectAnnotationAlias(java.lang.Class<?> httpObjectAnnotationAliasClass, java.lang.String... acceptedContentTypes)Description copied from interface:WebArchitectAdds another
Classas an alias for theHttpObjectannotation.As code generators are likely to be used for the HTTP objects, it is not always possible to generate the
Classannotated withHttpObject. This allows anotherAnnotationto indicate the parameter object is a HTTP object.- Specified by:
addHttpObjectAnnotationAliasin interfaceWebArchitect- Parameters:
httpObjectAnnotationAliasClass- AliasAnnotationClassforHttpObject.acceptedContentTypes- Listing of thecontent-typevalues accepted. May be empty array to allow supporting all availablecontent-typeHttpObjectParserinstances available.
-
addHttpObject
public OfficeManagedObject addHttpObject(java.lang.Class<?> objectClass, java.lang.String... acceptedContentTypes)
Description copied from interface:WebArchitectAdds a HTTPObjectto be parsed from theHttpRequest.- Specified by:
addHttpObjectin interfaceWebArchitect- Parameters:
objectClass- Class of the object.acceptedContentTypes- Listing of thecontent-typevalues accepted. May be empty array to allow supporting all availablecontent-typeHttpObjectParserinstances available.- Returns:
OfficeManagedObject.
-
addHttpObjectResponder
public void addHttpObjectResponder(HttpObjectResponderFactory objectResponderFactory)
Description copied from interface:WebArchitectAdds aHttpObjectResponderFactory.- Specified by:
addHttpObjectResponderin interfaceWebArchitect- Parameters:
objectResponderFactory-HttpObjectResponderFactory.
-
setDefaultHttpObjectResponder
public void setDefaultHttpObjectResponder(HttpObjectResponderServiceFactory objectResponderServiceFactory)
Description copied from interface:WebArchitectSpecifies the defaultHttpObjectResponderServiceFactory.- Specified by:
setDefaultHttpObjectResponderin interfaceWebArchitect- Parameters:
objectResponderServiceFactory- DefaultHttpObjectResponderServiceFactory.
-
isPathParameters
public boolean isPathParameters(java.lang.String path)
Description copied from interface:WebArchitectIndicates if the path contains path parameters.- Specified by:
isPathParametersin interfaceWebArchitect- Parameters:
path- Path.- Returns:
trueif path contains parameters.
-
getHttpInput
public HttpUrlContinuation getHttpInput(boolean isSecure, java.lang.String applicationPath)
Description copied from interface:WebArchitectCreates aHttpUrlContinuationinto the web application. This will always be aHttpMethod.GETdue to redirection required for theHttpUrlContinuation.- Specified by:
getHttpInputin interfaceWebArchitect- Parameters:
isSecure- Indicates if secure connection required.applicationPath- Application path to be linked.- Returns:
HttpUrlContinuation.
-
getHttpInput
public HttpInput getHttpInput(boolean isSecure, java.lang.String httpMethodName, java.lang.String applicationPath)
Description copied from interface:WebArchitectCreates aHttpInputinto the application.- Specified by:
getHttpInputin interfaceWebArchitect- Parameters:
isSecure- Indicates if secure connection required.httpMethodName- Name of theHttpMethod.applicationPath- URL path of the application to be linked.- Returns:
HttpInput.
-
addHttpInputExplorer
public void addHttpInputExplorer(HttpInputExplorer explorer)
Description copied from interface:WebArchitectAdds aHttpInputExplorer.- Specified by:
addHttpInputExplorerin interfaceWebArchitect- Parameters:
explorer-HttpInputExplorer.
-
reroute
public void reroute(OfficeFlowSourceNode flowSourceNode)
Description copied from interface:WebArchitectRuns the
ServerHttpConnectionthrough routing again.Typically, this is used on importing previous state into the
ServerHttpConnectionand then have it serviced.- Specified by:
reroutein interfaceWebArchitect- Parameters:
flowSourceNode-OfficeFlowSourceNodeto trigger re-routing theServerHttpConnection.
-
intercept
public void intercept(OfficeFlowSinkNode flowSinkNode, OfficeFlowSourceNode flowSourceNode)
Description copied from interface:WebArchitectIntercepts all
HttpRequestinstances before servicing. Multiple intercepts may be configured, with them executed in the order they are added.This allows, for example, logging all requests to the web application.
- Specified by:
interceptin interfaceWebArchitect- Parameters:
flowSinkNode-OfficeFlowSinkNodeto handle intercepting theHttpRequest.flowSourceNode-OfficeFlowSourceNodeto continue servicing theHttpRequest.
-
chainServicer
public void chainServicer(OfficeFlowSinkNode flowSinkNode, OfficeFlowSourceNode notHandledOutput)
Description copied from interface:WebArchitectChains a
OfficeSectionInputto the end of the servicing chain to handle aHttpRequest. Multiple chained services may be added, with them executed in the order they are added.The
WebArchitectfunctionality is always the first in the chain to attempt to service theHttpRequest. This allows, for example, adding a chained servicer for serving resources from a file system.- Specified by:
chainServicerin interfaceWebArchitect- Parameters:
flowSinkNode-OfficeFlowSinkNodeto handle theHttpRequest.notHandledOutput-OfficeFlowSourceNodeshould this servicer not handle theHttpRequest. May benullif handles allHttpRequestinstances (any services chained after this will therefore not be used).
-
createAcceptNegotiator
public <H> AcceptNegotiatorBuilder<H> createAcceptNegotiator()
Description copied from interface:WebArchitectCreates theAcceptNegotiatorBuilderto build anAcceptNegotiator.- Specified by:
createAcceptNegotiatorin interfaceWebArchitect- Type Parameters:
H- Handler type.- Returns:
AcceptNegotiatorBuilderto build anAcceptNegotiator.
-
informOfficeArchitect
public void informOfficeArchitect()
Description copied from interface:WebArchitectInforms theOfficeArchitectof the web architect. This is to be invoked once all web architecture is configured.- Specified by:
informOfficeArchitectin interfaceWebArchitect
-
-