public class HttpTemplateTask extends AbstractSingleTask<HttpTemplateWork,Indexed,None>
Task
to write the HttpTemplateSection
.Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_BEAN_PREFIX
Property prefix to obtain the bean for the
HttpTemplateSection . |
static String |
PROPERTY_LINK_SECURE_PREFIX
Property prefix to obtain whether the link is to be secure.
|
Constructor and Description |
---|
HttpTemplateTask(HttpTemplateWriter[] contentWriters,
boolean isBean,
Charset charset)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
Object |
doTask(TaskContext<HttpTemplateWork,Indexed,None> context)
Does the task.
|
static boolean |
isLinkSecure(String linkName,
boolean isTemplateSecure,
SourceProperties properties)
Determines if the link should be secure.
|
static String[] |
loadTaskType(net.officefloor.plugin.web.http.template.parse.HttpTemplateSection section,
Charset charset,
String templateUriPath,
String templateUriSuffix,
boolean isTemplateSecure,
WorkTypeBuilder<HttpTemplateWork> workTypeBuilder,
WorkSourceContext context)
Loads the
TaskType to write the HttpTemplateSection . |
createTask, createWork, getRecycleManagedObjectParameter, registerAsRecycleTask, registerTask, registerTask, registerTask, registerWork
public static final String PROPERTY_BEAN_PREFIX
HttpTemplateSection
.public static final String PROPERTY_LINK_SECURE_PREFIX
public HttpTemplateTask(HttpTemplateWriter[] contentWriters, boolean isBean, Charset charset)
contentWriters
- HttpTemplateWriter
instances to write the content.isBean
- Flag indicating if a bean.charset
- Default Charset
for the template.public static String[] loadTaskType(net.officefloor.plugin.web.http.template.parse.HttpTemplateSection section, Charset charset, String templateUriPath, String templateUriSuffix, boolean isTemplateSecure, WorkTypeBuilder<HttpTemplateWork> workTypeBuilder, WorkSourceContext context) throws Exception
TaskType
to write the HttpTemplateSection
.section
- HttpTemplateSection
.charset
- Charset
for the template.templateUriPath
- URI path for the HttpTemplate
.templateUriSuffix
- URI suffix for the HttpTemplate
link URI paths. May be
null
for no suffix.isTemplateSecure
- Indicates if the template is to be secure.workTypeBuilder
- WorkTypeBuilder
.context
- WorkSourceContext
.Task
names to handle HttpTemplate
link
requests.Exception
- If fails to prepare the template.public static boolean isLinkSecure(String linkName, boolean isTemplateSecure, SourceProperties properties)
linkName
- Name of link.isTemplateSecure
- Indicates whether the HttpTemplate
is secure.properties
- SourceProperties
.true
should the link be secure.public Object doTask(TaskContext<HttpTemplateWork,Indexed,None> context) throws IOException
Task
context
- TaskContext
for the Task
.Task
. This allows stringing
Task
instances together into a JobSequence
.IOException
Copyright © 2005–2016. All rights reserved.