Package tigase.server.xmppclient
Class SeeOtherHost
java.lang.Object
tigase.server.xmppclient.SeeOtherHost
- All Implemented Interfaces:
Initializable,Lifecycle,SeeOtherHostIfc
- Direct Known Subclasses:
SeeOtherHostHashed
@Bean(name="seeOtherHost",
parent=ClientConnectionManager.class,
active=true)
@ClusterModeRequired(active=false)
public class SeeOtherHost
extends Object
implements SeeOtherHostIfc, Initializable
Default and basic implementation of SeeOtherHost returning same host as the initial one
- Author:
- Wojtek
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface tigase.server.xmppclient.SeeOtherHostIfc
SeeOtherHostIfc.Phase -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EventBusstatic final Stringprotected VHostManagerIfcFields 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 -
Method Summary
Modifier and TypeMethodDescriptionfindHostForJID(BareJID jid, BareJID host) Finds an appropriate host for a given JIDvoidMethod will be called, when bean will be created, configured and ready to use.booleanisEnabled(VHostItem vHost, SeeOtherHostIfc.Phase ph) Performs check whether redirect is enabled in the given phase by default see-other-host redirect is only active in stream:open phaseprotected booleanisNodeShutdown(BareJID jid) protected voidnodeShutdown(ShutdownEvent event) voidsetDefaultHost(ArrayList<BareJID> defaultHost) voidSets list of available nodes in cluster environmentvoidstart()voidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tigase.server.xmppclient.SeeOtherHostIfc
getStreamError, isRedirectionRequired
-
Field Details
-
REDIRECTION_ENABLED
- See Also:
-
defaultHost
-
eventBus
-
vHostManager
-
-
Constructor Details
-
SeeOtherHost
public SeeOtherHost()
-
-
Method Details
-
findHostForJID
Description copied from interface:SeeOtherHostIfcFinds an appropriate host for a given JID- Specified by:
findHostForJIDin interfaceSeeOtherHostIfc- 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
-
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
-
setDefaultHost
-
setNodes
Description copied from interface:SeeOtherHostIfcSets list of available nodes in cluster environment- Specified by:
setNodesin interfaceSeeOtherHostIfc- Parameters:
nodes- current list of nodes
-
isEnabled
Description copied from interface:SeeOtherHostIfcPerforms check whether redirect is enabled in the given phase by default see-other-host redirect is only active in stream:open phase- Specified by:
isEnabledin interfaceSeeOtherHostIfc- Parameters:
vHost- vHost for which redirection should be performedph- phase for which the check should be performed- Returns:
- boolean value indicating whether to perform or not redirect for the phase passed as argument
-
start
public void start() -
stop
public void stop() -
isNodeShutdown
-
nodeShutdown
-