net.officefloor.plugin.web.http.application
Interface WebAutoWireApplication

All Superinterfaces:
AutoWireApplication
All Known Subinterfaces:
HttpServerAutoWireApplication
All Known Implementing Classes:
HttpServerAutoWireOfficeFloorSource, ServletWebAutoWireApplication, WebApplicationAutoWireOfficeFloorSource, WoofOfficeFloorSource

public interface WebAutoWireApplication
extends AutoWireApplication

Web AutoWireApplication.

Author:
Daniel Sagenschneider

Field Summary
static String HANDLER_INPUT_NAME
          Name of the OfficeSectionInput that handles the HttpRequest instances.
static String HANDLER_SECTION_NAME
          Name of the OfficeSection that handles the HttpRequest instances.
static String WEB_PUBLIC_RESOURCES_CLASS_PATH_PREFIX
          Prefix directory path for public web resources to locate them on the class path.
 
Method Summary
 AutoWireObject addHttpApplicationObject(Class<?> objectClass)
           Adds an object to be lazily created and stored within the HttpApplicationState.
 AutoWireObject addHttpApplicationObject(Class<?> objectClass, String bindName)
          Adds an object to be lazily created and stored within the HttpApplicationState.
 AutoWireObject addHttpRequestObject(Class<?> objectClass, boolean isLoadParameters)
           Adds an object to be lazily created and stored within the HttpRequestState.
 AutoWireObject addHttpRequestObject(Class<?> objectClass, boolean isLoadParameters, String bindName)
          Adds an object to be lazily created and stored within the HttpRequestState.
 AutoWireObject addHttpSessionObject(Class<?> objectClass)
           Adds an object to be lazily created and stored within the HttpSession.
 AutoWireObject addHttpSessionObject(Class<?> objectClass, String bindName)
          Adds an object to be lazily created and stored within the HttpSession.
 HttpTemplateAutoWireSection addHttpTemplate(String templateUri, String templateFilePath, Class<?> templateLogicClass)
          Adds a HttpTemplate available at the specified URI path.
 void chainServicer(AutoWireSection section, String inputName, String notHandledOutputName)
           Chains a OfficeSectionInput to the end of the servicing chain to handle a HttpRequest.
 HttpSecurityAutoWireSection getHttpSecurity()
          Obtains the configured HttpSecurityAutoWireSection.
 String[] getURIs()
           Obtains the linked URIs.
 void linkEscalation(Class<? extends Throwable> escalation, HttpTemplateAutoWireSection template)
          Links the Escalation to be handled by the HttpTemplateAutoWireSection.
 void linkEscalation(Class<? extends Throwable> escalation, String resourcePath)
          Links the Escalation to be handled by the resource.
 void linkToHttpTemplate(AutoWireSection section, String outputName, HttpTemplateAutoWireSection template)
          Links the OfficeSectionOutput to render the HttpTemplate.
 void linkToResource(AutoWireSection section, String outputName, String resourcePath)
           Links to a resource.
 void linkToSendResponse(AutoWireSection section, String outputName)
          Links OfficeSectionOutput to sending the HttpResponse.
 HttpUriLink linkUri(String uri, AutoWireSection section, String inputName)
          Links a URI to an OfficeSectionInput.
 void setDefaultHttpTemplateUriSuffix(String uriSuffix)
          Specifies the default URI suffix for the HttpTemplate URI path and link URI paths.
 HttpSecurityAutoWireSection setHttpSecurity(Class<? extends HttpSecuritySource<?,?,?,?>> httpSecuritySourceClass)
          Specifies the HttpSecuritySource for this WebAutoWireApplication.
 
Methods inherited from interface net.officefloor.autowire.AutoWireApplication
addGovernance, addManagedObject, addObject, addSection, addSection, addSectionTransformer, addStartupFlow, addSupplier, assignDefaultTeam, assignTeam, getOfficeFloorCompiler, getSection, isLinked, isObjectAvailable, link, linkEscalation, openOfficeFloor, setProfiler
 

Field Detail

HANDLER_SECTION_NAME

static final String HANDLER_SECTION_NAME
Name of the OfficeSection that handles the HttpRequest instances.

See Also:
Constant Field Values

HANDLER_INPUT_NAME

static final String HANDLER_INPUT_NAME
Name of the OfficeSectionInput that handles the HttpRequest instances.

See Also:
Constant Field Values

WEB_PUBLIC_RESOURCES_CLASS_PATH_PREFIX

static final String WEB_PUBLIC_RESOURCES_CLASS_PATH_PREFIX
Prefix directory path for public web resources to locate them on the class path.

See Also:
Constant Field Values
Method Detail

addHttpTemplate

HttpTemplateAutoWireSection addHttpTemplate(String templateUri,
                                            String templateFilePath,
                                            Class<?> templateLogicClass)
Adds a HttpTemplate available at the specified URI path.

Parameters:
templateUri - URI path for the template.
templateFilePath - Path to the template file.
templateLogicClass - Class providing the logic for the template. May be null if template does not require logic (e.g. static page with links).
Returns:
HttpTemplateAutoWireSection to allow linking flows.

