org.hippoecm.hst.configuration.hosting
Interface VirtualHost

All Known Subinterfaces:
MutableVirtualHost
All Known Implementing Classes:
VirtualHostService

public interface VirtualHost

VirtualHost which holds the mapping between host (server name) and site name.


Method Summary
 String getBaseURL(javax.servlet.http.HttpServletRequest request)
          Returns the base of the URL as seen by for example a browser.
 VirtualHost getChildHost(String name)
           
 List<VirtualHost> getChildHosts()
           
 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()
           
 VirtualHosts getVirtualHosts()
           
 boolean isContextPathInUrl()
           
 boolean isPortInUrl()
           
 boolean isVersionInPreviewHeader()
           
 String onlyForContextPath()
          In case the HttpServletRequest.getContextPath() does not matter, this method returns null or empty.
 

Method Detail

getHostName

String getHostName()
The hostName of this VirtualHost. Note that this hostName might contain wildcards, for example www.onehippo.*

Returns:
The composite hostName of this VirtualHost, thus including parent VirtualHosts if present

getName

String getName()
Returns the 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.

Returns:
The name of this VirtualHost. Note, this is only part of the entire hostName
See Also:
getHostName()

getHostGroupName

String getHostGroupName()
Returns the name of host group this virtual host belongs to, for example 'prod', 'acct' or 'dev'

Returns:
the name of the host group this VirtualHost belongs to.

getLocale

String getLocale()
the locale for this VirtualHost or 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

Returns:
the locale for this VirtualHost or null when it does not contain one.

getChildHost

VirtualHost getChildHost(String name)
Parameters:
name - the name segment of the hostname
Returns:
the child VirtualHost or null if none found

getChildHosts

List<VirtualHost> getChildHosts()
Returns:
the list of all VirtualHost childs of this VirtualHost

getPortMount

PortMount getPortMount(int portNumber)
Parameters:
portNumber -
Returns:
the

getVirtualHosts

VirtualHosts getVirtualHosts()
Returns:
the VirtualHosts container of this VirtualHost

isContextPathInUrl

boolean isContextPathInUrl()
Returns:
true when the created url should have the contextpath in it

onlyForContextPath

String onlyForContextPath()
In case the HttpServletRequest.getContextPath() does not matter, this method returns null or empty. If Mounts for this host can be used only for a certain contextPath, this method should return that contextPath. If configured, the contextPath is either an empty string, or it must start with a "/" and cannot contain any other "/".

Returns:
null or empty if the contextPath does not matter, otherwise the value the contextPath must have to match Mounts for this host.

isPortInUrl

boolean isPortInUrl()
Returns:
true when the created url should have the port in it

getScheme

String getScheme()
Returns:
the scheme to use for creating external urls, for example http / https

getHomePage

String getHomePage()
Returns:
the homepage for this virtual host or null when not present

getBaseURL

String getBaseURL(javax.servlet.http.HttpServletRequest request)
Returns the base of the 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:

Parameters:
request - the HttpServletRequest
Returns:
the URL until the context path, thus scheme + hostname + portnumber, for example 'http://www.hippoecm.org:8081'

getPageNotFound

String getPageNotFound()
Returns:
the pagenotfound for this Mount or null when not present

isVersionInPreviewHeader

boolean isVersionInPreviewHeader()
Returns:
whether the version of the HST is in the header of the preview


Copyright © 2008-2012 Hippo. All Rights Reserved.