org.hippoecm.hst.configuration.hosting
Interface VirtualHosts

All Known Subinterfaces:
MutableVirtualHosts
All Known Implementing Classes:
VirtualHostsService

public interface VirtualHosts

The container interface for VirtualHost


Method Summary
 String getChannelManagerHostGroupName()
          Returns the virtual host group node name in use for the current environment.
 String getChannelManagerSitesName()
           
 String getCmsPreviewPrefix()
          The cmsPreviewPrefix will never start or end with a slash and will never be null
 String getDefaultContextPath()
          For external calls like the CMS REST api, an external app needs to know what context path to use.
 String getDefaultHostName()
           
 List<String> getHostGroupNames()
           
 HstManager getHstManager()
           
 String getLocale()
           
 Mount getMountByGroupAliasAndType(String hostGroupName, String alias, String type)
          Returns the Mount for this hostGroupName, alias and type having Mount.getType() equal to type.
 Mount getMountByIdentifier(String uuid)
           
 List<Mount> getMountsByHostGroup(String hostGroupName)
           
 boolean isContextPathInUrl()
          This is the global setting for every VirtualHost / Mount whether contextPath should be in the URL or not
 boolean isExcluded(String pathInfo)
          Typically, some paths we do not want to be handle by the hst framework request processing.
 boolean isPortInUrl()
          This is the global setting for every VirtualHost / Mount whether the port number should be in the URL or not
 ResolvedMount matchMount(String hostName, String contextPath, String requestPath)
          This method tries to match a hostName, contextPath and requestPath to a flyweight ResolvedMount.
 ResolvedSiteMapItem matchSiteMapItem(HstContainerURL hstContainerURL)
          This method tries to match a hstContainerURL to a flyweight ResolvedSiteMapItem.
 ResolvedVirtualHost matchVirtualHost(String hostName)
           This method tries to match a request to a flyweight ResolvedVirtualHost
 

Method Detail

getHstManager

HstManager getHstManager()
Returns:
the HstManager for this VirtualHosts object

isExcluded

boolean isExcluded(String pathInfo)
Typically, some paths we do not want to be handle by the hst framework request processing. Typically, this would be for example paths starting with /binaries/, or paths ending with some extension, like .pdf When a path must be excluded, this method return true.

Parameters:
pathInfo -
Returns:
true when the path must be excluded for matching to a host.

matchSiteMapItem

ResolvedSiteMapItem matchSiteMapItem(HstContainerURL hstContainerURL)
                                     throws MatchException

This method tries to match a hstContainerURL to a flyweight ResolvedSiteMapItem. It does so, by first trying to match the correct ResolvedVirtualHost. If it does find a ResolvedVirtualHost, the match is delegated to ResolvedVirtualHost#matchSiteMount(HstContainerURL), which returns the ResolvedMount. This object delegates to ResolvedMount.matchSiteMapItem(String) which in the end returns the ResolvedSiteMapItem. If somewhere in the chain a match cannot be made a MatchException exception is thrown

Parameters:
request - the HttpServletRequest
Returns:
the resolvedSiteMapItem for this request
Throws:
MatchException - when the matching cannot be done, for example because no valid virtual hosts are configured or when the request path does not match a sitemap item

matchMount

ResolvedMount matchMount(String hostName,
                         String contextPath,
                         String requestPath)
                         throws MatchException

This method tries to match a hostName, contextPath and requestPath to a flyweight ResolvedMount. It does so, by first trying to match the correct ResolvedVirtualHost. If it does find a ResolvedVirtualHost, the match is delegated to ResolvedVirtualHost.matchMount(String, String), which returns the ResolvedMount. If somewhere in the chain a match cannot be made, null will be returned. The contextPath will only be of influence in the matching when the SiteMount has a non-empty value for Mount.onlyForContextPath(). If Mount.onlyForContextPath() is null or empty, the contextPath is ignored for matching.

Parameters:
String - hostName
String - contextPath the contextPath of the request
String - requestPath
Returns:
the ResolvedMount for this hstContainerUrl or null when it can not be matched to a Mount
Throws:
MatchException

matchVirtualHost

ResolvedVirtualHost matchVirtualHost(String hostName)
                                     throws MatchException

This method tries to match a request to a flyweight ResolvedVirtualHost

Parameters:
hostName -
Returns:
the resolvedVirtualHost for this hostName or null when it can not be matched to a virtualHost
Throws:
MatchException

getDefaultHostName

String getDefaultHostName()
Returns:
the hostname that is configured as default, or null if none is configured as default.

isContextPathInUrl

boolean isContextPathInUrl()
This is the global setting for every VirtualHost / Mount whether contextPath should be in the URL or not

Returns:
true when the created url should have the contextPath in it

getDefaultContextPath

String getDefaultContextPath()
For external calls like the CMS REST api, an external app needs to know what context path to use. Through this getter, the default context path can be retrieved. If not configured, null is returned and the external app must know the context path. If configured, the contextPath is either an empty string, or it has to start with a "/" and is not allowed to have any other "/".

Returns:
the default context path for the webapps or null when not configured

isPortInUrl

boolean isPortInUrl()
This is the global setting for every VirtualHost / Mount whether the port number should be in the URL or not

Returns:
true when the created url should have the port number in it

getLocale

String getLocale()
Returns:
the locale of this VirtualHosts object or null if no locale is configured

getMountByGroupAliasAndType

Mount getMountByGroupAliasAndType(String hostGroupName,
                                  String alias,
                                  String type)
Returns the Mount for this hostGroupName, alias and type having Mount.getType() equal to type. Returns null when no match

Parameters:
hostGroupName -
alias - the alias the mount must have
type - the type (for example preview, live, composer) the siteMount must have.
Returns:
the Mount for this hostGroupName, alias and type having Mount.getType() equal to type. Returns null when no match

getMountsByHostGroup

List<Mount> getMountsByHostGroup(String hostGroupName)
Parameters:
hostGroupName -
Returns:
the List<Mount> belonging to hostGroupName or null when there are no Mount for hostGroupName

getHostGroupNames

List<String> getHostGroupNames()
Returns:
return the list of all hostGroupNames

getMountByIdentifier

Mount getMountByIdentifier(String uuid)
Parameters:
uuid -
Returns:

getCmsPreviewPrefix

String getCmsPreviewPrefix()
The cmsPreviewPrefix will never start or end with a slash and will never be null

Returns:
the configured cmsPreviewPrefix with leading and trailing slashes removed. It will never be null. If configured to be empty, it will be ""

getChannelManagerHostGroupName

String getChannelManagerHostGroupName()
Returns the virtual host group node name in use for the current environment. The ChannelManager will only be able to create links for channels that are reflected in the hostGroup

Returns:
the virtual host group node name used for this VirtualHosts. If not configured it returns null

getChannelManagerSitesName

String getChannelManagerSitesName()
Returns:
the node name of the hst:sites that will be managed by the ChannelManager. If not configured it returns hst:sites


Copyright © 2008-2012 Hippo. All Rights Reserved.