public class VHostItem extends RepositoryItemAbstract
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=100It also possible to set forwarding for the domain:
--virt-hosts = test.tigase.org:pres-forw=lpart@domain/res:mess-forw=lpart@domain/resPlease note, forwarding address set this way cannot contain any of characters: [,:=] The order features are set for domain is unimportant. Created: 22 Nov 2008
| 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 |
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.
|
static String |
DOMAIN_FILTER_POLICY_ATT
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 |
TLS_REQUIRED_ATT
Field description
|
static String |
TLS_REQUIRED_LABEL
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
|
ADMINS_ATT, ADMINS_LABEL, OWNER_ATT, OWNER_LABEL| Constructor and Description |
|---|
VHostItem()
Constructs ...
|
VHostItem(tigase.xml.Element elem)
The constructor creates the
VHostItem instance from a given
XML element. |
VHostItem(tigase.xmpp.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. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCommandFields(Packet packet)
Method description
|
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. |
DomainFilterPolicy |
getDomainFilter()
Method description
|
String |
getElemName()
Method description
|
String |
getKey()
Method description
|
long |
getMaxUsersNumber()
This method returns the maximum number of user accounts allowed for this
domain.
|
tigase.xmpp.JID |
getMessageForward() |
tigase.xmpp.JID |
getMessageForwardAddress()
Method description
|
String |
getOtherDomainParams()
This method allows to access the virtual domain other configuration
parameters.
|
tigase.xmpp.JID |
getPresenceForward() |
tigase.xmpp.JID |
getPresenceForwardAddress()
Method description
|
String |
getS2sSecret()
Method description
|
VHostItem |
getUnmodifiableVHostItem()
Method description
|
tigase.xmpp.JID |
getVhost()
This method return a virtual host name as a
String value. |
void |
initFromCommand(Packet packet)
Method description
|
void |
initFromElement(tigase.xml.Element elem)
Method description
|
void |
initFromPropertyString(String propString)
Method description
|
boolean |
isAnonymousEnabled()
This method checks whether anonymous login is enabled for this domain.
|
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.
|
void |
setAnonymousEnabled(boolean value)
This method allows to enable or disable anonymous logins for this domain.
|
void |
setComps(String[] comps)
Sets an array with the server component names by which packets to this
domain can be processed.
|
void |
setDomainFilter(DomainFilterPolicy domainFilter)
Method description
|
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(tigase.xmpp.JID messageForward) |
void |
setOtherDomainParams(String otherParams)
This method allows to set extra configuration parameters for the virtual
domain.
|
void |
setPresenceForward(tigase.xmpp.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 |
setTlsRequired(boolean value)
The method sets TLS required property for the vhost.
|
void |
setVHost(tigase.xmpp.JID vhost)
Method description
|
void |
setVHost(String vhost)
Method description
|
tigase.xml.Element |
toElement()
The method exports the
VHostItem object to XML representation. |
String |
toPropertyString()
Method description
|
String |
toString()
Method description
|
public static final String ANONYMOUS_ENABLED_ATT
public static final String ANONYMOUS_ENABLED_LABEL
public static final String COMPONENTS_ATT
public static final String COMPONENTS_ELEM
public static final String DOMAIN_FILTER_POLICY_ATT
public static final String DOMAIN_FILTER_POLICY_LABEL
public static final String ENABLED_ATT
public static final String ENABLED_LABEL
public static final String HOSTNAME_ATT
public static final String HOSTNAME_LABEL
public static final String MAX_USERS_NUMBER_ATT
public static final String MAX_USERS_NUMBER_LABEL
public static final String MESSAGE_FORWARD_ADDRESS_ATT
public static final String MESSAGE_FORWARD_ADDRESS_LABEL
public static final String OTHER_PARAMS_ELEM
public static final String OTHER_PARAMS_LABEL
public static final String PRESENCE_FORWARD_ADDRESS_ATT
public static final String PRESENCE_FORWARD_ADDRESS_LABEL
public static final String REGISTER_ENABLED_ATT
public static final String REGISTER_ENABLED_LABEL
public static final String S2S_SECRET_ATT
public static final String S2S_SECRET_LABEL
public static final String TLS_REQUIRED_ATT
public static final String TLS_REQUIRED_LABEL
public static final String VHOST_ELEM
protected static final String DOMAIN_FILTER_POLICY_PROP_KEY
protected static final String S2S_SECRET_PROP_DEF
protected static final String S2S_SECRET_PROP_KEY
protected static final String VHOST_ANONYMOUS_ENABLED_PROP_KEY
protected static final Boolean VHOST_ANONYMOUS_ENABLED_PROP_DEF
protected static final String VHOST_MAX_USERS_PROP_KEY
protected static final Long VHOST_MAX_USERS_PROP_DEF
protected static final String VHOST_MESSAGE_FORWARD_PROP_DEF
protected static final String VHOST_MESSAGE_FORWARD_PROP_KEY
protected static final String VHOST_PRESENCE_FORWARD_PROP_DEF
protected static final String VHOST_PRESENCE_FORWARD_PROP_KEY
protected static final String VHOST_REGISTER_ENABLED_PROP_KEY
protected static final Boolean VHOST_REGISTER_ENABLED_PROP_DEF
protected static final String VHOST_TLS_REQUIRED_PROP_KEY
protected static final Boolean VHOST_TLS_REQUIRED_PROP_DEF
protected static final DomainFilterPolicy DOMAIN_FILTER_POLICY_PROP_DEF
protected static final String[] VHOST_OTHER_PARAMS_PATH
protected static final String[] VHOST_COMPONENTS_PATH
public VHostItem()
public VHostItem(tigase.xml.Element elem)
VHostItem instance from a given
XML element. Please refer to the class documentation for more details of
the XML element.elem - is an Element object with virtual domain settings.public VHostItem(tigase.xmpp.JID vhost)
VHostItem instance for a given
domain name with default values for all other parameters. By the default
all domain parameters are set to true.vhost - is a String value with a domain name.public VHostItem(String vhost) throws tigase.util.TigaseStringprepException
VHostItem instance for a given
domain name with default values for all other parameters. By the default
all domain parameters are set to true.vhost - is a String value with a domain name.tigase.util.TigaseStringprepException - if the provided string causes stringprep processing errors.public void addCommandFields(Packet packet)
addCommandFields in interface RepositoryItemaddCommandFields in class RepositoryItemAbstractpacket - public void initFromCommand(Packet packet)
initFromCommand in interface RepositoryIteminitFromCommand in class RepositoryItemAbstractpacket - public void initFromElement(tigase.xml.Element elem)
initFromElement in interface RepositoryIteminitFromElement in class RepositoryItemAbstractelem - public void initFromPropertyString(String propString)
propString - public tigase.xml.Element toElement()
VHostItem object to XML representation.toElement in interface RepositoryItemtoElement in class RepositoryItemAbstractElement object with vhost information.public String toPropertyString()
Stringpublic String toString()
public String[] getComps()
null (default) if there is no
specific component assigned to this domain.String[] object with server component names.public DomainFilterPolicy getDomainFilter()
DomainFilterPolicypublic String getElemName()
getElemName in class RepositoryItemAbstractStringpublic String getKey()
Stringpublic long getMaxUsersNumber()
long value indicating the maximum number of user
accounts allowed for this domain.public tigase.xmpp.JID getMessageForward()
public tigase.xmpp.JID getMessageForwardAddress()
JIDpublic String getOtherDomainParams()
String value with domain extra parameters.public tigase.xmpp.JID getPresenceForward()
public tigase.xmpp.JID getPresenceForwardAddress()
JIDpublic String getS2sSecret()
Stringpublic VHostItem getUnmodifiableVHostItem()
VHostItempublic tigase.xmpp.JID getVhost()
String value.String value with the virtual domain name.public boolean isAnonymousEnabled()
boolean value indicating whether anonymous logins
are allowed for this domain.public boolean isEnabled()
boolean value true if the domain is
enabled and false if the domain is disabled.public boolean isRegisterEnabled()
boolean value indicating whether user account
registration is allowed for this domain.public boolean isTlsRequired()
boolean value whether TLS is required for the vhost or not.public void setAnonymousEnabled(boolean value)
value - public void setComps(String[] comps)
VHostListener which returns true for
handlesLocalDomains() method call and by all components set
via this method.comps - is an String[] array with server component names.public void setDomainFilter(DomainFilterPolicy domainFilter)
domainFilter - public void setEnabled(boolean value)
value - public void setMaxUsersNumber(long maxUsersNumber)
0L.maxUsersNumber - is a long value specifying the maximum number of user
accounts allowed for this domain.public void setMessageForward(tigase.xmpp.JID messageForward)
messageForward - the messageForward to setpublic void setOtherDomainParams(String otherParams)
otherParams - is a String value with domain extra parameters.public void setPresenceForward(tigase.xmpp.JID presenceForward)
presenceForward - the presenceForward to setpublic void setRegisterEnabled(boolean value)
value - public void setS2sSecret(String s2sSecret)
s2sSecret - public void setTlsRequired(boolean value)
value - is a boolean parameter specifying whether TLS is required
for the virtual domain.public void setVHost(String vhost) throws tigase.util.TigaseStringprepException
vhost - tigase.util.TigaseStringprepExceptionpublic void setVHost(tigase.xmpp.JID vhost)
vhost - Copyright © 2013 Tigase. All rights reserved.