Mapper.MappedHost (Apache Tomcat 9.0.119 API Documentation)
Description: declaration: package: org.apache.catalina.mapper, class: Mapper, class: MappedHost

# Class Mapper.MappedHost

java.lang.Object
org.apache.catalina.mapper.Mapper.MapElement<Host>
org.apache.catalina.mapper.Mapper.MappedHost

Enclosing class:
  `Mapper`

protected static final class Mapper.MappedHost extends Mapper.MapElement<Host>
Represents a mapped host.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `Mapper.ContextList`
  `contextList`
  The list of contexts for this host.

  ### Fields inherited from class Mapper.MapElement

  `name, object`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MappedHost(String name, Host host)`
  Constructor used for the primary Host
  `MappedHost(String alias, Mapper.MappedHost realHost)`
  Constructor used for an Alias

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addAlias(Mapper.MappedHost alias)`
  Add an alias.
  `void`
  `addAliases(Collection<? extends Mapper.MappedHost> c)`
  Add aliases.
  `Collection<Mapper.MappedHost>`
  `getAliases()`
  Get the aliases.
  `Mapper.MappedHost`
  `getRealHost()`
  Get the real host.
  `String`
  `getRealHostName()`
  Get the real host name.
  `boolean`
  `isAlias()`
  Check if this is an alias.
  `void`
  `removeAlias(Mapper.MappedHost alias)`
  Remove an alias.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### contextList

    public volatile Mapper.ContextList contextList
    The list of contexts for this host.

- ## Constructor Details

  - ### MappedHost

    public MappedHost(String name, Host host)
    Constructor used for the primary Host
    Parameters:
      `name` - The name of the virtual host
      `host` - The host

  - ### MappedHost

    public MappedHost(String alias, Mapper.MappedHost realHost)
    Constructor used for an Alias
    Parameters:
      `alias` - The alias of the virtual host
      `realHost` - The host the alias points to

- ## Method Details

  - ### isAlias

    public boolean isAlias()
    Check if this is an alias.
    Returns:
      true if this is an alias

  - ### getRealHost

    public Mapper.MappedHost getRealHost()
    Get the real host.
    Returns:
      the real host

  - ### getRealHostName

    public String getRealHostName()
    Get the real host name.
    Returns:
      the real host name

  - ### getAliases

    public Collection<Mapper.MappedHost> getAliases()
    Get the aliases.
    Returns:
      the aliases

  - ### addAlias

    public void addAlias(Mapper.MappedHost alias)
    Add an alias.
    Parameters:
      `alias` - the alias to add

  - ### addAliases

    public void addAliases(Collection<? extends Mapper.MappedHost> c)
    Add aliases.
    Parameters:
      `c` - the aliases to add

  - ### removeAlias

    public void removeAlias(Mapper.MappedHost alias)
    Remove an alias.
    Parameters:
      `alias` - the alias to remove