Interface VirtualHosts
- All Known Subinterfaces:
MutableVirtualHosts
public interface VirtualHosts
The container interface for
VirtualHost
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBlueprint
(String id) Retrieve a blue print from it's ID.The list of available blueprintsgetChannelById
(String hostGroup, String id) ForhostGroup
get aChannel
given its idgetChannelByJcrPath
(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.getChannels
(String hostGroup) The cmsPreviewPrefix will never start or end with a slash and will never benull
meant for internal platform usage only!String[]
int
IfisDiagnosticsEnabled(String)
returnstrue
, only untilgetDiagnosticsDepth()
the call hierarchy timings will be logged.long
IfisDiagnosticsEnabled(String)
returnstrue
, only log if theTask
took longer than or equal togetDiagnosticsThresholdMillis()
.long
getMountByGroupAliasAndType
(String hostGroupName, String alias, String type) getMountByIdentifier
(String uuid) getMountsByHostGroup
(String hostGroupName) getPropertyDefinitions
(String hostGroup, String channelId) getPropertyDefinitions
(Channel channel) getResourceBundle
(Channel channel, Locale locale) The resource bundle for the channel info.boolean
boolean
This is the global setting for everyVirtualHost
/Mount
whether contextPath should be in the URL or notboolean
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
This is the global setting for everyVirtualHost
/Mount
whether the port number should be in the URL or notmatchMount
(String hostName, String requestPath) This method tries to match a hostName and requestPath to a flyweightResolvedMount
.matchMount
(String hostName, String contextPath, String requestPath) Deprecated.Since 13.0.0.matchVirtualHost
(String hostName) This method tries to match a request to a flyweightResolvedVirtualHost
-
Field Details
-
DEFAULT_SCHEME
- See Also:
-
-
Method Details
-
isHstFilterExcludedPath
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
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
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
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
- Parameters:
hostGroupName
-- Returns:
- the
List<{@link Mount}>
belonging tohostGroupName
ornull
when there are noMount
forhostGroupName
-
getHostGroupNames
- Returns:
- return the list of all hostGroupNames
-
getMountByIdentifier
- Parameters:
uuid
-
-
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
- 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
- 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
- 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
- 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
ForhostGroup
get aChannel
given its id -
getBlueprints
The list of available blueprints -
getBlueprint
Retrieve a blue print from it's ID.- Parameters:
id
-
-
getChannelInfoClass
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
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
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
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
- Parameters:
channel
- -Channel
for which property definitions are going to be retrieved- Returns:
List
ofHstPropertyDefinition
-
getPropertyDefinitions
- 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!
-