public interface VirtualHost
Modifier and Type | Method and Description |
---|---|
String |
getBaseURL(javax.servlet.http.HttpServletRequest request)
Returns the base of the
URL as seen by for example a browser. |
String |
getCdnHost() |
VirtualHost |
getChildHost(String name) |
List<VirtualHost> |
getChildHosts() |
String |
getContextPath()
Returns the default contextpath (webapp) for all the
Mount s below this VirtualHost . |
String |
getDefaultResourceBundleId()
Deprecated.
Use
getDefaultResourceBundleIds() instead. |
String[] |
getDefaultResourceBundleIds() |
String |
getHomePage() |
String |
getHostGroupName()
Returns the name of host group this virtual host belongs to, for example 'prod', 'acct' or 'dev'
|
String |
getHostName()
The hostName of this VirtualHost.
|
String |
getLocale()
the locale for this VirtualHost or
null when it does not contain one. |
String |
getName()
Returns the
name of this VirtualHost. |
String |
getPageNotFound() |
PortMount |
getPortMount(int portNumber) |
String |
getScheme() |
int |
getSchemeNotMatchingResponseCode()
|
VirtualHosts |
getVirtualHosts() |
boolean |
isCacheable() |
boolean |
isContextPathInUrl() |
boolean |
isCustomHttpsSupported() |
boolean |
isPortInUrl() |
boolean |
isSchemeAgnostic()
If a
VirtualHost is scheme agnostic, the request gets served regardless whether it is http or
https (assuming Mount and HstSiteMapItem do not override the value) |
boolean |
isVersionInPreviewHeader() |
String |
onlyForContextPath()
Deprecated.
since CMS 7.9.1 : Use
getContextPath() instead |
String getHostName()
String getName()
name
of this VirtualHost. Note, this is not the hostName, but only part of it. If the hostName
is www.apache.org, then the name of this VirtualHost might be 'www' or 'apache' or 'org'. It is thus one segment of the entire hostName.name
of this VirtualHost. Note, this is only part of the entire hostNamegetHostName()
String getHostGroupName()
name
of the host group this VirtualHost belongs to.String getLocale()
null
when it does not contain one. Note that if an ancestor VirtualHost contains a
locale, this value is inherited unless this VirtualHost explicitly defines its own. The VirtualHost directly below the VirtualHosts
inherits the value from
the VirtualHosts
null
when it does not contain one.VirtualHost getChildHost(String name)
name
- the name segment of the hostnameVirtualHost
or null
if none foundList<VirtualHost> getChildHosts()
PortMount getPortMount(int portNumber)
portNumber
- VirtualHosts getVirtualHosts()
VirtualHosts
container of this VirtualHost
boolean isContextPathInUrl()
true
when the created url should have the contextpath in it@Deprecated String onlyForContextPath()
getContextPath()
insteadString getContextPath()
Returns the default contextpath (webapp) for all the Mount
s below this VirtualHost
. A Mount
can override this default host contextpath by setting the contextpath explicitly.
Mount
s below this VirtualHost
.
The contextpath for the ROOT application must be an empty String. If non-empty, a path starting with a "/" character
but that does not end with a "/" character must be returned. It is not allowed to return null
Mount.getContextPath()
boolean isPortInUrl()
true
when the created url should have the port in itString getScheme()
boolean isSchemeAgnostic()
VirtualHost
is scheme agnostic, the request gets served regardless whether it is http
or
https
(assuming Mount
and HstSiteMapItem
do not override the value)true
when this VirtualHost
is scheme agnosticint getSchemeNotMatchingResponseCode()
the response code the HST sets when HttpServletRequest
scheme
does not match getScheme()
.
Default response code is HttpServletResponse.SC_MOVED_PERMANENTLY
. The following response
codes are supported and result in:
getScheme()
, permanent redirect to the correct scheme is donegetScheme()
, temporal redirect to the correct scheme is donegetScheme()
, a page forbidden is returnedgetScheme()
, a page not found is returned
Any other response code than above will result in inheriting the response code from parent VirtualHost
or VirtualHosts
String getHomePage()
null
when not presentString getBaseURL(javax.servlet.http.HttpServletRequest request)
URL
as seen by for example a browser. The base URL is consists of scheme + hostname + portnumber
for example 'http://www.hippoecm.org:8081'
The scheme is 'http' by default, unless getScheme()
returns something else
The hostname is the HttpServeltRequest request.getServerName() (proxies must have ProxyPreserveHost On
)
The portnumber is as follows:
#isPortVisible()
is false
, there is no portnumberport = #getPortNumber()
if (port == 0) {port = request.getServerPort()}
request
- the HttpServletRequestURL
until the context path, thus scheme + hostname + portnumber
, for example 'http://www.hippoecm.org:8081'String getPageNotFound()
Mount
or null
when not presentboolean isVersionInPreviewHeader()
boolean isCacheable()
true
if rendering / resource requests can have their entire page http responses cached.@Deprecated String getDefaultResourceBundleId()
getDefaultResourceBundleIds()
instead.String[] getDefaultResourceBundleIds()
VirtualHost
and empty from ancestor VirtualHost
or when root host from VirtualHosts.getDefaultResourceBundleIds()
String getCdnHost()
null
or empty String in case no cdn host is used and otherwise the cdn host to be used for URLs to sitemap items that have
HstSiteMapItem#isContainerResource() = true
.
Supported format for a cdn host is //hostname. It is *not* allowed to include the scheme (http:|https:)boolean isCustomHttpsSupported()
true
if this VirtualHost
allows a HttpServletRequest
over https
to
be rendered while the matched HstSiteMapItem
or Mount
indicates
through getScheme()
the request should be http
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.