|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.configuration.hosting.VirtualHostsService
public class VirtualHostsService
Field Summary | |
---|---|
static String |
DEFAULT_SCHEME
|
Constructor Summary | |
---|---|
VirtualHostsService(HstNode virtualHostsConfigurationNode,
HstManagerImpl hstManager)
|
Method Summary | |
---|---|
void |
addMount(Mount mount)
Add this mount for lookup through getMountByGroupAliasAndType(String, String, String) |
void |
addVirtualHost(MutableVirtualHost virtualHost)
Adds the virtualHost as child to this MutableVirtualHosts |
protected ResolvedVirtualHost |
findMatchingVirtualHost(String hostName,
int portNumber)
Override this method if you want a different algorithm to resolve hostName |
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()
|
String |
getHomePage()
|
List<String> |
getHostGroupNames()
|
HstManager |
getHstManager()
|
String |
getLocale()
|
Mount |
getMountByGroupAliasAndType(String hostGroupName,
String alias,
String type)
Returns the Mount for this hostGroupName , alias |
Mount |
getMountByIdentifier(String uuid)
|
List<Mount> |
getMountsByHostGroup(String hostGroupName)
|
String |
getPageNotFound()
|
Map<String,Map<String,MutableVirtualHost>> |
getRootVirtualHostsByGroup()
The root virtualhosts are the first segment of a host. |
String |
getScheme()
|
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 |
boolean |
isVersionInPreviewHeader()
|
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 |
protected VirtualHost |
traverseInToHost(VirtualHost matchedHost,
String[] hostNameSegments,
int depth)
Override this method if you want a different algorithm to resolve requestServerName |
static HashMap<String,MutableVirtualHost> |
virtualHostHashMap()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_SCHEME
Constructor Detail |
---|
public VirtualHostsService(HstNode virtualHostsConfigurationNode, HstManagerImpl hstManager) throws ServiceException
ServiceException
Method Detail |
---|
public HstManager getHstManager()
getHstManager
in interface VirtualHosts
HstManager
for this VirtualHosts objectpublic boolean isExcluded(String pathInfo)
VirtualHosts
isExcluded
in interface VirtualHosts
public void addVirtualHost(MutableVirtualHost virtualHost) throws IllegalArgumentException
MutableVirtualHosts
virtualHost
as child to this MutableVirtualHosts
addVirtualHost
in interface MutableVirtualHosts
virtualHost
- the MutableVirtualHost
to add
IllegalArgumentException
- if the virtualHost
could not be addedpublic Map<String,Map<String,MutableVirtualHost>> getRootVirtualHostsByGroup()
MutableVirtualHosts
getRootVirtualHostsByGroup
in interface MutableVirtualHosts
public void addMount(Mount mount) throws ServiceException
getMountByGroupAliasAndType(String, String, String)
addMount
in interface MutableVirtualHosts
mount
-
ServiceException
public ResolvedSiteMapItem matchSiteMapItem(HstContainerURL hstContainerURL) throws MatchException
VirtualHosts
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
matchSiteMapItem
in interface VirtualHosts
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 itempublic ResolvedMount matchMount(String hostName, String contextPath, String requestPath) throws MatchException
VirtualHosts
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.
matchMount
in interface VirtualHosts
ResolvedMount
for this hstContainerUrl or null
when it can not be matched to a Mount
MatchException
public ResolvedVirtualHost matchVirtualHost(String hostName) throws MatchException
VirtualHosts
This method tries to match a request to a flyweight ResolvedVirtualHost
matchVirtualHost
in interface VirtualHosts
null
when it can not be matched to a virtualHost
MatchException
protected ResolvedVirtualHost findMatchingVirtualHost(String hostName, int portNumber)
hostName
- portNumber
-
null
when no host can be matchedprotected VirtualHost traverseInToHost(VirtualHost matchedHost, String[] hostNameSegments, int depth)
matchedHost
- hostNameSegments
- depth
-
public boolean isContextPathInUrl()
VirtualHosts
VirtualHost
/ Mount
whether contextPath should be in the URL or not
isContextPathInUrl
in interface VirtualHosts
true
when the created url should have the contextPath in itpublic String getDefaultContextPath()
VirtualHosts
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 "/".
getDefaultContextPath
in interface VirtualHosts
null
when not configuredpublic boolean isPortInUrl()
VirtualHosts
VirtualHost
/ Mount
whether the port number should be in the URL or not
isPortInUrl
in interface VirtualHosts
true
when the created url should have the port number in itpublic String getScheme()
public String getLocale()
getLocale
in interface VirtualHosts
null
if no locale is configuredpublic String getDefaultHostName()
getDefaultHostName
in interface VirtualHosts
null
if none is configured as default.public String getHomePage()
public String getPageNotFound()
public boolean isVersionInPreviewHeader()
public Mount getMountByGroupAliasAndType(String hostGroupName, String alias, String type)
VirtualHosts
Mount
for this hostGroupName
, alias and type having Mount.getType()
equal to type
. Returns null
when no match
- Specified by:
getMountByGroupAliasAndType
in interface VirtualHosts
alias
- the alias the mount must havetype
- 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
public List<Mount> getMountsByHostGroup(String hostGroupName)
getMountsByHostGroup
in interface VirtualHosts
Mount
> belonging to hostGroupName
or null
when there are no Mount
for hostGroupName
public List<String> getHostGroupNames()
getHostGroupNames
in interface VirtualHosts
public static final HashMap<String,MutableVirtualHost> virtualHostHashMap()
public Mount getMountByIdentifier(String uuid)
getMountByIdentifier
in interface VirtualHosts
public String getCmsPreviewPrefix()
VirtualHosts
null
getCmsPreviewPrefix
in interface VirtualHosts
null
. If configured
to be empty, it will be ""public String getChannelManagerHostGroupName()
VirtualHosts
ChannelManager
will only be able to create links
for channels that are reflected in the hostGroup
getChannelManagerHostGroupName
in interface VirtualHosts
VirtualHosts
. If not configured it returns null
public String getChannelManagerSitesName()
getChannelManagerSitesName
in interface VirtualHosts
ChannelManager
. If not configured it returns hst:sites
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |