public class VHostItemImpl extends RepositoryItemAbstract implements VHostItem
<vhost hostname="vhost.something.com" enabled="true" anon="true" register="true" max-users="99999999999L">
<comps/> <other/>
--virt-hosts = devel.tigase.org,test.tigase.org:-anon:-register:max-users=100
--virt-hosts = test.tigase.org:pres-forw=lpart@domain/res:mess-forw=lpart@domain/res
Modifier and Type | Class and Description |
---|---|
static class |
VHostItemImpl.DataType |
protected static class |
VHostItemImpl.VHostItemWrapper |
ADMINS_ATT, ADMINS_LABEL, OWNER_ATT, OWNER_LABEL
DEF_VHOST_KEY
Constructor and Description |
---|
VHostItemImpl() |
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. |
VHostItemImpl(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)
The method is used for handling ad-hoc commands.
|
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)
Deprecated.
|
DomainFilterPolicy |
getDomainFilter() |
String[] |
getDomainFilterDomains() |
String |
getElemName() |
<T extends VHostItemExtension> |
getExtension(Class<T> clazz) |
Set<Class<? extends VHostItemExtension>> |
getExtensionClasses() |
<T extends VHostItemExtension> |
getExtensions() |
String |
getKey()
Returns a unique key for the item in the repository.
|
Long |
getMaxUsersNumber() |
JID |
getMessageForward() |
JID |
getMessageForwardAddress() |
String |
getOtherDomainParams()
This method allows to access the virtual domain other configuration parameters.
|
JID |
getPresenceForward() |
JID |
getPresenceForwardAddress() |
String |
getS2sSecret() |
String[] |
getSaslAllowedMechanisms() |
Set<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(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(String key)
Deprecated.
|
protected boolean |
isDefault() |
boolean |
isEnabled() |
boolean |
isRegisterEnabled() |
boolean |
isTlsRequired() |
void |
parseDataValue(String key,
String valueStr) |
static void |
registerData(List<VHostItemImpl.DataType> types)
Deprecated.
|
void |
setAnonymousEnabled(boolean value) |
void |
setC2SPortsAllowed(int[] ports) |
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) |
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) |
protected void |
setExtensionManager(VHostItemExtensionManager extensionManager) |
void |
setKey(String key) |
void |
setMaxUsersNumber(long maxUsersNumber) |
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) |
void |
setS2sSecret(String s2sSecret) |
void |
setSaslAllowedMechanisms(String[] saslAllowedMechanisms) |
void |
setTlsRequired(boolean value) |
void |
setVHost(JID vhost) |
void |
setVHost(String vhost) |
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() |
protected static StringBuilder |
toString(VHostItem item) |
getAdmins, getOwner, isAdmin, isOwner, setAdmins, setOwner
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo, isAdmin, isTrustedJID
public static final String ANONYMOUS_ENABLED_ATT
public static final String ANONYMOUS_ENABLED_LABEL
public static final String SASL_MECHANISM_ATT
public static final String SASL_MECHANISM_LABEL
public static final String COMPONENTS_ATT
public static final String COMPONENTS_ELEM
public static final String C2S_PORTS_ALLOWED_ATT
public static final String C2S_PORTS_ALLOWED_LABEL
public static final String DOMAIN_FILTER_POLICY_ATT
public static final String DOMAIN_FILTER_POLICY_DOMAINS_ATT
public static final String DOMAIN_FILTER_POLICY_LABEL
public static final String DOMAIN_FILTER_POLICY_DOMAINS_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 TRUSTED_JIDS_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
protected static final Map<String,VHostItemImpl.DataType> dataTypes
public VHostItemImpl()
public VHostItemImpl(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 VHostItemImpl(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 VHostItemImpl(String vhost) throws 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.TigaseStringprepException
- if the provided string causes stringprep processing errors.@Deprecated public static void registerData(List<VHostItemImpl.DataType> types)
protected boolean isDefault()
protected void setExtensionManager(VHostItemExtensionManager extensionManager)
public void addCommandFields(Packet packet)
RepositoryItem
addCommandFields
in interface RepositoryItem
addCommandFields
in class RepositoryItemAbstract
packet
- with empty ad-hoc command to fill with fieldspublic void initFromCommand(Packet packet)
RepositoryItem
initFromCommand
in interface RepositoryItem
initFromCommand
in class RepositoryItemAbstract
packet
- with ad-hoc command filled by the user.public void initFromElement(Element elem)
RepositoryItem
initFromElement
in interface RepositoryItem
initFromElement
in class RepositoryItemAbstract
elem
- XML Element with all the item initialization data.protected VHostItemExtension initExtension(VHostItemExtension extension)
public void setKey(String key)
setKey
in interface VHostItem
setKey
in class RepositoryItemAbstract
public void initFromPropertyString(String propString)
RepositoryItem
initFromPropertyString
in interface RepositoryItem
propString
- is a property string to initialize the RepositoryItem.public Element toElement()
RepositoryItem
toElement
in interface RepositoryItem
toElement
in class RepositoryItemAbstract
public String toPropertyString()
RepositoryItem
toPropertyString
in interface RepositoryItem
protected static StringBuilder toString(VHostItem item)
public String[] getComps()
null
(default) if there is no specific component assigned to this domain.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 int[] getC2SPortsAllowed()
getC2SPortsAllowed
in interface VHostItem
int[]
object with allowed C2S ports.public void setC2SPortsAllowed(int[] ports)
@Deprecated public <T> T getData(String key)
public DomainFilterPolicy getDomainFilter()
getDomainFilter
in interface VHostItem
public void setDomainFilter(DomainFilterPolicy domainFilter)
domainFilter
- name of the DomainFilterPolicy to be appliedpublic String[] getDomainFilterDomains()
getDomainFilterDomains
in interface VHostItem
public void setDomainFilterDomains(String[] domainFilterDomains)
domainFilterDomains
- array of domains to be applied during filteringpublic String getElemName()
getElemName
in class RepositoryItemAbstract
public <T extends VHostItemExtension> T getExtension(Class<T> clazz)
getExtension
in interface VHostItem
public <T extends VHostItemExtension> Set<T> getExtensions()
getExtensions
in interface VHostItem
public Set<Class<? extends VHostItemExtension>> getExtensionClasses()
getExtensionClasses
in interface VHostItem
public String getKey()
RepositoryItem
getKey
in interface RepositoryItem
public Long getMaxUsersNumber()
getMaxUsersNumber
in interface VHostItem
public void setMaxUsersNumber(long maxUsersNumber)
public JID getMessageForward()
getMessageForward
in interface VHostItem
public void setMessageForward(JID messageForward)
public JID getMessageForwardAddress()
getMessageForwardAddress
in interface VHostItem
public String getOtherDomainParams()
getOtherDomainParams
in interface VHostItem
String
value with domain extra parameters.public void setOtherDomainParams(String otherParams)
otherParams
- is a String
value with domain extra parameters.public JID getPresenceForward()
getPresenceForward
in interface VHostItem
public void setPresenceForward(JID presenceForward)
public JID getPresenceForwardAddress()
getPresenceForwardAddress
in interface VHostItem
public String getS2sSecret()
getS2sSecret
in interface VHostItem
public void setS2sSecret(String s2sSecret)
public Set<String> getTrustedJIDs()
getTrustedJIDs
in interface VHostItem
public boolean isAnonymousEnabled()
isAnonymousEnabled
in interface VHostItem
public void setAnonymousEnabled(boolean value)
@Deprecated public boolean isData(String key)
public void setEnabled(boolean value)
public boolean isRegisterEnabled()
isRegisterEnabled
in interface VHostItem
public void setRegisterEnabled(boolean value)
public boolean isTlsRequired()
isTlsRequired
in interface VHostItem
public void setTlsRequired(boolean value)
public void setVHost(String vhost) throws TigaseStringprepException
TigaseStringprepException
public void setVHost(JID vhost)
public String[] getSaslAllowedMechanisms()
getSaslAllowedMechanisms
in interface VHostItem
public void setSaslAllowedMechanisms(String[] saslAllowedMechanisms)
protected void initializeFromDefaults(VHostItemDefaults vhostDefaults)
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.