public class HttpTemplateAutoWireSectionImpl extends AutoWireSectionImpl implements HttpTemplateAutoWireSection
HttpTemplate
.ENVIRONMENT_PROPERTIES_DIRECTORY
ENVIRONMENT_PROPERTIES_DIRECTORY
Constructor and Description |
---|
HttpTemplateAutoWireSectionImpl(OfficeFloorCompiler compiler,
AutoWireSection section,
Class<?> templateLogicClass,
String templateUri)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
void |
addRenderRedirectHttpMethod(String renderRedirectHttpMethod)
Adds a HTTP method that will cause a redirect on rendering this
HttpTemplate . |
HttpTemplateAutoWireSectionExtension |
addTemplateExtension(Class<? extends HttpTemplateSectionExtension> extensionClass)
Adds an
HttpTemplateSectionExtension to this
HttpTemplateAutoWireSection . |
String[] |
getRenderRedirectHttpMethods()
Obtains the configured render redirect HTTP methods.
|
Map<String,Boolean> |
getSecureLinks()
Obtains an immutable
Map providing the overriding configuration
of whether a link requires a secure ServerHttpConnection . |
String |
getTemplateContentType()
Obtains the Content-Type for the template.
|
Class<?> |
getTemplateLogicClass()
Obtains the logic class for the template.
|
String |
getTemplatePath()
Obtains path to the template file.
|
String |
getTemplateUri()
Obtains the URI to the template.
|
String |
getTemplateUriSuffix()
Obtains the template URI suffix.
|
boolean |
isTemplateSecure()
Indicates whether a secure
ServerHttpConnection is required for
the template. |
void |
setLinkSecure(String linkName,
boolean isSecure)
Indicate whether a secure
ServerHttpConnection is required for
the link. |
void |
setTemplateContentType(String contentType)
Specifies the Content-Type for the template.
|
void |
setTemplateSecure(boolean isSecure)
Indicate whether a secure
ServerHttpConnection is required for
the template. |
void |
setTemplateUriSuffix(String uriSuffix)
Specifies the template URI suffix.
|
getSectionLocation, getSectionName, getSectionSourceClassName, getSuperSection, setSuperSection
addProperty, getProperties, loadProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSectionLocation, getSectionName, getSectionSourceClassName, getSuperSection, setSuperSection
getProperties, loadProperties
addProperty
public HttpTemplateAutoWireSectionImpl(OfficeFloorCompiler compiler, AutoWireSection section, Class<?> templateLogicClass, String templateUri)
compiler
- OfficeFloorCompiler
.section
- AutoWireSection
.templateLogicClass
- Logic class for the template.templateUri
- URI to the template. May be null
if not publicly
exposed template.public String getTemplatePath()
HttpTemplateAutoWireSection
getTemplatePath
in interface HttpTemplateAutoWireSection
public Class<?> getTemplateLogicClass()
HttpTemplateAutoWireSection
getTemplateLogicClass
in interface HttpTemplateAutoWireSection
public String getTemplateUri()
HttpTemplateAutoWireSection
getTemplateUri
in interface HttpTemplateAutoWireSection
public void setTemplateUriSuffix(String uriSuffix)
HttpTemplateAutoWireSection
Specifies the template URI suffix.
This is appended to the template URI and link URIs. It is useful to provide a ".extension" to the template URIs.
setTemplateUriSuffix
in interface HttpTemplateAutoWireSection
uriSuffix
- Template URI suffix. May be null
to not have a
URI suffix.public String getTemplateUriSuffix()
HttpTemplateAutoWireSection
getTemplateUriSuffix
in interface HttpTemplateAutoWireSection
null
to not have a URI
suffix.public void setTemplateContentType(String contentType)
HttpTemplateAutoWireSection
Specifies the Content-Type for the template.
Note for text/*
values, the charset
parameter
will be respected in generating the template.
setTemplateContentType
in interface HttpTemplateAutoWireSection
contentType
- Content-Type for the template.public String getTemplateContentType()
HttpTemplateAutoWireSection
getTemplateContentType
in interface HttpTemplateAutoWireSection
null
to use
the default encoding.public void setTemplateSecure(boolean isSecure)
HttpTemplateAutoWireSection
Indicate whether a secure ServerHttpConnection
is required for
the template. This applies to:
HttpTemplateAutoWireSection
HttpTemplateAutoWireSection
response (a
redirect will be triggered if not appropriately secure)setTemplateSecure
in interface HttpTemplateAutoWireSection
isSecure
- true
should the AutoWireSection
require a
secure ServerHttpConnection
.public boolean isTemplateSecure()
HttpTemplateAutoWireSection
ServerHttpConnection
is required for
the template.isTemplateSecure
in interface HttpTemplateAutoWireSection
true
if a secure ServerHttpConnection
is
required for the template.public void setLinkSecure(String linkName, boolean isSecure)
HttpTemplateAutoWireSection
Indicate whether a secure ServerHttpConnection
is required for
the link. This overrides the default template secure setting for the
link.
Example use could be the landing page may be insecure but the login form submission link on the page is to be secure.
setLinkSecure
in interface HttpTemplateAutoWireSection
linkName
- Name of link to secure.isSecure
- true
should the link require a secure
ServerHttpConnection
.public Map<String,Boolean> getSecureLinks()
HttpTemplateAutoWireSection
Obtains an immutable Map
providing the overriding configuration
of whether a link requires a secure ServerHttpConnection
.
Links not contained in the returned Map
will default secure to
that of the template.
getSecureLinks
in interface HttpTemplateAutoWireSection
Map
of link to whether if requires a secure
ServerHttpConnection
.public void addRenderRedirectHttpMethod(String renderRedirectHttpMethod)
HttpTemplateAutoWireSection
Adds a HTTP method that will cause a redirect on rendering this
HttpTemplate
.
This allows specifying the HTTP methods that will follow the POST/redirect/GET pattern.
addRenderRedirectHttpMethod
in interface HttpTemplateAutoWireSection
renderRedirectHttpMethod
- HTTP method.public String[] getRenderRedirectHttpMethods()
HttpTemplateAutoWireSection
getRenderRedirectHttpMethods
in interface HttpTemplateAutoWireSection
public HttpTemplateAutoWireSectionExtension addTemplateExtension(Class<? extends HttpTemplateSectionExtension> extensionClass)
HttpTemplateAutoWireSection
HttpTemplateSectionExtension
to this
HttpTemplateAutoWireSection
.addTemplateExtension
in interface HttpTemplateAutoWireSection
extensionClass
- Class of the HttpTemplateSectionExtension
.HttpTemplateAutoWireSectionExtension
.Copyright © 2005–2016. All rights reserved.