tigase.vhosts

## Class VHostItem

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

- All Implemented Interfaces:
    Comparable<VHostItem>, RepositoryItem

      public class VHostItem
      extends RepositoryItemAbstract
      implements Comparable<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
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `VHostItem.DataType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ANONYMOUS_ENABLED_ATT` This is an attribute name for storing information whether anonymous user can login for this domain.
    `static String` | `ANONYMOUS_ENABLED_LABEL` Field description
    `static String` | `C2S_PORTS_ALLOWED_ATT` This is an attribute name for storing information on which ports VHost should be enabled.
    `static String` | `C2S_PORTS_ALLOWED_LABEL` Field description
    `static String` | `COMPONENTS_ATT` Field description
    `static 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 Map<String,VHostItem.DataType>` | `dataTypes`
    `static String` | `DOMAIN_FILTER_POLICY_ATT` Field description
    `static String` | `DOMAIN_FILTER_POLICY_DOMAINS_ATT` Field description
    `static String` | `DOMAIN_FILTER_POLICY_DOMAINS_LABEL` Field description
    `static String` | `DOMAIN_FILTER_POLICY_LABEL` Field description
    `protected static DomainFilterPolicy` | `DOMAIN_FILTER_POLICY_PROP_DEF` Field description
    `protected static String` | `DOMAIN_FILTER_POLICY_PROP_KEY` Field description
    `static String` | `ENABLED_ATT` This is an attribute name for storing information whether the VHost is enabled or disabled.
    `static String` | `ENABLED_LABEL` Field description
    `static String` | `HOSTNAME_ATT` This is an attribute name for storing the VHost name.
    `static String` | `HOSTNAME_LABEL` Field description
    `static String` | `MAX_USERS_NUMBER_ATT` This is an attribute name for storing the maximum number of users for this virtual domain.
    `static String` | `MAX_USERS_NUMBER_LABEL` Field description
    `static String` | `MESSAGE_FORWARD_ADDRESS_ATT` Field description
    `static String` | `MESSAGE_FORWARD_ADDRESS_LABEL` Field description
    `static String` | `OTHER_PARAMS_ELEM` Element name for the VHostItem XML child keeping all the extra parameters for the domain.
    `static String` | `OTHER_PARAMS_LABEL` Field description
    `static String` | `PRESENCE_FORWARD_ADDRESS_ATT` Field description
    `static String` | `PRESENCE_FORWARD_ADDRESS_LABEL` Field description
    `static String` | `REGISTER_ENABLED_ATT` This is an attribute name for storing information whether user registration is allowed for this domain.
    `static String` | `REGISTER_ENABLED_LABEL` Field description
    `static String` | `S2S_SECRET_ATT` Field description
    `static String` | `S2S_SECRET_LABEL` Field description
    `protected static String` | `S2S_SECRET_PROP_DEF` Field description
    `protected static String` | `S2S_SECRET_PROP_KEY` Field description
    `static String` | `SASL_MECHANISM_ATT` List of SASL mechanisms allowed for domain
    `static String` | `SASL_MECHANISM_LABEL`
    `static String` | `TLS_REQUIRED_ATT` Field description
    `static String` | `TLS_REQUIRED_LABEL` Field description
    `static String` | `TRUSTED_JIDS_ATT` Field description
    `protected static Boolean` | `VHOST_ANONYMOUS_ENABLED_PROP_DEF` Field description
    `protected static String` | `VHOST_ANONYMOUS_ENABLED_PROP_KEY` Field description
    `protected static String[]` | `VHOST_COMPONENTS_PATH` Field description
    `static String` | `VHOST_ELEM` Element name to for the VHostItem XML storage.
    `protected static Long` | `VHOST_MAX_USERS_PROP_DEF` Field description
    `protected static String` | `VHOST_MAX_USERS_PROP_KEY` Field description
    `protected static String` | `VHOST_MESSAGE_FORWARD_PROP_DEF` Field description
    `protected static String` | `VHOST_MESSAGE_FORWARD_PROP_KEY` Field description
    `protected static String[]` | `VHOST_OTHER_PARAMS_PATH` Field description
    `protected static String` | `VHOST_PRESENCE_FORWARD_PROP_DEF` Field description
    `protected static String` | `VHOST_PRESENCE_FORWARD_PROP_KEY` Field description
    `protected static Boolean` | `VHOST_REGISTER_ENABLED_PROP_DEF` Field description
    `protected static String` | `VHOST_REGISTER_ENABLED_PROP_KEY` Field description
    `protected static Boolean` | `VHOST_TLS_REQUIRED_PROP_DEF` Field description
    `protected static String` | `VHOST_TLS_REQUIRED_PROP_KEY` Field description

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

      `ADMINS_ATT, ADMINS_LABEL, OWNER_ATT, OWNER_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VHostItem()` Constructs ...
    `VHostItem(Element elem)` The constructor creates the `VHostItem` instance from a given XML element.
    `VHostItem(JID vhost)` The constructor creates the `VHostItem` instance for a given domain name with default values for all other parameters.
    `VHostItem(String 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
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCommandFields(Packet packet)` The method is used for handling ad-hoc commands.
    `int` | `compareTo(VHostItem o)`
    `boolean` | `equals(Object v)`
    `int[]` | `getC2SPortsAllowed()` Returns an array with ports on which C2S connections for this VHosts are allowed.
    `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(String key)` Return value for key for this VHost
    `DomainFilterPolicy` | `getDomainFilter()` Method description
    `String[]` | `getDomainFilterDomains()`
    `String` | `getElemName()` Method description
    `String` | `getKey()` Returns a unique key for the item in the repository.
    `long` | `getMaxUsersNumber()` This method returns the maximum number of user accounts allowed for this domain.
    `JID` | `getMessageForward()`
    `JID` | `getMessageForwardAddress()` Method description
    `String` | `getOtherDomainParams()` This method allows to access the virtual domain other configuration parameters.
    `JID` | `getPresenceForward()`
    `JID` | `getPresenceForwardAddress()` Method description
    `String` | `getS2sSecret()` Method description
    `String[]` | `getSaslAllowedMechanisms()`
    `Set<String>` | `getTrustedJIDs()`
    `VHostItem` | `getUnmodifiableVHostItem()` Method description
    `JID` | `getVhost()` This method return a virtual host name as a `String` value.
    `int` | `hashCode()`
    `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(String propString)` The item can be initialized based on the data loaded from a configuration file.
    `protected static void` | `initGlobalTrustedJids()`
    `boolean` | `isAnonymousEnabled()` This method checks whether anonymous login is enabled for this domain.
    `boolean` | `isData(String key)` Get boolean value contained by this VHost for key
    `boolean` | `isEnabled()` Checks whether this domain is set as enabled or not.
    `boolean` | `isRegisterEnabled()` The method checks whether user registration is enabled for this domain or not.
    `boolean` | `isTlsRequired()` The method returns TLS required settings for the vhost.
    `boolean` | `isTrustedJID(JID jid)`
    `void` | `parseDataValue(String key, String valueStr)`
    `static void` | `registerData(List<VHostItem.DataType> types)`
    `void` | `setAnonymousEnabled(boolean value)` This method allows to enable or disable anonymous logins for this domain.
    `void` | `setC2SPortsAllowed(int[] ports)` Sets an array of ports for which C2S connections for this VHost will be allowed.
    `void` | `setComps(String[] comps)` Sets an array with the server component names by which packets to this domain can be processed.
    `void` | `setData(String key, Object value)` Set value for specified key for this VHost
    `void` | `setDomainFilter(DomainFilterPolicy domainFilter)` This method allow configure DomainFilterPolicy to be applied during packet filtering.
    `void` | `setDomainFilterDomains(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)` This method allows to enable or disable local domain.
    `void` | `setMaxUsersNumber(long maxUsersNumber)` This method allows to set the maximum number of user accounts allowed for this domain.
    `void` | `setMessageForward(JID messageForward)`
    `void` | `setOtherDomainParams(String otherParams)` This method allows to set extra configuration parameters for the virtual domain.
    `void` | `setPresenceForward(JID presenceForward)`
    `void` | `setRegisterEnabled(boolean value)` This method allows to enable or disable user account registration for this domain.
    `void` | `setS2sSecret(String s2sSecret)` Method description
    `void` | `setSaslAllowedMechanisms(String[] saslAllowedMechanisms)`
    `void` | `setTlsRequired(boolean value)` The method sets TLS required property for the vhost.
    `void` | `setTrustedJIDs(JID[] trustedJids)`
    `void` | `setVHost(JID vhost)` Method description
    `void` | `setVHost(String vhost)` Method description
    `Element` | `toElement()` Item data can be stored in a more complex form than a simple property string.
    `String` | `toPropertyString()` The item can be initialized based on the data loaded from a configuration file.
    `String` | `toString()`

    - ### 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`

