Interface VirtualHosts
-
- All Known Subinterfaces:
MutableVirtualHosts
public interface VirtualHosts
The container interface forVirtualHost
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_SCHEME
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Blueprint
getBlueprint(String id)
Retrieve a blue print from it's ID.List<Blueprint>
getBlueprints()
The list of available blueprintsChannel
getChannelById(String hostGroup, String id)
ForhostGroup
get aChannel
given its idChannel
getChannelByJcrPath(String hostGroup, String channelPath)
<T extends ChannelInfo>
TgetChannelInfo(Channel channel)
The channel info for this channel.Class<? extends ChannelInfo>
getChannelInfoClass(String hostGroup, String id)
The channel info class for this channel identified by id.Class<? extends ChannelInfo>
getChannelInfoClass(Channel channel)
The channel info class for this channel.List<Class<? extends ChannelInfo>>
getChannelInfoMixins(String hostGroup, String id)
The channel info mixin classes for this channel identified by id.List<Class<? extends ChannelInfo>>
getChannelInfoMixins(Channel channel)
The channel info mixin classes for this channel.String
getChannelManagerSitesName()
Map<String,Map<String,Channel>>
getChannels()
Map<String,Channel>
getChannels(String hostGroup)
String
getCmsPreviewPrefix()
The cmsPreviewPrefix will never start or end with a slash and will never benull
HstComponentRegistry
getComponentRegistry()
meant for internal platform usage only!String
getContextPath()
String[]
getDefaultResourceBundleIds()
int
getDiagnosticsDepth()
IfisDiagnosticsEnabled(String)
returnstrue
, only untilgetDiagnosticsDepth()
the call hierarchy timings will be logged.long
getDiagnosticsThresholdMillis()
IfisDiagnosticsEnabled(String)
returnstrue
, only log if theTask
took longer than or equal togetDiagnosticsThresholdMillis()
.long
getDiagnosticsUnitThresholdMillis()
List<String>
getHostGroupNames()
String
getLocale()
Mount
getMountByGroupAliasAndType(String hostGroupName, String alias, String type)
Mount
getMountByIdentifier(String uuid)
List<Mount>
getMountsByHostGroup(String hostGroupName)
List<HstPropertyDefinition>
getPropertyDefinitions(String hostGroup, String channelId)
List<HstPropertyDefinition>
getPropertyDefinitions(Channel channel)
ResourceBundle
getResourceBundle(Channel channel, Locale locale)
The resource bundle for the channel info.boolean
isChannelMngrSiteAuthenticationSkipped()
boolean
isContextPathInUrl()
This is the global setting for everyVirtualHost
/Mount
whether contextPath should be in the URL or notboolean
isDiagnosticsEnabled(String ip)
boolean
isHstFilterExcludedPath(String pathInfo)
Some paths should not be handled by the hst framework request processing, eg /ping/ When a path must be excluded, this method return true.boolean
isPortInUrl()
This is the global setting for everyVirtualHost
/Mount
whether the port number should be in the URL or notResolvedMount
matchMount(String hostName, String requestPath)
This method tries to match a hostName and requestPath to a flyweightResolvedMount
.ResolvedMount
matchMount(String hostName, String contextPath, String requestPath)
Deprecated.Since 13.0.0.ResolvedVirtualHost
matchVirtualHost(String hostName)
This method tries to match a request to a flyweightResolvedVirtualHost
-
-
-
Field Detail
-
DEFAULT_SCHEME
static final String DEFAULT_SCHEME
- See Also:
- Constant Field Values
-
-
Method Detail
-
isHstFilterExcludedPath
boolean isHstFilterExcludedPath(String pathInfo)
Some paths should not be handled by the hst framework request processing, eg /ping/ 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.
-
matchMount
@Deprecated ResolvedMount matchMount(String hostName, String contextPath, String requestPath) throws MatchException
Deprecated.Since 13.0.0. UsematchMount(String, String)
instead. ThecontextPath
is not used any more in 13.0.0.- Throws:
MatchException
-
matchMount
ResolvedMount matchMount(String hostName, String requestPath) throws MatchException
This method tries to match a hostName and requestPath to a flyweight
ResolvedMount
. It does so, by first trying to match the correctResolvedVirtualHost
. If it does find aResolvedVirtualHost
, the match is delegated toResolvedVirtualHost.matchMount(String, String)
, which returns theResolvedMount
. If somewhere in the chain a match cannot be made,null
will be returned.- Parameters:
hostName
-requestPath
-- Returns:
- the
ResolvedMount
for this hstContainerUrl ornull
when it can not be matched to aMount
- 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
-
isContextPathInUrl
boolean isContextPathInUrl()
This is the global setting for everyVirtualHost
/Mount
whether contextPath should be in the URL or not- Returns:
true
when the created url should have the contextPath in it
-
getContextPath
String getContextPath()
- Returns:
- the context path of the webapp for this hst configuration and never
null
-
isPortInUrl
boolean isPortInUrl()
This is the global setting for everyVirtualHost
/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 theMount
for thishostGroupName
,alias
and
type
having
Mount.getType()
equal totype
. Returnsnull
when no match- Parameters:
hostGroupName
-alias
- the alias the mount must havetype
- the type (for example preview, live, composer) the siteMount must have.- Returns:
- the
Mount
for thishostGroupName
,alias
and
type
having
Mount.getType()
equal totype
. Returnsnull
when no match
-
getMountsByHostGroup
List<Mount> getMountsByHostGroup(String hostGroupName)
- Parameters:
hostGroupName
-- Returns:
- the
List<{@link Mount}>
belonging tohostGroupName
ornull
when there are noMount
forhostGroupName
-
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 ""Note that the cms preview prefix MUST be the same for every hst site webapp AND hst platform webapp
-
getChannelManagerSitesName
String getChannelManagerSitesName()
- Returns:
- the node name of the hst:sites that will be managed by the
ChannelManager
. If not configured it returnshst:sites
-
isDiagnosticsEnabled
boolean isDiagnosticsEnabled(String ip)
- Returns:
true
when diagnostics about request processing is enabled for the client IP address. Ifip
isnull
, then theip
address of the request won't be taken into account to determine whether or not the diagnostics is enabled.
-
getDiagnosticsDepth
int getDiagnosticsDepth()
IfisDiagnosticsEnabled(String)
returnstrue
, only untilgetDiagnosticsDepth()
the call hierarchy timings will be logged. Default value returned is-1
meaning no limit- Returns:
- the depth until where to log and -1 if not limit
-
getDiagnosticsThresholdMillis
long getDiagnosticsThresholdMillis()
IfisDiagnosticsEnabled(String)
returnstrue
, only log if theTask
took longer than or equal togetDiagnosticsThresholdMillis()
. Default threshold of-1
meaning no threshold- Returns:
- the threshold value configured and
-1
if not configured meaning no threshold.
-
getDiagnosticsUnitThresholdMillis
long getDiagnosticsUnitThresholdMillis()
- Returns:
- the threshold value for a task to get logged separately. If not configured
-1
is returned meaning no threshold for subtask diagnostics
-
getDefaultResourceBundleIds
String[] getDefaultResourceBundleIds()
- Returns:
- default resource bundle IDs for all sites to use, for example { "org.example.resources.MyResources" }, or empty array when not configured
-
isChannelMngrSiteAuthenticationSkipped
boolean isChannelMngrSiteAuthenticationSkipped()
- Returns:
true
when the channel manager can skip authentication required for mounts or sitemapitems.
-
getChannels
Map<String,Channel> getChannels(String hostGroup)
- Parameters:
hostGroup
- the name of the host group to get the channels for- Returns:
- all managed channels for the
hostGroup. Empty List in case the hostGroup does not exist or has no channel. The keys in the map are the
Channel.getId()
's. Note that in case there are branches of the hst configuration, also the channels for these branches are returned
-
getChannels
Map<String,Map<String,Channel>> getChannels()
- Returns:
- The map of all
hostGroup
names to the map of all the channels for that hostgroup. Note that in case there are branches of the hst configuration, also the channels for these branches are returned
-
getChannelByJcrPath
Channel getChannelByJcrPath(String hostGroup, String channelPath)
- Parameters:
hostGroup
- the name of the host group to get channel for- Returns:
- the channel configured at the given
channelPath
andnull
if no such channel exists - Throws:
IllegalArgumentException
- in case of invalidchannelPath
-
getChannelById
Channel getChannelById(String hostGroup, String id)
ForhostGroup
get aChannel
given its id
-
getBlueprint
Blueprint getBlueprint(String id)
Retrieve a blue print from it's ID.- Parameters:
id
-
-
getChannelInfoClass
Class<? extends ChannelInfo> getChannelInfoClass(Channel channel) throws ChannelException
The channel info class for this channel. Since this class comes from a separate context, it cannot be deserialized.- Parameters:
channel
- -Channel
for whichChannelInfo
is going to be retrieved- Returns:
- The
ChannelInfo
Class
type ofChannel
- Throws:
ChannelException
-
getChannelInfoClass
Class<? extends ChannelInfo> getChannelInfoClass(String hostGroup, String id) throws ChannelException
The channel info class for this channel identified by id.- Parameters:
hostGroup
- the name of the host group to get channel forid
- -Channel
id- Returns:
- The
ChannelInfo
Class
type ofChannel
identified by id - Throws:
ChannelException
-
getChannelInfoMixins
List<Class<? extends ChannelInfo>> getChannelInfoMixins(Channel channel) throws ChannelException
The channel info mixin classes for this channel. Since these classes come from a separate context, it cannot be deserialized.- Parameters:
channel
- -Channel
for whichChannelInfo
is going to be retrieved- Returns:
- List of
ChannelInfo
Class
mixin types ofChannel
- Throws:
ChannelException
-
getChannelInfoMixins
List<Class<? extends ChannelInfo>> getChannelInfoMixins(String hostGroup, String id) throws ChannelException
The channel info mixin classes for this channel identified by id.- Parameters:
hostGroup
- the name of the host group to get channel forid
- -Channel
id- Returns:
- List of
ChannelInfo
Class
mixin types ofChannel
identified by id - Throws:
ChannelException
-
getChannelInfo
<T extends ChannelInfo> T getChannelInfo(Channel channel) throws ChannelException
The channel info for this channel. It is an instance of thegetChannelInfoClass(org.onehippo.cms7.services.hst.Channel)
class.- Type Parameters:
T
-- Parameters:
channel
-- Throws:
ChannelException
-
getResourceBundle
ResourceBundle getResourceBundle(Channel channel, Locale locale)
The resource bundle for the channel info. It contains the display names for fields and values.- Returns:
- The ResourceBundle or null if the resource bundle could not be found
-
getPropertyDefinitions
List<HstPropertyDefinition> getPropertyDefinitions(Channel channel)
- Parameters:
channel
- -Channel
for which property definitions are going to be retrieved- Returns:
List
ofHstPropertyDefinition
-
getPropertyDefinitions
List<HstPropertyDefinition> getPropertyDefinitions(String hostGroup, String channelId)
- Parameters:
hostGroup
- the name of the host group to get channel forchannelId
- -Channel
id for which property definitions are going to be retrieved- Returns:
List
ofHstPropertyDefinition
-
getComponentRegistry
HstComponentRegistry getComponentRegistry()
meant for internal platform usage only!- Returns:
HstComponentRegistry
, meant for internal platform usage only!
-
-