Package tigase.vhosts

## Class VHostItemImpl

- java.lang.Object
- - tigase.db.comp.RepositoryItemAbstract
  - - tigase.vhosts.VHostItemImpl

- All Implemented Interfaces:
    `java.lang.Comparable<VHostItem>`, `RepositoryItem`, `VHostItem`

      public class VHostItemImpl
      extends RepositoryItemAbstract
      implements VHostItem

  Objects of this class represent virtual host with all hosts configuration settings. In most cases simple domain name string is not enough to deal with the virtual host. VHost can be enabled/disabled. Can be available to selected server components only and so on. Therefore every time there is a detailed information needed for a vhost this classed must be used.
  This class has it's own XML representation which can be used for creating an instance of the class or can be exported to the XML form for permanent storage:
  `<vhost hostname="vhost.something.com" enabled="true" anon="true" register="true" max-users="99999999999L"> <comps/> <other/>`
  From the init.property file it is also possible to set additional parameters for the vhost. By default everything is enabled and max accounts set to unlimited. In the example below we configure 2 domains: devel.tigase.org and test.tigase.org. For the first domain there are no additional settings, hence the domain has everything on by default, whereas the second has everything switched off and max user accounts set to 100.

       --virt-hosts = devel.tigase.org,test.tigase.org:-anon:-register:max-users=100

  It also possible to set forwarding for the domain:

       --virt-hosts = test.tigase.org:pres-forw=lpart@domain/res:mess-forw=lpart@domain/res

  Please note, forwarding address set this way cannot contain any of characters: [,:=] The order features are set for domain is unimportant.
  Created: 22 Nov 2008
  Author:
    Artur Hefczyc

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `VHostItemImpl.DataType` |
    `protected static class` | `VHostItemImpl.VHostItemWrapper` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `ANONYMOUS_ENABLED_ATT` |
    `static java.lang.String` | `ANONYMOUS_ENABLED_LABEL` |
    `static java.lang.String` | `C2S_PORTS_ALLOWED_ATT` |
    `static java.lang.String` | `C2S_PORTS_ALLOWED_LABEL` |
    `static java.lang.String` | `COMPONENTS_ATT` |
    `static java.lang.String` | `COMPONENTS_ELEM` | Element name for the VHostItem XML child keeping list of the server component which can handle packets for this domain.
    `protected static java.util.Map<java.lang.String,​VHostItemImpl.DataType>` | `dataTypes` |
    `static java.lang.String` | `DOMAIN_FILTER_POLICY_ATT` |
    `static java.lang.String` | `DOMAIN_FILTER_POLICY_DOMAINS_ATT` |
    `static java.lang.String` | `DOMAIN_FILTER_POLICY_DOMAINS_LABEL` |
    `static java.lang.String` | `DOMAIN_FILTER_POLICY_LABEL` |
    `protected static DomainFilterPolicy` | `DOMAIN_FILTER_POLICY_PROP_DEF` |
    `protected static java.lang.String` | `DOMAIN_FILTER_POLICY_PROP_KEY` |
    `static java.lang.String` | `ENABLED_ATT` |
    `static java.lang.String` | `ENABLED_LABEL` |
    `static java.lang.String` | `HOSTNAME_ATT` |
    `static java.lang.String` | `HOSTNAME_LABEL` |
    `static java.lang.String` | `MAX_USERS_NUMBER_ATT` |
    `static java.lang.String` | `MAX_USERS_NUMBER_LABEL` |
    `static java.lang.String` | `MESSAGE_FORWARD_ADDRESS_ATT` |
    `static java.lang.String` | `MESSAGE_FORWARD_ADDRESS_LABEL` |
    `static java.lang.String` | `OTHER_PARAMS_ELEM` |
    `static java.lang.String` | `OTHER_PARAMS_LABEL` |
    `static java.lang.String` | `PRESENCE_FORWARD_ADDRESS_ATT` |
    `static java.lang.String` | `PRESENCE_FORWARD_ADDRESS_LABEL` |
    `static java.lang.String` | `REGISTER_ENABLED_ATT` |
    `static java.lang.String` | `REGISTER_ENABLED_LABEL` |
    `static java.lang.String` | `S2S_SECRET_ATT` |
    `static java.lang.String` | `S2S_SECRET_LABEL` |
    `protected static java.lang.String` | `S2S_SECRET_PROP_DEF` |
    `protected static java.lang.String` | `S2S_SECRET_PROP_KEY` |
    `static java.lang.String` | `SASL_MECHANISM_ATT` |
    `static java.lang.String` | `SASL_MECHANISM_LABEL` |
    `static java.lang.String` | `TLS_REQUIRED_ATT` |
    `static java.lang.String` | `TLS_REQUIRED_LABEL` |
    `static java.lang.String` | `TRUSTED_JIDS_LABEL` |
    `protected static java.lang.Boolean` | `VHOST_ANONYMOUS_ENABLED_PROP_DEF` |
    `protected static java.lang.String` | `VHOST_ANONYMOUS_ENABLED_PROP_KEY` |
    `protected static java.lang.String[]` | `VHOST_COMPONENTS_PATH` |
    `static java.lang.String` | `VHOST_ELEM` |
    `protected static java.lang.Long` | `VHOST_MAX_USERS_PROP_DEF` |
    `protected static java.lang.String` | `VHOST_MAX_USERS_PROP_KEY` |
    `protected static java.lang.String` | `VHOST_MESSAGE_FORWARD_PROP_DEF` |
    `protected static java.lang.String` | `VHOST_MESSAGE_FORWARD_PROP_KEY` |
    `protected static java.lang.String[]` | `VHOST_OTHER_PARAMS_PATH` |
    `protected static java.lang.String` | `VHOST_PRESENCE_FORWARD_PROP_DEF` |
    `protected static java.lang.String` | `VHOST_PRESENCE_FORWARD_PROP_KEY` |
    `protected static java.lang.Boolean` | `VHOST_REGISTER_ENABLED_PROP_DEF` |
    `protected static java.lang.String` | `VHOST_REGISTER_ENABLED_PROP_KEY` |
    `protected static java.lang.Boolean` | `VHOST_TLS_REQUIRED_PROP_DEF` |
    `protected static java.lang.String` | `VHOST_TLS_REQUIRED_PROP_KEY` |

    - ### Fields inherited from class tigase.db.comp.RepositoryItemAbstract

      `ADMINS_ATT, ADMINS_LABEL, OWNER_ATT, OWNER_LABEL`

    - ### Fields inherited from interface tigase.vhosts.VHostItem

      `DEF_VHOST_KEY`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `VHostItemImpl()` |
    `VHostItemImpl​(java.lang.String vhost)` | The constructor creates the `VHostItem` instance for a given domain name with default values for all other parameters.
    `VHostItemImpl​(Element elem)` | The constructor creates the `VHostItem` instance from a given XML element.
    `VHostItemImpl​(JID vhost)` | The constructor creates the `VHostItem` instance for a given domain name with default values for all other parameters.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addCommandFields​(Packet packet)` | The method is used for handling ad-hoc commands.
    `boolean` | `equals​(java.lang.Object v)` |
    `int[]` | `getC2SPortsAllowed()` | Returns an array with ports on which C2S connections for this VHosts are allowed.
    `java.lang.String[]` | `getComps()` | Returns an array with the server components names which should process packets sent to this domain or `null` (default) if there is no specific component assigned to this domain.
    `<T> T` | `getData​(java.lang.String key)` | Deprecated.
    `DomainFilterPolicy` | `getDomainFilter()` |
    `java.lang.String[]` | `getDomainFilterDomains()` |
    `java.lang.String` | `getElemName()` |
    `<T extends VHostItemExtension> T` | `getExtension​(java.lang.Class<T> clazz)` |
    `java.util.Set<java.lang.Class<? extends VHostItemExtension>>` | `getExtensionClasses()` |
    `<T extends VHostItemExtension> java.util.Set<T>` | `getExtensions()` |
    `java.lang.String` | `getKey()` | Returns a unique key for the item in the repository.
    `java.lang.Long` | `getMaxUsersNumber()` |
    `JID` | `getMessageForward()` |
    `JID` | `getMessageForwardAddress()` |
    `java.lang.String` | `getOtherDomainParams()` | This method allows to access the virtual domain other configuration parameters.
    `JID` | `getPresenceForward()` |
    `JID` | `getPresenceForwardAddress()` |
    `java.lang.String` | `getS2sSecret()` |
    `java.lang.String[]` | `getSaslAllowedMechanisms()` |
    `java.util.Set<java.lang.String>` | `getTrustedJIDs()` |
    `JID` | `getVhost()` |
    `int` | `hashCode()` |
    `protected VHostItemExtension` | `initExtension​(VHostItemExtension extension)` |
    `void` | `initFromCommand​(Packet packet)` | The method used for handling ad-hoc commands.
    `void` | `initFromElement​(Element elem)` | The item can be also initialized from a more complex repositories: XML repository or SQL database.
    `void` | `initFromPropertyString​(java.lang.String propString)` | The item can be initialized based on the data loaded from a configuration file.
    `protected void` | `initializeFromDefaults​(VHostItemDefaults vhostDefaults)` |
    `boolean` | `isAnonymousEnabled()` |
    `boolean` | `isData​(java.lang.String key)` | Deprecated.
    `protected boolean` | `isDefault()` |
    `boolean` | `isEnabled()` |
    `boolean` | `isRegisterEnabled()` |
    `boolean` | `isTlsRequired()` |
    `void` | `parseDataValue​(java.lang.String key, java.lang.String valueStr)` |
    `static void` | `registerData​(java.util.List<VHostItemImpl.DataType> types)` | Deprecated.
    `void` | `setAnonymousEnabled​(boolean value)` |
    `void` | `setC2SPortsAllowed​(int[] ports)` |
    `void` | `setComps​(java.lang.String[] comps)` | Sets an array with the server component names by which packets to this domain can be processed.
    `void` | `setData​(java.lang.String key, java.lang.Object value)` |
    `void` | `setDomainFilter​(DomainFilterPolicy domainFilter)` | This method allow configure DomainFilterPolicy to be applied during packet filtering.
    `void` | `setDomainFilterDomains​(java.lang.String[] domainFilterDomains)` | This method allow specify list of domains that will be used for packet filtering when DomainFilteringPolicy is set to either LIST or BLACKLIST.
    `void` | `setEnabled​(boolean value)` |
    `protected void` | `setExtensionManager​(VHostItemExtensionManager extensionManager)` |
    `void` | `setKey​(java.lang.String key)` |
    `void` | `setMaxUsersNumber​(long maxUsersNumber)` |
    `void` | `setMessageForward​(JID messageForward)` |
    `void` | `setOtherDomainParams​(java.lang.String otherParams)` | This method allows to set extra configuration parameters for the virtual domain.
    `void` | `setPresenceForward​(JID presenceForward)` |
    `void` | `setRegisterEnabled​(boolean value)` |
    `void` | `setS2sSecret​(java.lang.String s2sSecret)` |
    `void` | `setSaslAllowedMechanisms​(java.lang.String[] saslAllowedMechanisms)` |
    `void` | `setTlsRequired​(boolean value)` |
    `void` | `setVHost​(java.lang.String vhost)` |
    `void` | `setVHost​(JID vhost)` |
    `Element` | `toElement()` | Item data can be stored in a more complex form than a simple property string.
    `java.lang.String` | `toPropertyString()` | The item can be initialized based on the data loaded from a configuration file.
    `java.lang.String` | `toString()` |
    `protected static java.lang.StringBuilder` | `toString​(VHostItem item)` |

    - ### Methods inherited from class tigase.db.comp.RepositoryItemAbstract

      `getAdmins, getOwner, isAdmin, isOwner, setAdmins, setOwner`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface tigase.db.comp.RepositoryItem

      `getAdmins, getOwner, isOwner, setAdmins, setOwner`

    - ### Methods inherited from interface tigase.vhosts.VHostItem

      `compareTo, isAdmin, isTrustedJID`

- - ### Field Detail

    - #### ANONYMOUS_ENABLED_ATT

          public static final java.lang.String ANONYMOUS_ENABLED_ATT

      See Also:
        Constant Field Values

    - #### ANONYMOUS_ENABLED_LABEL

          public static final java.lang.String ANONYMOUS_ENABLED_LABEL

      See Also:
        Constant Field Values

    - #### SASL_MECHANISM_ATT

          public static final java.lang.String SASL_MECHANISM_ATT

      See Also:
        Constant Field Values

    - #### SASL_MECHANISM_LABEL

          public static final java.lang.String SASL_MECHANISM_LABEL

      See Also:
        Constant Field Values

    - #### COMPONENTS_ATT

          public static final java.lang.String COMPONENTS_ATT

      See Also:
        Constant Field Values

    - #### COMPONENTS_ELEM

          public static final java.lang.String COMPONENTS_ELEM

      Element name for the VHostItem XML child keeping list of the server component which can handle packets for this domain. In most cases this element should be empty.
      See Also:
        Constant Field Values

    - #### C2S_PORTS_ALLOWED_ATT

          public static final java.lang.String C2S_PORTS_ALLOWED_ATT

      See Also:
        Constant Field Values

    - #### C2S_PORTS_ALLOWED_LABEL

          public static final java.lang.String C2S_PORTS_ALLOWED_LABEL

      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_ATT

          public static final java.lang.String DOMAIN_FILTER_POLICY_ATT

      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_DOMAINS_ATT

          public static final java.lang.String DOMAIN_FILTER_POLICY_DOMAINS_ATT

      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_LABEL

          public static final java.lang.String DOMAIN_FILTER_POLICY_LABEL

      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_DOMAINS_LABEL

          public static final java.lang.String DOMAIN_FILTER_POLICY_DOMAINS_LABEL

      See Also:
        Constant Field Values

    - #### ENABLED_ATT

          public static final java.lang.String ENABLED_ATT

      See Also:
        Constant Field Values

    - #### ENABLED_LABEL

          public static final java.lang.String ENABLED_LABEL

      See Also:
        Constant Field Values

    - #### HOSTNAME_ATT

          public static final java.lang.String HOSTNAME_ATT

      See Also:
        Constant Field Values

    - #### HOSTNAME_LABEL

          public static final java.lang.String HOSTNAME_LABEL

      See Also:
        Constant Field Values

    - #### MAX_USERS_NUMBER_ATT

          public static final java.lang.String MAX_USERS_NUMBER_ATT

      See Also:
        Constant Field Values

    - #### MAX_USERS_NUMBER_LABEL

          public static final java.lang.String MAX_USERS_NUMBER_LABEL

      See Also:
        Constant Field Values

    - #### MESSAGE_FORWARD_ADDRESS_ATT

          public static final java.lang.String MESSAGE_FORWARD_ADDRESS_ATT

      See Also:
        Constant Field Values

    - #### MESSAGE_FORWARD_ADDRESS_LABEL

          public static final java.lang.String MESSAGE_FORWARD_ADDRESS_LABEL

      See Also:
        Constant Field Values

    - #### OTHER_PARAMS_ELEM

          public static final java.lang.String OTHER_PARAMS_ELEM

      See Also:
        Constant Field Values

    - #### OTHER_PARAMS_LABEL

          public static final java.lang.String OTHER_PARAMS_LABEL

      See Also:
        Constant Field Values

    - #### PRESENCE_FORWARD_ADDRESS_ATT

          public static final java.lang.String PRESENCE_FORWARD_ADDRESS_ATT

      See Also:
        Constant Field Values

    - #### PRESENCE_FORWARD_ADDRESS_LABEL

          public static final java.lang.String PRESENCE_FORWARD_ADDRESS_LABEL

      See Also:
        Constant Field Values

    - #### REGISTER_ENABLED_ATT

          public static final java.lang.String REGISTER_ENABLED_ATT

      See Also:
        Constant Field Values

    - #### REGISTER_ENABLED_LABEL

          public static final java.lang.String REGISTER_ENABLED_LABEL

      See Also:
        Constant Field Values

    - #### S2S_SECRET_ATT

          public static final java.lang.String S2S_SECRET_ATT

      See Also:
        Constant Field Values

    - #### S2S_SECRET_LABEL

          public static final java.lang.String S2S_SECRET_LABEL

      See Also:
        Constant Field Values

    - #### TLS_REQUIRED_ATT

          public static final java.lang.String TLS_REQUIRED_ATT

      See Also:
        Constant Field Values

    - #### TLS_REQUIRED_LABEL

          public static final java.lang.String TLS_REQUIRED_LABEL

      See Also:
        Constant Field Values

    - #### TRUSTED_JIDS_LABEL

          public static final java.lang.String TRUSTED_JIDS_LABEL

      See Also:
        Constant Field Values

    - #### VHOST_ELEM

          public static final java.lang.String VHOST_ELEM

      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_PROP_KEY

          protected static final java.lang.String DOMAIN_FILTER_POLICY_PROP_KEY

      See Also:
        Constant Field Values

    - #### S2S_SECRET_PROP_DEF

          protected static final java.lang.String S2S_SECRET_PROP_DEF

    - #### S2S_SECRET_PROP_KEY

          protected static final java.lang.String S2S_SECRET_PROP_KEY

      See Also:
        Constant Field Values

    - #### VHOST_ANONYMOUS_ENABLED_PROP_KEY

          protected static final java.lang.String VHOST_ANONYMOUS_ENABLED_PROP_KEY

      See Also:
        Constant Field Values

    - #### VHOST_ANONYMOUS_ENABLED_PROP_DEF

          protected static final java.lang.Boolean VHOST_ANONYMOUS_ENABLED_PROP_DEF

    - #### VHOST_MAX_USERS_PROP_KEY

          protected static final java.lang.String VHOST_MAX_USERS_PROP_KEY

      See Also:
        Constant Field Values

    - #### VHOST_MAX_USERS_PROP_DEF

          protected static final java.lang.Long VHOST_MAX_USERS_PROP_DEF

    - #### VHOST_MESSAGE_FORWARD_PROP_DEF

          protected static final java.lang.String VHOST_MESSAGE_FORWARD_PROP_DEF

    - #### VHOST_MESSAGE_FORWARD_PROP_KEY

          protected static final java.lang.String VHOST_MESSAGE_FORWARD_PROP_KEY

      See Also:
        Constant Field Values

    - #### VHOST_PRESENCE_FORWARD_PROP_DEF

          protected static final java.lang.String VHOST_PRESENCE_FORWARD_PROP_DEF

    - #### VHOST_PRESENCE_FORWARD_PROP_KEY

          protected static final java.lang.String VHOST_PRESENCE_FORWARD_PROP_KEY

      See Also:
        Constant Field Values

    - #### VHOST_REGISTER_ENABLED_PROP_KEY

          protected static final java.lang.String VHOST_REGISTER_ENABLED_PROP_KEY

      See Also:
        Constant Field Values

    - #### VHOST_REGISTER_ENABLED_PROP_DEF

          protected static final java.lang.Boolean VHOST_REGISTER_ENABLED_PROP_DEF

    - #### VHOST_TLS_REQUIRED_PROP_KEY

          protected static final java.lang.String VHOST_TLS_REQUIRED_PROP_KEY

      See Also:
        Constant Field Values

    - #### VHOST_TLS_REQUIRED_PROP_DEF

          protected static final java.lang.Boolean VHOST_TLS_REQUIRED_PROP_DEF

    - #### DOMAIN_FILTER_POLICY_PROP_DEF

          protected static final DomainFilterPolicy DOMAIN_FILTER_POLICY_PROP_DEF

    - #### VHOST_OTHER_PARAMS_PATH

          protected static final java.lang.String[] VHOST_OTHER_PARAMS_PATH

    - #### VHOST_COMPONENTS_PATH

          protected static final java.lang.String[] VHOST_COMPONENTS_PATH

    - #### dataTypes

          protected static final java.util.Map<java.lang.String,​VHostItemImpl.DataType> dataTypes

  - ### Constructor Detail

    - #### VHostItemImpl

          public VHostItemImpl()

    - #### VHostItemImpl

          public VHostItemImpl​(Element elem)

      The constructor creates the `VHostItem` instance from a given XML element. Please refer to the class documentation for more details of the XML element.
      Parameters:
        `elem` - is an `Element` object with virtual domain settings.

    - #### VHostItemImpl

          public VHostItemImpl​(JID vhost)

      The constructor creates the `VHostItem` instance for a given domain name with default values for all other parameters. By the default all domain parameters are set to true.
      Parameters:
        `vhost` - is a `String` value with a domain name.

    - #### VHostItemImpl

          public VHostItemImpl​(java.lang.String vhost)
                        throws TigaseStringprepException

      The constructor creates the `VHostItem` instance for a given domain name with default values for all other parameters. By the default all domain parameters are set to true.
      Parameters:
        `vhost` - is a `String` value with a domain name.
      Throws:
        `TigaseStringprepException` - if the provided string causes stringprep processing errors.

  - ### Method Detail

    - #### registerData

          @Deprecated
          public static void registerData​(java.util.List<VHostItemImpl.DataType> types)

      Deprecated.

    - #### isDefault

          protected boolean isDefault()

    - #### setExtensionManager

          protected void setExtensionManager​(VHostItemExtensionManager extensionManager)

    - #### addCommandFields

          public void addCommandFields​(Packet packet)

      Description copied from interface: `RepositoryItem`
      The method is used for handling ad-hoc commands. The 'empty' ad-hoc command packet is provided and the Item should fill it with fields for the user.
      Specified by:
        `addCommandFields` in interface `RepositoryItem`
      Overrides:
        `addCommandFields` in class `RepositoryItemAbstract`
      Parameters:
        `packet` - with empty ad-hoc command to fill with fields

    - #### equals

          public boolean equals​(java.lang.Object v)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### initFromCommand

          public void initFromCommand​(Packet packet)

      Description copied from interface: `RepositoryItem`
      The method used for handling ad-hoc commands. After a user fills all given field the ad-hoc command packet is passed back to the item to initialize it with data. Similar method to initFromElement(), but the data source is different.
      Specified by:
        `initFromCommand` in interface `RepositoryItem`
      Overrides:
        `initFromCommand` in class `RepositoryItemAbstract`
      Parameters:
        `packet` - with ad-hoc command filled by the user.

    - #### initFromElement

          public void initFromElement​(Element elem)

      Description copied from interface: `RepositoryItem`
      The item can be also initialized from a more complex repositories: XML repository or SQL database. In such a case more complex representation is prefered, possibly carrying more information about the item. The method is called to initialize the item with a data parsed from an XML representation of the repository.
      Specified by:
        `initFromElement` in interface `RepositoryItem`
      Overrides:
        `initFromElement` in class `RepositoryItemAbstract`
      Parameters:
        `elem` - XML Element with all the item initialization data.

    - #### initExtension

          protected VHostItemExtension initExtension​(VHostItemExtension extension)

    - #### setKey

          public void setKey​(java.lang.String key)

      Specified by:
        `setKey` in interface `VHostItem`
      Specified by:
        `setKey` in class `RepositoryItemAbstract`

    - #### initFromPropertyString

          public void initFromPropertyString​(java.lang.String propString)

      Description copied from interface: `RepositoryItem`
      The item can be initialized based on the data loaded from a configuration file. In such a case the item representation is usually very simplified as a list of parameters separated by a marker. Please note, usually each item is separated from another with a comma, therefore do not use a comma in the item property string. Double collon is commonly used alternative.
      Specified by:
        `initFromPropertyString` in interface `RepositoryItem`
      Parameters:
        `propString` - is a property string to initialize the RepositoryItem.

    - #### toElement

          public Element toElement()

      Description copied from interface: `RepositoryItem`
      Item data can be stored in a more complex form than a simple property string. The XML Element can contain much more detailed information about the element than the simplified form and is used to store the repository item in more advanced repositories then just property file. XML repository or SQL database can keep many records for repository item with as much detailed information as needed.
      Specified by:
        `toElement` in interface `RepositoryItem`
      Overrides:
        `toElement` in class `RepositoryItemAbstract`
      Returns:
        an XML Element with all the item initialization data.

    - #### toPropertyString

          public java.lang.String toPropertyString()

      Description copied from interface: `RepositoryItem`
      The item can be initialized based on the data loaded from a configuration file. In such a case the item representation is usually very simplified as a list of parameters separated by a marker. Please note, usually each item is separated from another with a comma, therefore do not use a comma in the item property string. Double collon is commonly used alternative.
      Specified by:
        `toPropertyString` in interface `RepositoryItem`
      Returns:
        a property string representing the repository item in a simplified form.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### toString

          protected static java.lang.StringBuilder toString​(VHostItem item)

    - #### getComps

          public java.lang.String[] getComps()

      Returns an array with the server components names which should process packets sent to this domain or `null` (default) if there is no specific component assigned to this domain.
      Specified by:
        `getComps` in interface `VHostItem`
      Returns:
        a `String[]` object with server component names.

    - #### setComps

          public void setComps​(java.lang.String[] comps)

      Sets an array with the server component names by which packets to this domain can be processed. Every local domain will be handled by `VHostListener` which returns `true` for `handlesLocalDomains()` method call and by all components set via this method.
      Parameters:
        `comps` - is an `String[]` array with server component names.

    - #### getC2SPortsAllowed

          public int[] getC2SPortsAllowed()

      Returns an array with ports on which C2S connections for this VHosts are allowed.
      Specified by:
        `getC2SPortsAllowed` in interface `VHostItem`
      Returns:
        a `int[]` object with allowed C2S ports.

    - #### setC2SPortsAllowed

          public void setC2SPortsAllowed​(int[] ports)

    - #### getData

          @Deprecated
          public <T> T getData​(java.lang.String key)

      Deprecated.
      Specified by:
        `getData` in interface `VHostItem`

    - #### getDomainFilter

          public DomainFilterPolicy getDomainFilter()

      Specified by:
        `getDomainFilter` in interface `VHostItem`

    - #### setDomainFilter

          public void setDomainFilter​(DomainFilterPolicy domainFilter)

      This method allow configure DomainFilterPolicy to be applied during packet filtering.
      Parameters:
        `domainFilter` - name of the DomainFilterPolicy to be applied

    - #### getDomainFilterDomains

          public java.lang.String[] getDomainFilterDomains()

      Specified by:
        `getDomainFilterDomains` in interface `VHostItem`

    - #### setDomainFilterDomains

          public void setDomainFilterDomains​(java.lang.String[] domainFilterDomains)

      This method allow specify list of domains that will be used for packet filtering when DomainFilteringPolicy is set to either LIST or BLACKLIST.
      Parameters:
        `domainFilterDomains` - array of domains to be applied during filtering

    - #### getElemName

          public java.lang.String getElemName()

      Specified by:
        `getElemName` in class `RepositoryItemAbstract`

    - #### getExtension

          public <T extends VHostItemExtension> T getExtension​(java.lang.Class<T> clazz)

      Specified by:
        `getExtension` in interface `VHostItem`

    - #### getExtensions

          public <T extends VHostItemExtension> java.util.Set<T> getExtensions()

      Specified by:
        `getExtensions` in interface `VHostItem`

    - #### getExtensionClasses

          public java.util.Set<java.lang.Class<? extends VHostItemExtension>> getExtensionClasses()

      Specified by:
        `getExtensionClasses` in interface `VHostItem`

    - #### getKey

          public java.lang.String getKey()

      Description copied from interface: `RepositoryItem`
      Returns a unique key for the item in the repository. All items are stored in a memory cache which is a Map. And the key returned by this method is the item identifier in the Map.
      Specified by:
        `getKey` in interface `RepositoryItem`
      Returns:
        an Item key.

    - #### getMaxUsersNumber

          public java.lang.Long getMaxUsersNumber()

      Specified by:
        `getMaxUsersNumber` in interface `VHostItem`

    - #### setMaxUsersNumber

          public void setMaxUsersNumber​(long maxUsersNumber)

    - #### getMessageForward

          public JID getMessageForward()

      Specified by:
        `getMessageForward` in interface `VHostItem`

    - #### setMessageForward

          public void setMessageForward​(JID messageForward)

    - #### getMessageForwardAddress

          public JID getMessageForwardAddress()

      Specified by:
        `getMessageForwardAddress` in interface `VHostItem`

    - #### getOtherDomainParams

          public java.lang.String getOtherDomainParams()

      This method allows to access the virtual domain other configuration parameters. This is future feature API and it is not used right now. It allows to access configuration parameters which are not specified at the time of API definition.
      Specified by:
        `getOtherDomainParams` in interface `VHostItem`
      Returns:
        a `String` value with domain extra parameters.

    - #### setOtherDomainParams

          public void setOtherDomainParams​(java.lang.String otherParams)

      This method allows to set extra configuration parameters for the virtual domain. This is future feature API and it is not used right now. It allows to access configuration parameters which are not specified at the time of API definition.
      Parameters:
        `otherParams` - is a `String` value with domain extra parameters.

    - #### getPresenceForward

          public JID getPresenceForward()

      Specified by:
        `getPresenceForward` in interface `VHostItem`

    - #### setPresenceForward

          public void setPresenceForward​(JID presenceForward)

    - #### getPresenceForwardAddress

          public JID getPresenceForwardAddress()

      Specified by:
        `getPresenceForwardAddress` in interface `VHostItem`

    - #### getS2sSecret

          public java.lang.String getS2sSecret()

      Specified by:
        `getS2sSecret` in interface `VHostItem`

    - #### setS2sSecret

          public void setS2sSecret​(java.lang.String s2sSecret)

    - #### getTrustedJIDs

          public java.util.Set<java.lang.String> getTrustedJIDs()

      Specified by:
        `getTrustedJIDs` in interface `VHostItem`

    - #### getVhost

          public JID getVhost()

      Specified by:
        `getVhost` in interface `VHostItem`

    - #### isAnonymousEnabled

          public boolean isAnonymousEnabled()

      Specified by:
        `isAnonymousEnabled` in interface `VHostItem`

    - #### setAnonymousEnabled

          public void setAnonymousEnabled​(boolean value)

    - #### isData

          @Deprecated
          public boolean isData​(java.lang.String key)

      Deprecated.
      Specified by:
        `isData` in interface `VHostItem`

    - #### isEnabled

          public boolean isEnabled()

      Specified by:
        `isEnabled` in interface `VHostItem`

    - #### setEnabled

          public void setEnabled​(boolean value)

    - #### isRegisterEnabled

          public boolean isRegisterEnabled()

      Specified by:
        `isRegisterEnabled` in interface `VHostItem`

    - #### setRegisterEnabled

          public void setRegisterEnabled​(boolean value)

    - #### isTlsRequired

          public boolean isTlsRequired()

      Specified by:
        `isTlsRequired` in interface `VHostItem`

    - #### setTlsRequired

          public void setTlsRequired​(boolean value)

    - #### setData

          public void setData​(java.lang.String key,
                              java.lang.Object value)

    - #### parseDataValue

          public void parseDataValue​(java.lang.String key,
                                     java.lang.String valueStr)

    - #### setVHost

          public void setVHost​(java.lang.String vhost)
                        throws TigaseStringprepException

      Throws:
        `TigaseStringprepException`

    - #### setVHost

          public void setVHost​(JID vhost)

    - #### getSaslAllowedMechanisms

          public java.lang.String[] getSaslAllowedMechanisms()

      Specified by:
        `getSaslAllowedMechanisms` in interface `VHostItem`

    - #### setSaslAllowedMechanisms

          public void setSaslAllowedMechanisms​(java.lang.String[] saslAllowedMechanisms)

    - #### initializeFromDefaults

          protected void initializeFromDefaults​(VHostItemDefaults vhostDefaults)