Interface WebArchitect
- All Known Implementing Classes:
WebArchitectEmployer
OfficeArchitect.- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of theOfficeSectionInputthat handles theHttpRequestinstances.static final StringName of theOfficeSectionthat handles theHttpRequestinstances. -
Method Summary
Modifier and TypeMethodDescriptionaddHttpApplicationObject(Class<?> objectClass) Adds an object to be lazily created and stored within theHttpApplicationState.addHttpApplicationObject(Class<?> objectClass, String bindName) Adds an object to be lazily created and stored within theHttpApplicationState.addHttpArgument(String parameterName, HttpValueLocation location) Adds a HTTP argument.voidaddHttpInputExplorer(HttpInputExplorer explorer) Adds aHttpInputExplorer.addHttpObject(Class<?> objectClass, String... acceptedContentTypes) Adds a HTTPObjectto be parsed from theHttpRequest.voidaddHttpObjectAnnotationAlias(Class<?> httpObjectAnnotationAliasClass, String... acceptedContentTypes) Adds anotherClassas an alias for theHttpObjectannotation.voidaddHttpObjectParser(HttpObjectParserFactory objectParserFactory) Manually adds aHttpObjectParserFactory.voidaddHttpObjectResponder(HttpObjectResponderFactory objectResponderFactory) Adds aHttpObjectResponderFactory.addHttpRequestObject(Class<?> objectClass, boolean isLoadParameters) Adds an object to be lazily created and stored within theHttpRequestState.addHttpRequestObject(Class<?> objectClass, boolean isLoadParameters, String bindName) Adds an object to be lazily created and stored within theHttpRequestState.addHttpSessionObject(Class<?> objectClass) Adds an object to be lazily created and stored within theHttpSession.addHttpSessionObject(Class<?> objectClass, 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(Class<H> handlerType) Creates theAcceptNegotiatorBuilderto build anAcceptNegotiator.voidEnableHttpExternalResponsebeing available.getHttpInput(boolean isSecure, String applicationPath) Creates aHttpUrlContinuationinto the web application.getHttpInput(boolean isSecure, String httpMethodName, String applicationPath) Creates aHttpInputinto the application.voidInforms theOfficeArchitectof the web architect.voidintercept(OfficeFlowSinkNode flowSinkNode, OfficeFlowSourceNode flowSourceNode) Intercepts allHttpRequestinstances before servicing.booleanisPathParameters(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 Details
-
HANDLER_SECTION_NAME
Name of theOfficeSectionthat handles theHttpRequestinstances.- See Also:
-
HANDLER_INPUT_NAME
Name of theOfficeSectionInputthat handles theHttpRequestinstances.- See Also:
-
-
Method Details
-
addHttpObjectParser
Manually adds a
HttpObjectParserFactory.Typically these should be configured via
HttpObjectParserServiceFactory, so can be plugged in as required.- Parameters:
objectParserFactory-HttpObjectParserFactory.
-
setDefaultHttpObjectParser
Specifies the defaultHttpObjectParserServiceFactory.- Parameters:
objectParserServiceFactory- DefaultHttpObjectParserServiceFactory.
-
addHttpObjectAnnotationAlias
void addHttpObjectAnnotationAlias(Class<?> httpObjectAnnotationAliasClass, 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
Adds aHttpObjectResponderFactory.- Parameters:
objectResponderFactory-HttpObjectResponderFactory.
-
setDefaultHttpObjectResponder
Specifies the defaultHttpObjectResponderServiceFactory.- Parameters:
objectResponderServiceFactory- DefaultHttpObjectResponderServiceFactory.
-
addHttpApplicationObject
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
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
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
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(Class<?> objectClass, boolean isLoadParameters, 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
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
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
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
Indicates if the path contains path parameters.- Parameters:
path- Path.- Returns:
trueif path contains parameters.
-
getHttpInput
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
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
Adds aHttpInputExplorer.- Parameters:
explorer-HttpInputExplorer.
-
reroute
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
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
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
Creates theAcceptNegotiatorBuilderto build anAcceptNegotiator.- Type Parameters:
H- Handler type.- Parameters:
handlerType- Handler type.- Returns:
AcceptNegotiatorBuilderto build anAcceptNegotiator.
-
enableHttpExternalResponse
void enableHttpExternalResponse()EnableHttpExternalResponsebeing available. -
informOfficeArchitect
void informOfficeArchitect()Informs theOfficeArchitectof the web architect. This is to be invoked once all web architecture is configured.
-