public class HttpRouteTask extends AbstractSingleTask<HttpRouteTask,HttpRouteTask.HttpRouteTaskDependencies,HttpRouteTask.HttpRouteTaskFlows> implements OfficeAwareWorkFactory<HttpRouteTask>
Task
for routing HttpRequest
instances and ensuring
appropriately secure ServerHttpConnection
for servicing the
HttpRequest
.Modifier and Type | Class and Description |
---|---|
static class |
HttpRouteTask.HttpRouteTaskDependencies
Dependencies for the
HttpRouteTask . |
static class |
HttpRouteTask.HttpRouteTaskFlows
Flows for the
HttpRouteTask . |
Modifier and Type | Field and Description |
---|---|
static String |
REDIRECT_URI_SUFFIX
Suffix on the redirect
HttpRequest URI to indicate a redirect has
occurred. |
Constructor and Description |
---|
HttpRouteTask() |
Modifier and Type | Method and Description |
---|---|
static void |
doRedirect(String applicationUriPath,
boolean isSecure,
ServerHttpConnection connection,
HttpApplicationLocation location,
HttpRequestState requestState,
HttpSession session)
Undertakes a redirect.
|
Object |
doTask(TaskContext<HttpRouteTask,HttpRouteTask.HttpRouteTaskDependencies,HttpRouteTask.HttpRouteTaskFlows> context)
Does the task.
|
void |
setOffice(Office office)
Provides the
WorkFactory its containing Office . |
createTask, createWork, getRecycleManagedObjectParameter, registerAsRecycleTask, registerTask, registerTask, registerTask, registerWork
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createWork
public static final String REDIRECT_URI_SUFFIX
HttpRequest
URI to indicate a redirect has
occurred.public static void doRedirect(String applicationUriPath, boolean isSecure, ServerHttpConnection connection, HttpApplicationLocation location, HttpRequestState requestState, HttpSession session) throws IOException
Undertakes a redirect.
This may be utilised by any Task
with a
HttpUrlContinuationDifferentiator
to trigger a redirect that will
have the HttpRequest
state appropriately managed across the
redirect by the HttpRouteTask
.
applicationUriPath
- Application URI path.isSecure
- Whether a secure ServerHttpConnection
is required.connection
- ServerHttpConnection
.location
- HttpApplicationLocation
.requestState
- HttpRequestState
.session
- HttpSession
.IOException
- If unable to undertake redirect.public void setOffice(Office office) throws Exception
OfficeAwareWorkFactory
WorkFactory
its containing Office
.setOffice
in interface OfficeAwareWorkFactory<HttpRouteTask>
office
- Office
containing this WorkFactory
.Exception
- If fails to use the Office
.public Object doTask(TaskContext<HttpRouteTask,HttpRouteTask.HttpRouteTaskDependencies,HttpRouteTask.HttpRouteTaskFlows> context) throws InvalidHttpRequestUriException, HttpRequestTokeniseException, IOException, UnknownWorkException, UnknownTaskException, InvalidParameterTypeException
Task
doTask
in interface Task<HttpRouteTask,HttpRouteTask.HttpRouteTaskDependencies,HttpRouteTask.HttpRouteTaskFlows>
context
- TaskContext
for the Task
.Task
. This allows stringing
Task
instances together into a JobSequence
.InvalidHttpRequestUriException
HttpRequestTokeniseException
IOException
UnknownWorkException
UnknownTaskException
InvalidParameterTypeException
Copyright © 2005–2016. All rights reserved.