- - ### Field Detail

    - #### ANONYMOUS_ENABLED_ATT

          public static final String ANONYMOUS_ENABLED_ATT

      This is an attribute name for storing information whether anonymous user can login for this domain.
      See Also:
        Constant Field Values

    - #### ANONYMOUS_ENABLED_LABEL

          public static final String ANONYMOUS_ENABLED_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### SASL_MECHANISM_ATT

          public static final String SASL_MECHANISM_ATT

      List of SASL mechanisms allowed for domain
      See Also:
        Constant Field Values

    - #### SASL_MECHANISM_LABEL

          public static final String SASL_MECHANISM_LABEL

      See Also:
        Constant Field Values

    - #### COMPONENTS_ATT

          public static final String COMPONENTS_ATT

      Field description
      See Also:
        Constant Field Values

    - #### COMPONENTS_ELEM

          public static final 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 String C2S_PORTS_ALLOWED_ATT

      This is an attribute name for storing information on which ports VHost should be enabled.
      See Also:
        Constant Field Values

    - #### C2S_PORTS_ALLOWED_LABEL

          public static final String C2S_PORTS_ALLOWED_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_ATT

          public static final String DOMAIN_FILTER_POLICY_ATT

      Field description
      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_DOMAINS_ATT

          public static final String DOMAIN_FILTER_POLICY_DOMAINS_ATT

      Field description
      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_LABEL

          public static final String DOMAIN_FILTER_POLICY_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_DOMAINS_LABEL

          public static final String DOMAIN_FILTER_POLICY_DOMAINS_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### ENABLED_ATT

          public static final String ENABLED_ATT

      This is an attribute name for storing information whether the VHost is enabled or disabled.
      See Also:
        Constant Field Values

    - #### ENABLED_LABEL

          public static final String ENABLED_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### HOSTNAME_ATT

          public static final String HOSTNAME_ATT

      This is an attribute name for storing the VHost name.
      See Also:
        Constant Field Values

    - #### HOSTNAME_LABEL

          public static final String HOSTNAME_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### MAX_USERS_NUMBER_ATT

          public static final String MAX_USERS_NUMBER_ATT

      This is an attribute name for storing the maximum number of users for this virtual domain.
      See Also:
        Constant Field Values

    - #### MAX_USERS_NUMBER_LABEL

          public static final String MAX_USERS_NUMBER_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### MESSAGE_FORWARD_ADDRESS_ATT

          public static final String MESSAGE_FORWARD_ADDRESS_ATT

      Field description
      See Also:
        Constant Field Values

    - #### MESSAGE_FORWARD_ADDRESS_LABEL

          public static final String MESSAGE_FORWARD_ADDRESS_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### OTHER_PARAMS_ELEM

          public static final String OTHER_PARAMS_ELEM

      Element name for the VHostItem XML child keeping all the extra parameters for the domain. This is a container for future extensions and parameters which are not defined yet.
      See Also:
        Constant Field Values

    - #### OTHER_PARAMS_LABEL

          public static final String OTHER_PARAMS_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### PRESENCE_FORWARD_ADDRESS_ATT

          public static final String PRESENCE_FORWARD_ADDRESS_ATT

      Field description
      See Also:
        Constant Field Values

    - #### PRESENCE_FORWARD_ADDRESS_LABEL

          public static final String PRESENCE_FORWARD_ADDRESS_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### REGISTER_ENABLED_ATT

          public static final String REGISTER_ENABLED_ATT

      This is an attribute name for storing information whether user registration is allowed for this domain.
      See Also:
        Constant Field Values

    - #### REGISTER_ENABLED_LABEL

          public static final String REGISTER_ENABLED_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### S2S_SECRET_ATT

          public static final String S2S_SECRET_ATT

      Field description
      See Also:
        Constant Field Values

    - #### S2S_SECRET_LABEL

          public static final String S2S_SECRET_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### TLS_REQUIRED_ATT

          public static final String TLS_REQUIRED_ATT

      Field description
      See Also:
        Constant Field Values

    - #### TLS_REQUIRED_LABEL

          public static final String TLS_REQUIRED_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### TRUSTED_JIDS_ATT

          public static final String TRUSTED_JIDS_ATT

      Field description
      See Also:
        Constant Field Values

    - #### VHOST_ELEM

          public static final String VHOST_ELEM

      Element name to for the VHostItem XML storage.
      See Also:
        Constant Field Values

    - #### DOMAIN_FILTER_POLICY_PROP_KEY

          protected static final String DOMAIN_FILTER_POLICY_PROP_KEY

      Field description
      See Also:
        Constant Field Values

    - #### S2S_SECRET_PROP_DEF

          protected static final String S2S_SECRET_PROP_DEF

      Field description

    - #### S2S_SECRET_PROP_KEY

          protected static final String S2S_SECRET_PROP_KEY

      Field description
      See Also:
        Constant Field Values

    - #### VHOST_ANONYMOUS_ENABLED_PROP_KEY

          protected static final String VHOST_ANONYMOUS_ENABLED_PROP_KEY

      Field description
      See Also:
        Constant Field Values

    - #### VHOST_ANONYMOUS_ENABLED_PROP_DEF

          protected static final Boolean VHOST_ANONYMOUS_ENABLED_PROP_DEF

      Field description

    - #### VHOST_MAX_USERS_PROP_KEY

          protected static final String VHOST_MAX_USERS_PROP_KEY

      Field description
      See Also:
        Constant Field Values

    - #### VHOST_MAX_USERS_PROP_DEF

          protected static final Long VHOST_MAX_USERS_PROP_DEF

      Field description

    - #### VHOST_MESSAGE_FORWARD_PROP_DEF

          protected static final String VHOST_MESSAGE_FORWARD_PROP_DEF

      Field description

    - #### VHOST_MESSAGE_FORWARD_PROP_KEY

          protected static final String VHOST_MESSAGE_FORWARD_PROP_KEY

      Field description
      See Also:
        Constant Field Values

    - #### VHOST_PRESENCE_FORWARD_PROP_DEF

          protected static final String VHOST_PRESENCE_FORWARD_PROP_DEF

      Field description

    - #### VHOST_PRESENCE_FORWARD_PROP_KEY

          protected static final String VHOST_PRESENCE_FORWARD_PROP_KEY

      Field description
      See Also:
        Constant Field Values

    - #### VHOST_REGISTER_ENABLED_PROP_KEY

          protected static final String VHOST_REGISTER_ENABLED_PROP_KEY

      Field description
      See Also:
        Constant Field Values

    - #### VHOST_REGISTER_ENABLED_PROP_DEF

          protected static final Boolean VHOST_REGISTER_ENABLED_PROP_DEF

      Field description

    - #### VHOST_TLS_REQUIRED_PROP_KEY

          protected static final String VHOST_TLS_REQUIRED_PROP_KEY

      Field description
      See Also:
        Constant Field Values

    - #### VHOST_TLS_REQUIRED_PROP_DEF

          protected static final Boolean VHOST_TLS_REQUIRED_PROP_DEF

      Field description

    - #### DOMAIN_FILTER_POLICY_PROP_DEF

          protected static final DomainFilterPolicy DOMAIN_FILTER_POLICY_PROP_DEF

      Field description

    - #### VHOST_OTHER_PARAMS_PATH

          protected static final String[] VHOST_OTHER_PARAMS_PATH

      Field description

    - #### VHOST_COMPONENTS_PATH

          protected static final String[] VHOST_COMPONENTS_PATH

      Field description

    - #### dataTypes

          protected static final Map<String,VHostItem.DataType> dataTypes

  - ### Constructor Detail

    - #### VHostItem

          public VHostItem()

      Constructs ...

    - #### VHostItem

          public VHostItem(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.

    - #### VHostItem

          public VHostItem(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.

    - #### VHostItem

          public VHostItem(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

          public static void registerData(List<VHostItem.DataType> types)

    - #### initGlobalTrustedJids

          protected static void initGlobalTrustedJids()

    - #### 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

    - #### compareTo

          public int compareTo(VHostItem o)

      Specified by:
        `compareTo` in interface `Comparable<VHostItem>`

    - #### equals

          public boolean equals(Object v)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `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.

    - #### initFromPropertyString

          public void initFromPropertyString(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()

      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.
      The method exports the `VHostItem` object to XML representation.
      Specified by:
        `toElement` in interface `RepositoryItem`
      Overrides:
        `toElement` in class `RepositoryItemAbstract`
      Returns:
        an `Element` object with VHost information.

    - #### toPropertyString

          public 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 String toString()

      Overrides:
        `toString` in class `Object`

    - #### getComps

          public 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.
      Returns:
        a `String[]` object with server component names.

    - #### getC2SPortsAllowed

          public int[] getC2SPortsAllowed()

      Returns an array with ports on which C2S connections for this VHosts are allowed.
      Returns:
        a `int[]` object with allowed C2S ports.

    - #### getData

          public <T> T getData(String key)

      Return value for key for this VHost
      Type Parameters:
        `T` -
      Parameters:
        `key` -
      Returns:

    - #### getDomainFilter

          public DomainFilterPolicy getDomainFilter()

      Method description
      Returns:
        a value of `DomainFilterPolicy`

    - #### getDomainFilterDomains

          public String[] getDomainFilterDomains()

    - #### getElemName

          public String getElemName()

      Description copied from class: `RepositoryItemAbstract`
      Method description
      Specified by:
        `getElemName` in class `RepositoryItemAbstract`

    - #### getKey

          public 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 long getMaxUsersNumber()

      This method returns the maximum number of user accounts allowed for this domain. This parameter is to allow for limiting number of users on per domain basis.
      Returns:
        a `long` value indicating the maximum number of user accounts allowed for this domain.

    - #### getMessageForward

          public JID getMessageForward()

      Returns:
        the messageForward

    - #### getMessageForwardAddress

          public JID getMessageForwardAddress()

      Method description
      Returns:
        a value of `JID`

    - #### getOtherDomainParams

          public 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.
      Returns:
        a `String` value with domain extra parameters.

    - #### getPresenceForward

          public JID getPresenceForward()

      Returns:
        the presenceForward

    - #### getPresenceForwardAddress

          public JID getPresenceForwardAddress()

      Method description
      Returns:
        a value of `JID`

    - #### getS2sSecret

          public String getS2sSecret()

      Method description
      Returns:
        a value of `String`

    - #### getTrustedJIDs

          public Set<String> getTrustedJIDs()

    - #### getUnmodifiableVHostItem

          public VHostItem getUnmodifiableVHostItem()

      Method description
      Returns:
        a value of `VHostItem`

    - #### getVhost

          public JID getVhost()

      This method return a virtual host name as a `String` value.
      Returns:
        a `String` value with the virtual domain name.

    - #### isAnonymousEnabled

          public boolean isAnonymousEnabled()

      This method checks whether anonymous login is enabled for this domain. This is the domain own configuration parameter which allows to disable anonymous logins on per domain basis.
      Returns:
        a `boolean` value indicating whether anonymous logins are allowed for this domain.

    - #### isData

          public boolean isData(String key)

      Get boolean value contained by this VHost for key
      Parameters:
        `key` -
      Returns:

    - #### isEnabled

          public boolean isEnabled()

      Checks whether this domain is set as enabled or not. This is domain own configuration parameter which allows to temporarly disable domain so packets for this domain are not processed normally. Instead the server returns an error.
      Returns:
        a `boolean` value `true` if the domain is enabled and `false` if the domain is disabled.

    - #### isRegisterEnabled

          public boolean isRegisterEnabled()

      The method checks whether user registration is enabled for this domain or not. This is the domain own configuration parameter which allows to disable user accounts registration via XMPP per domain basis.
      Returns:
        a `boolean` value indicating whether user account registration is allowed for this domain.

    - #### isTlsRequired

          public boolean isTlsRequired()

      The method returns TLS required settings for the vhost.
      Returns:
        a `boolean` value whether TLS is required for the vhost or not.

    - #### isTrustedJID

          public boolean isTrustedJID(JID jid)

    - #### setAnonymousEnabled

          public void setAnonymousEnabled(boolean value)

      This method allows to enable or disable anonymous logins for this domain. By default anonymous logins are enabled.
      Parameters:
        `value` -

    - #### setComps

          public void setComps(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.

    - #### setC2SPortsAllowed

          public void setC2SPortsAllowed(int[] ports)

      Sets an array of ports for which C2S connections for this VHost will be allowed.
      Parameters:
        `ports` - is an `int[]` array of allowed C2S ports.

    - #### setData

          public void setData(String key,
                              Object value)

      Set value for specified key for this VHost
      Parameters:
        `key` -
        `value` -

    - #### parseDataValue

          public void parseDataValue(String key,
                                     String valueStr)

    - #### 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

    - #### setDomainFilterDomains

          public void setDomainFilterDomains(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

    - #### setEnabled

          public void setEnabled(boolean value)

      This method allows to enable or disable local domain. If the domain is disabled packets sent for this domain are not processed normally, instead the server returns an error to the sender. Domain is enabled by default.
      Parameters:
        `value` -

    - #### setMaxUsersNumber

          public void setMaxUsersNumber(long maxUsersNumber)

      This method allows to set the maximum number of user accounts allowed for this domain. The default value of this parameter is: `0L`.
      Parameters:
        `maxUsersNumber` - is a `long` value specifying the maximum number of user accounts allowed for this domain.

    - #### setMessageForward

          public void setMessageForward(JID messageForward)

      Parameters:
        `messageForward` - the messageForward to set

    - #### setOtherDomainParams

          public void setOtherDomainParams(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.

    - #### setPresenceForward

          public void setPresenceForward(JID presenceForward)

      Parameters:
        `presenceForward` - the presenceForward to set

    - #### setRegisterEnabled

          public void setRegisterEnabled(boolean value)

      This method allows to enable or disable user account registration for this domain. By default user account registration is enabled.
      Parameters:
        `value` -

    - #### setS2sSecret

          public void setS2sSecret(String s2sSecret)

      Method description
      Parameters:
        `s2sSecret` -

    - #### setTlsRequired

          public void setTlsRequired(boolean value)

      The method sets TLS required property for the vhost. By default TLS is not required.
      Parameters:
        `value` - is a `boolean` parameter specifying whether TLS is required for the virtual domain.

    - #### setTrustedJIDs

          public void setTrustedJIDs(JID[] trustedJids)

    - #### setVHost

          public void setVHost(String vhost)
                        throws TigaseStringprepException

      Method description
      Parameters:
        `vhost` -
      Throws:
        `TigaseStringprepException`

    - #### setVHost

          public void setVHost(JID vhost)

      Method description
      Parameters:
        `vhost` -

    - #### getSaslAllowedMechanisms

          public String[] getSaslAllowedMechanisms()

      Returns:
        the saslAllowedMechanisms

    - #### setSaslAllowedMechanisms

          public void setSaslAllowedMechanisms(String[] saslAllowedMechanisms)

      Parameters:
        `saslAllowedMechanisms` - the saslAllowedMechanisms to set

Copyright © 2022 "Tigase, Inc.". All rights reserved.