Interface VirtualHosts

All Known Subinterfaces:
MutableVirtualHosts

public interface VirtualHosts
The container interface for VirtualHost
  • Field Details

  • Method Details

    • 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. Use matchMount(String, String) instead. The contextPath 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 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.

      Parameters:
      hostName -
      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
    • 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
    • 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 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<{@link 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 -
    • 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 returns hst:sites
    • isDiagnosticsEnabled

      boolean isDiagnosticsEnabled(String ip)
      Returns:
      true when diagnostics about request processing is enabled for the client IP address. If ip is null, then the ip address of the request won't be taken into account to determine whether or not the diagnostics is enabled.
    • getDiagnosticsDepth

      int getDiagnosticsDepth()
      If isDiagnosticsEnabled(String) returns true, only until getDiagnosticsDepth() 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()
      If isDiagnosticsEnabled(String) returns true, only log if the Task took longer than or equal to getDiagnosticsThresholdMillis(). 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 and null if no such channel exists
      Throws:
      IllegalArgumentException - in case of invalid channelPath
    • getChannelById

      Channel getChannelById(String hostGroup, String id)
      For hostGroup get a Channel given its id
      Parameters:
      hostGroup - the name of the host group to get channel for
      id - - Channel id
      Returns:
      Channel which has this id or null
    • getBlueprints

      List<Blueprint> getBlueprints()
      The list of available blueprints
    • 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 which ChannelInfo is going to be retrieved
      Returns:
      The ChannelInfo Class type of Channel
      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 for
      id - - Channel id
      Returns:
      The ChannelInfo Class type of Channel 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 which ChannelInfo is going to be retrieved
      Returns:
      List of ChannelInfo Class mixin types of Channel
      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 for
      id - - Channel id
      Returns:
      List of ChannelInfo Class mixin types of Channel 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 the getChannelInfoClass(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)
      Get Channel property definitions given a Channel object instance
      Parameters:
      channel - - Channel for which property definitions are going to be retrieved
      Returns:
      List of HstPropertyDefinition
    • getPropertyDefinitions

      List<HstPropertyDefinition> getPropertyDefinitions(String hostGroup, String channelId)
      Get Channel property definitions given a Channel id
      Parameters:
      hostGroup - the name of the host group to get channel for
      channelId - - Channel id for which property definitions are going to be retrieved
      Returns:
      List of HstPropertyDefinition
    • getComponentRegistry

      HstComponentRegistry getComponentRegistry()
      meant for internal platform usage only!
      Returns:
      HstComponentRegistry, meant for internal platform usage only!