Interface WebArchitect
-
- All Known Implementing Classes:
WebArchitectEmployer
public interface WebArchitectWeb configuration extensions for theOfficeArchitect.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHANDLER_INPUT_NAMEName of theOfficeSectionInputthat handles theHttpRequestinstances.static java.lang.StringHANDLER_SECTION_NAMEName of theOfficeSectionthat handles theHttpRequestinstances.
-
Method Summary
All Methods Instance Methods Abstract 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.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
-
HANDLER_SECTION_NAME
static final java.lang.String HANDLER_SECTION_NAME
Name of theOfficeSectionthat handles theHttpRequestinstances.- See Also:
- Constant Field Values
-
HANDLER_INPUT_NAME
static final java.lang.String HANDLER_INPUT_NAME
Name of theOfficeSectionInputthat handles theHttpRequestinstances.- See Also:
- Constant Field Values
-
-
Method Detail
-
addHttpObjectParser
void addHttpObjectParser(HttpObjectParserFactory objectParserFactory)
Manually adds a
HttpObjectParserFactory.Typically these should be configured via
HttpObjectParserServiceFactory, so can be plugged in as required.- Parameters:
objectParserFactory-HttpObjectParserFactory.
-
setDefaultHttpObjectParser
void setDefaultHttpObjectParser(HttpObjectParserServiceFactory objectParserServiceFactory)
Specifies the defaultHttpObjectParserServiceFactory.- Parameters:
objectParserServiceFactory- DefaultHttpObjectParserServiceFactory.
-
addHttpObjectAnnotationAlias
void addHttpObjectAnnotationAlias(java.lang.Class<?> httpObjectAnnotationAliasClass, java.lang.String... acceptedContentTypes)Adds 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.- Parameters:
httpObjectAnnotationAliasClass- AliasAnnotationClassforHttpObject.acceptedContentTypes- Listing of thecontent-typevalues accepted. May be empty array to allow supporting all availablecontent-typeHttpObjectParserinstances available.
-
addHttpObjectResponder
void addHttpObjectResponder(HttpObjectResponderFactory objectResponderFactory)
Adds aHttpObjectResponderFactory.- Parameters:
objectResponderFactory-HttpObjectResponderFactory.
-
setDefaultHttpObjectResponder
void setDefaultHttpObjectResponder(HttpObjectResponderServiceFactory objectResponderServiceFactory)
Specifies the defaultHttpObjectResponderServiceFactory.- Parameters:
objectResponderServiceFactory- DefaultHttpObjectResponderServiceFactory.
-
addHttpApplicationObject
OfficeManagedObject addHttpApplicationObject(java.lang.Class<?> objectClass, java.lang.String bindName)
Adds an object to be lazily created and stored within theHttpApplicationState.- Parameters:
objectClass- Class of the object.bindName- Name to bind the object within theHttpApplicationState.- Returns:
OfficeManagedObject.
-
addHttpApplicationObject
OfficeManagedObject addHttpApplicationObject(java.lang.Class<?> objectClass)
Adds an object to be lazily created and stored within the
HttpApplicationState.The bound name is arbitrarily chosen but will be unique for the object.
- Parameters:
objectClass- Class of the object.- Returns:
OfficeManagedObject.
-
addHttpSessionObject
OfficeManagedObject addHttpSessionObject(java.lang.Class<?> objectClass, java.lang.String bindName)
Adds an object to be lazily created and stored within theHttpSession.- Parameters:
objectClass- Class of the object.bindName- Name to bind the object within theHttpSession.- Returns:
OfficeManagedObject.
-
addHttpSessionObject
OfficeManagedObject addHttpSessionObject(java.lang.Class<?> objectClass)
Adds an object to be lazily created and stored within the
HttpSession.The bound name is arbitrarily chosen but will be unique for the object.
- Parameters:
objectClass- Class of the object.- Returns:
OfficeManagedObject.
-
addHttpRequestObject
OfficeManagedObject addHttpRequestObject(java.lang.Class<?> objectClass, boolean isLoadParameters, java.lang.String bindName)
Adds an object to be lazily created and stored within theHttpRequestState.- 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
OfficeManagedObject addHttpRequestObject(java.lang.Class<?> objectClass, boolean isLoadParameters)
Adds an object to be lazily created and stored within the
HttpRequestState.The bound name is arbitrarily chosen but will be unique for the object.
- Parameters:
objectClass- Class of the object.isLoadParameters- Indicates whether to load the HTTP parameters to instantiated objects.- Returns:
OfficeManagedObject.
-
addHttpArgument
OfficeManagedObject addHttpArgument(java.lang.String parameterName, HttpValueLocation location)
Adds a HTTP argument.- Parameters:
parameterName- Name of the parameter.location-HttpValueLocationto obtain the argument value. May benullto obtain from anywhere on theHttpRequest.- Returns:
OfficeManagedObject.
-
addHttpObject
OfficeManagedObject addHttpObject(java.lang.Class<?> objectClass, java.lang.String... acceptedContentTypes)
Adds a HTTPObjectto be parsed from theHttpRequest.- 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.
-
isPathParameters
boolean isPathParameters(java.lang.String path)
Indicates if the path contains path parameters.- Parameters:
path- Path.- Returns:
trueif path contains parameters.
-
getHttpInput
HttpUrlContinuation getHttpInput(boolean isSecure, java.lang.String applicationPath)
Creates aHttpUrlContinuationinto the web application. This will always be aHttpMethod.GETdue to redirection required for theHttpUrlContinuation.- Parameters:
isSecure- Indicates if secure connection required.applicationPath- Application path to be linked.- Returns:
HttpUrlContinuation.
-
getHttpInput
HttpInput getHttpInput(boolean isSecure, java.lang.String httpMethodName, java.lang.String applicationPath)
Creates aHttpInputinto the application.- Parameters:
isSecure- Indicates if secure connection required.httpMethodName- Name of theHttpMethod.applicationPath- URL path of the application to be linked.- Returns:
HttpInput.
-
addHttpInputExplorer
void addHttpInputExplorer(HttpInputExplorer explorer)
Adds aHttpInputExplorer.- Parameters:
explorer-HttpInputExplorer.
-
reroute
void reroute(OfficeFlowSourceNode flowSourceNode)
Runs the
ServerHttpConnectionthrough routing again.Typically, this is used on importing previous state into the
ServerHttpConnectionand then have it serviced.- Parameters:
flowSourceNode-OfficeFlowSourceNodeto trigger re-routing theServerHttpConnection.
-
intercept
void intercept(OfficeFlowSinkNode flowSinkNode, OfficeFlowSourceNode flowSourceNode)
Intercepts 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.
- Parameters:
flowSinkNode-OfficeFlowSinkNodeto handle intercepting theHttpRequest.flowSourceNode-OfficeFlowSourceNodeto continue servicing theHttpRequest.
-
chainServicer
void chainServicer(OfficeFlowSinkNode flowSinkNode, OfficeFlowSourceNode notHandledOutput)
Chains 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.- 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
<H> AcceptNegotiatorBuilder<H> createAcceptNegotiator()
Creates theAcceptNegotiatorBuilderto build anAcceptNegotiator.- Type Parameters:
H- Handler type.- Returns:
AcceptNegotiatorBuilderto build anAcceptNegotiator.
-
informOfficeArchitect
void informOfficeArchitect()
Informs theOfficeArchitectof the web architect. This is to be invoked once all web architecture is configured.
-
-