setDefaultHttpTemplateUriSuffix

void setDefaultHttpTemplateUriSuffix(String uriSuffix)
Specifies the default URI suffix for the HttpTemplate URI path and link URI paths.

Parameters:
uriSuffix - Default HttpTemplate URI suffix.

setHttpSecurity

HttpSecurityAutoWireSection setHttpSecurity(Class<? extends HttpSecuritySource<?,?,?,?>> httpSecuritySourceClass)
Specifies the HttpSecuritySource for this WebAutoWireApplication.

Parameters:
httpSecuritySourceClass - HttpSecuritySource Class.
Returns:
HttpSecurityAutoWireSection.

getHttpSecurity

HttpSecurityAutoWireSection getHttpSecurity()
Obtains the configured HttpSecurityAutoWireSection.

Returns:
Configured HttpSecurityAutoWireSection or null if no HttpSecuritySource is configured.

addHttpApplicationObject

AutoWireObject addHttpApplicationObject(Class<?> objectClass,
                                        String bindName)
Adds an object to be lazily created and stored within the HttpApplicationState.

Parameters:
objectClass - Class of the object.
bindName - Name to bind the object within the HttpApplicationState.
Returns:
AutoWireObject.

addHttpApplicationObject

AutoWireObject addHttpApplicationObject(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:
AutoWireObject.

addHttpSessionObject

AutoWireObject addHttpSessionObject(Class<?> objectClass,
                                    String bindName)
Adds an object to be lazily created and stored within the HttpSession.

Parameters:
objectClass - Class of the object.
bindName - Name to bind the object within the HttpSession.
Returns:
AutoWireObject.

addHttpSessionObject

AutoWireObject addHttpSessionObject(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:
AutoWireObject.

addHttpRequestObject

AutoWireObject addHttpRequestObject(Class<?> objectClass,
                                    boolean isLoadParameters,
                                    String bindName)
Adds an object to be lazily created and stored within the HttpRequestState.

Parameters:
objectClass - Class of the object.
isLoadParameters - Indicates whether to load the HTTP parameters to instantiated objects.
bindName - Name to bind the object within the HttpRequestState.
Returns:
AutoWireObject.

addHttpRequestObject

AutoWireObject addHttpRequestObject(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:
AutoWireObject.

linkUri

HttpUriLink linkUri(String uri,
                    AutoWireSection section,
                    String inputName)
Links a URI to an OfficeSectionInput.

Parameters:
uri - URI to be linked.
section - AutoWireSection servicing the URI.
inputName - Name of the OfficeSectionInput servicing the URI.
Returns:
HttpUriLink to configure handling the URI.

getURIs

String[] getURIs()

Obtains the linked URIs.

HttpTemplateAutoWireSection URIs are not included in this list. To determine if the HttpTemplateAutoWireSection is serviced (e.g. for embedding with a JEE server for Servlet mapping) use the template URI suffix.

Returns:
Linked URIs.

linkToHttpTemplate

void linkToHttpTemplate(AutoWireSection section,
                        String outputName,
                        HttpTemplateAutoWireSection template)
Links the OfficeSectionOutput to render the HttpTemplate.

Parameters:
section - AutoWireSection.
outputName - Name of the OfficeSectionOutput.
template - HttpTemplateAutoWireSection.

linkToResource

void linkToResource(AutoWireSection section,
                    String outputName,
                    String resourcePath)

Links to a resource.

The meaning of resource path is specific to implementation.

Parameters:
section - AutoWireSection.
outputName - Name of the OfficeSectionOutput.
resourcePath - Resource path.

linkEscalation

void linkEscalation(Class<? extends Throwable> escalation,
                    HttpTemplateAutoWireSection template)
Links the Escalation to be handled by the HttpTemplateAutoWireSection.

Parameters:
escalation - Escalation.
template - HttpTemplateAutoWireSection.

linkEscalation

void linkEscalation(Class<? extends Throwable> escalation,
                    String resourcePath)
Links the Escalation to be handled by the resource.

Parameters:
escalation - Escalation.
resourcePath - Resource path.

linkToSendResponse

void linkToSendResponse(AutoWireSection section,
                        String outputName)
Links OfficeSectionOutput to sending the HttpResponse.

Parameters:
section - AutoWireSection.
outputName - Name of the OfficeSectionOutput.

chainServicer

void chainServicer(AutoWireSection section,
                   String inputName,
                   String notHandledOutputName)

Chains a OfficeSectionInput to the end of the servicing chain to handle a HttpRequest.

The WebAutoWireApplication functionality is always the first in the chain to attempt to service the HttpRequest.

Typically the last in the chain is servicing the HttpRequest by sending a static resource by matching URI to resource name - and if no resource found, a not found error.

Parameters:
section - AutoWireSection.
inputName - Name of the OfficeSectionInput.
notHandledOutputName - Name of the OfficeSectionOutput should this servicer not handle the HttpRequest. May be null if handles all HttpRequest instances (any services chained after this will therefore not be used).


Copyright © 2005-2013. All Rights Reserved.