|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttigase.vhosts.VHostItem
public class 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:
Created: 22 Nov 2008
Field Summary | |
---|---|
static String |
ANONYMOUS_ENABLED_ATT
This is an attribute name for storing information whether anonymous user can login for this domain. |
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 |
ENABLED_ATT
This is an attribute name for storing information whether the VHost is enabled or disabled. |
static String |
HOSTNAME_ATT
This is an attribute name for storing the VHost name. |
static String |
MAX_USERS_NUMBER_ATT
This is an attribute name for storing the maximum number of users for this virtual domain. |
static String |
OTHER_PARAMS_ELEM
Element name for the VHostItem XML child keeping all the extra parameters for the domain. |
static String |
REGISTER_ENABLED_ATT
This is an attribute name for storing information whether user registration is allowed for this domain. |
static String |
VHOST_ELEM
Element name to for the VHostItem XML storage. |
Constructor Summary | |
---|---|
VHostItem()
|
|
VHostItem(tigase.xml.Element elem)
The constructor creates the VHostItem instance from a given
XML element. |
|
VHostItem(String vhost)
The constructor creates the VHostItem instance for a given
domain name with default values for all other parameters. |
Method Summary | |
---|---|
void |
addCommandFields(Packet packet)
The method is used for handling ad-hoc commands. |
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. |
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. |
String |
getOtherDomainParams()
This method allows to access the virtual domain other configuration parameters. |
VHostItem |
getUnmodifiableVHostItem()
|
String |
getVhost()
This method return a virtual host name as a String value. |
void |
initFromCommand(Packet packet)
The method used for handling ad-hoc commands. |
void |
initFromElement(tigase.xml.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. |
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. |
void |
setAnonymousEnabled(boolean enabled)
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 |
setEnabled(boolean enabled)
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 |
setOtherDomainParams(String otherParams)
This method allows to set extra configuration parameters for the virtual domain. |
void |
setRegisterEnabled(boolean enabled)
This method allows to enable or disable user account registration for this domain. |
void |
setVHost(String vhost)
|
tigase.xml.Element |
toElement()
The method exports the VHostItem object to XML representation. |
String |
toPropertyString()
The item can be initialized based on the data loaded from a configuration file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VHOST_ELEM
public static final String COMPONENTS_ELEM
public static final String OTHER_PARAMS_ELEM
public static final String HOSTNAME_ATT
public static final String ENABLED_ATT
public static final String ANONYMOUS_ENABLED_ATT
public static final String REGISTER_ENABLED_ATT
public static final String MAX_USERS_NUMBER_ATT
Constructor Detail |
---|
public VHostItem()
public VHostItem(String 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(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.Method Detail |
---|
public VHostItem getUnmodifiableVHostItem()
public tigase.xml.Element toElement()
VHostItem
object to XML representation.
toElement
in interface RepositoryItem
Element
object with vhost information.public String[] getComps()
null
(default) if there is
no specific component assigned to this domain.
String[]
object with server component names.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 boolean isEnabled()
boolean
value true
if the domain is
enabled and false
if the domain is disabled.public void setEnabled(boolean enabled)
enabled
- is a boolean
value indicating whether the
domain is enabled or not.public boolean isRegisterEnabled()
boolean
value indicating whether user account
registration is allowed for this domain.public void setRegisterEnabled(boolean enabled)
enabled
- is a boolean
value indicating whether user
account registration is allowed for this domain or not.public boolean isAnonymousEnabled()
boolean
value indicating whether anonymous logins
are allowed for this domain.public void setAnonymousEnabled(boolean enabled)
enabled
- is a boolean
value indicating whether anonymous
logins are allowed for this domain.public long getMaxUsersNumber()
long
value indicating the maximum number of
user accounts allowed for this domain.public void setMaxUsersNumber(long maxUsersNumber)
0L
.
maxUsersNumber
- is a long
value specifying the maximum
number of user accounts allowed for this domain.public String getOtherDomainParams()
String
value with domain extra parameters.public void setOtherDomainParams(String otherParams)
otherParams
- is a String
value with domain extra
parameters.public String getVhost()
String
value.
String
value with the virtual domain name.public void setVHost(String vhost)
public void initFromPropertyString(String propString)
RepositoryItem
initFromPropertyString
in interface RepositoryItem
propString
- is a property string to initialize the RepositoryItem.public String toPropertyString()
RepositoryItem
toPropertyString
in interface RepositoryItem
public void initFromElement(tigase.xml.Element elem)
RepositoryItem
initFromElement
in interface RepositoryItem
elem
- XML Element with all the item initialization data.public String getKey()
RepositoryItem
getKey
in interface RepositoryItem
public void addCommandFields(Packet packet)
RepositoryItem
addCommandFields
in interface RepositoryItem
packet
- with empty ad-hoc command to fill with fieldspublic void initFromCommand(Packet packet)
RepositoryItem
initFromCommand
in interface RepositoryItem
packet
- with ad-hoc command filled by the user.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |