Package tigase.server.xmppclient
Class SeeOtherHostDualIP
- java.lang.Object
-
- tigase.server.xmppclient.SeeOtherHost
-
- tigase.server.xmppclient.SeeOtherHostHashed
-
- tigase.server.xmppclient.SeeOtherHostDualIP
-
- All Implemented Interfaces:
Initializable,RegistrarBean,UnregisterAware,Lifecycle,SeeOtherHostIfc
@Bean(name="seeOtherHost", parent=ClientConnectionManager.class, active=true) @ClusterModeRequired(active=true) public class SeeOtherHostDualIP extends SeeOtherHostHashed implements Initializable, RegistrarBean, UnregisterAware
Extended implementation of SeeOtherHost using redirect information from database based on cluster_nodes table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSeeOtherHostDualIP.DualIPRepository<T extends DataSource>static classSeeOtherHostDualIP.DualIPRepositoryWrapper-
Nested classes/interfaces inherited from class tigase.server.xmppclient.SeeOtherHost
SeeOtherHost.SeeOtherHostVHostItemExtension, SeeOtherHost.SeeOtherHostVHostItemExtensionProvider
-
Nested classes/interfaces inherited from interface tigase.server.xmppclient.SeeOtherHostIfc
SeeOtherHostIfc.Phase
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSEE_OTHER_HOST_DATA_SOURCE_KEYstatic java.lang.StringSEE_OTHER_HOST_DATA_SOURCE_VALUEstatic java.lang.StringSEE_OTHER_HOST_DB_URL_KEYstatic java.lang.StringSEE_OTHER_HOST_FALLBACK_REDIRECTION_KEY-
Fields inherited from class tigase.server.xmppclient.SeeOtherHostHashed
connectedNodes
-
Fields inherited from class tigase.server.xmppclient.SeeOtherHost
defaultHost, REDIRECTION_ENABLED, vHostManager
-
Fields inherited from interface tigase.server.xmppclient.SeeOtherHostIfc
CM_SEE_OTHER_HOST_ACTIVE, CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL, CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL_CLUSTER, CM_SEE_OTHER_HOST_CLASS_PROP_KEY, CM_SEE_OTHER_HOST_CLASS_PROPERTY, CM_SEE_OTHER_HOST_DEFAULT_HOST, CM_SEE_OTHER_HOST_DEFAULT_PORT
-
-
Constructor Summary
Constructors Constructor Description SeeOtherHostDualIP()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeUnregister()Method called before bean unregister.voidclusterRepoItemEvent(ClusterRepoItemEvent event)BareJIDfindHostForJID(BareJID jid, BareJID host)Finds an appropriate host for a given JIDvoidinitialize()Method will be called, when bean will be created, configured and ready to use.booleanisRedirectionRequired(BareJID defaultHost, BareJID redirectionHost)Method validates whether a redirection for a particular hostname and resulting redirection hastname is requiredvoidregister(Kernel kernel)Method called when bean is being registered allowing developer to programatically register other beans.protected voidreloadRedirection()voidsetNodes(java.util.List<JID> connectedNodes)Sets list of available nodes in cluster environmentvoidunregister(Kernel kernel)Method called while bean is being unregistered.-
Methods inherited from class tigase.server.xmppclient.SeeOtherHostHashed
nodeShutdown
-
Methods inherited from class tigase.server.xmppclient.SeeOtherHost
isEnabled, isNodeShutdown, setDefaultHost, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface tigase.server.xmppclient.SeeOtherHostIfc
getStreamError
-
-
-
-
Field Detail
-
SEE_OTHER_HOST_FALLBACK_REDIRECTION_KEY
public static final java.lang.String SEE_OTHER_HOST_FALLBACK_REDIRECTION_KEY
- See Also:
- Constant Field Values
-
SEE_OTHER_HOST_DATA_SOURCE_KEY
public static final java.lang.String SEE_OTHER_HOST_DATA_SOURCE_KEY
- See Also:
- Constant Field Values
-
SEE_OTHER_HOST_DATA_SOURCE_VALUE
public static final java.lang.String SEE_OTHER_HOST_DATA_SOURCE_VALUE
-
SEE_OTHER_HOST_DB_URL_KEY
public static final java.lang.String SEE_OTHER_HOST_DB_URL_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
findHostForJID
public BareJID findHostForJID(BareJID jid, BareJID host)
Description copied from interface:SeeOtherHostIfcFinds an appropriate host for a given JID- Specified by:
findHostForJIDin interfaceSeeOtherHostIfc- Overrides:
findHostForJIDin classSeeOtherHostHashed- Parameters:
jid- is a user JID extracted from the stream open attributeshost- is "this" host to which the user is now connected and which calls the method- Returns:
- BareJID of possible host to which the user should connect or NULL
-
clusterRepoItemEvent
@HandleEvent public void clusterRepoItemEvent(ClusterRepoItemEvent event)
-
setNodes
public void setNodes(java.util.List<JID> connectedNodes)
Description copied from interface:SeeOtherHostIfcSets list of available nodes in cluster environment- Specified by:
setNodesin interfaceSeeOtherHostIfc- Overrides:
setNodesin classSeeOtherHostHashed- Parameters:
connectedNodes- current list of nodes
-
isRedirectionRequired
public boolean isRedirectionRequired(BareJID defaultHost, BareJID redirectionHost)
Description copied from interface:SeeOtherHostIfcMethod validates whether a redirection for a particular hostname and resulting redirection hastname is required- Specified by:
isRedirectionRequiredin interfaceSeeOtherHostIfc- Parameters:
defaultHost- default hostname of the particular machineredirectionHost- destination hostname- Returns:
trueif the redirection is required, otherwisefalse
-
register
public void register(Kernel kernel)
Description copied from interface:RegistrarBeanMethod called when bean is being registered allowing developer to programatically register other beans.- Specified by:
registerin interfaceRegistrarBean- Parameters:
kernel- - instance from local scope
-
unregister
public void unregister(Kernel kernel)
Description copied from interface:RegistrarBeanMethod called while bean is being unregistered.- Specified by:
unregisterin interfaceRegistrarBean- Parameters:
kernel- - instance from local scope
-
initialize
public void initialize()
Description copied from interface:InitializableMethod will be called, when bean will be created, configured and ready to use.- Specified by:
initializein interfaceInitializable- Overrides:
initializein classSeeOtherHost
-
beforeUnregister
public void beforeUnregister()
Description copied from interface:UnregisterAwareMethod called before bean unregister.- Specified by:
beforeUnregisterin interfaceUnregisterAware
-
reloadRedirection
protected void reloadRedirection()
-
-