Package tigase.vhosts
Interface VHostManagerIfc
- All Known Implementing Classes:
VHostManager
public interface VHostManagerIfc
This is VHostManagerIfc interface which allows to access data for virtual domains server by this installation. There
can be normally only one instance of this interface implementation loaded on the server at any given time. The
instance is responsible for managing all virtual hosts and assigning correct component to each of the virtual hosts
or non-local domains.
Created: 22 Nov 2008
Created: 22 Nov 2008
- Author:
- Artur Hefczyc
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponentDomain
(String domain) Adds a component domain to the collection of local component domains.Method returns a list of all hosted VHosts.getComponentsForLocalDomain
(String domain) The method returns an array with server components which can process packets for a given local domain.getComponentsForNonLocalDomain
(String domain) The method returns an array of server components which can process packets sent to non-local domain.MethodgetDefVHostItem
returns a default VHost for the installation.getVHostItem
(String domain) Returns an object with all domain properties for given domain.getVHostItemDomainOrComponent
(String domain) Returns an object with all domain properties for a given domain or base domain if passed domain is name of subdomain used by component.boolean
isAnonymousEnabled
(String domain) This method checks whether anonymous login is enabled for a given domain.boolean
isLocalDomain
(String domain) This method checks whether given domain is server by this server instance.boolean
isLocalDomainOrComponent
(String domain) Method check if domains is locally hosted as a vhost or a component of a vhost.void
removeComponentDomain
(String domain) Removes a domain previously registered by a component.
-
Method Details
-
isLocalDomain
This method checks whether given domain is server by this server instance. That is if this domain is local to this server installation. It doesn't check however whether the domain is disabled or enabled. It only checks if tthe list of local domains contains this virtual host.- Parameters:
domain
- is a String with domain name to check.- Returns:
- a boolean value indicating whether given domain is local or not.
-
isLocalDomainOrComponent
Method check if domains is locally hosted as a vhost or a component of a vhost.- Returns:
- true - if domain is locally hosted as a vhost of a component of a vhost.
-
isAnonymousEnabled
This method checks whether anonymous login is enabled for a given domain. That is it checks whether this domains is local and anonymousEnabled parameter for this domain is set to true.- Parameters:
domain
- is a String with domain name to check.- Returns:
- a boolean value indicating whether given domain is enabled for anonymous logins or not.
-
getComponentsForLocalDomain
The method returns an array with server components which can process packets for a given local domain. If the domain is not localnull
is returned. The given domain may also consist of: component nameServerComponent.getName()
plus any local domain but only if the component returnstrue
from method call:VHostListener.handlesNameSubdomains()
- Parameters:
domain
- is aString
with a domain name to check. It may by just a local domain or string created with component name and localdomain.- Returns:
- an array with ServerComponents which can handle packets for a given domain or
null
if no component found for a given domain.
-
getComponentsForNonLocalDomain
The method returns an array of server components which can process packets sent to non-local domain. Most commonly there is only one such component: server-2-server connections manager. It is possible however there might be more such components. All of them will get the packet for processing.- Parameters:
domain
- is aString
with a domain to check. At the moment this parameter is ignored. In the future it will be possible to assign a specific component for any non-local domain.- Returns:
- an array with ServerComponents which can handle packets to non-local domains.
-
getVHostItem
Returns an object with all domain properties for given domain.- Parameters:
domain
- is a domain name- Returns:
- a VHostItem object with all domain properties.
-
getVHostItemDomainOrComponent
Returns an object with all domain properties for a given domain or base domain if passed domain is name of subdomain used by component.- Parameters:
domain
- is a domain name- Returns:
- a VHostItem object with all domain properties.
-
addComponentDomain
Adds a component domain to the collection of local component domains. This is mainly needed/used by an external components connecting to the server and binding hostnames. Normally the s2s component have no way of knowing about this new and temporary domains handled by the server and would refuse all connections for these domains. Adding them to a collection of component domains allows the s2s to detect them and accept connection for them.- Parameters:
domain
- is a component domain name added to the collection.
-
removeComponentDomain
Removes a domain previously registered by a component. It should not be normally used.- Parameters:
domain
- is a component domain name being removed from the collection.
-
getDefVHostItem
BareJID getDefVHostItem()MethodgetDefVHostItem
returns a default VHost for the installation. In most cases this is the first VHost defined in the server configuration.- Returns:
- a
BareJID
value of the default VHost for the installation.
-
getAllVHosts
Method returns a list of all hosted VHosts.
-