@Bean(name="seeOtherHost", parent=ClientConnectionManager.class, active=true) @ClusterModeRequired(active=false) public class SeeOtherHost extends Object implements SeeOtherHostIfc, Initializable
Modifier and Type | Class and Description |
---|---|
static class |
SeeOtherHost.SeeOtherHostVHostItemExtension |
static class |
SeeOtherHost.SeeOtherHostVHostItemExtensionProvider |
SeeOtherHostIfc.Phase
Modifier and Type | Field and Description |
---|---|
protected List<BareJID> |
defaultHost |
protected EventBus |
eventBus |
static String |
REDIRECTION_ENABLED |
protected VHostManagerIfc |
vHostManager |
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 and Description |
---|
SeeOtherHost() |
Modifier and Type | Method and Description |
---|---|
BareJID |
findHostForJID(BareJID jid,
BareJID host)
Finds an appropriate host for a given JID
|
void |
initialize()
Method will be called, when bean will be created, configured and ready to use.
|
boolean |
isEnabled(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 phase
|
protected boolean |
isNodeShutdown(BareJID jid) |
protected void |
nodeShutdown(ShutdownEvent event) |
void |
setDefaultHost(List<BareJID> defaultHost) |
void |
setNodes(List<JID> nodes)
Sets list of available nodes in cluster environment
|
void |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStreamError, isRedirectionRequired
public static final String REDIRECTION_ENABLED
@ConfigField(desc="Default host to redirect to") protected List<BareJID> defaultHost
@Inject protected VHostManagerIfc vHostManager
public BareJID findHostForJID(BareJID jid, BareJID host)
SeeOtherHostIfc
findHostForJID
in interface SeeOtherHostIfc
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 methodpublic void initialize()
Initializable
initialize
in interface Initializable
public void setNodes(List<JID> nodes)
SeeOtherHostIfc
setNodes
in interface SeeOtherHostIfc
nodes
- current list of nodespublic boolean isEnabled(VHostItem vHost, SeeOtherHostIfc.Phase ph)
SeeOtherHostIfc
isEnabled
in interface SeeOtherHostIfc
vHost
- vHost for which redirection should be performedph
- phase for which the check should be performedprotected boolean isNodeShutdown(BareJID jid)
@HandleEvent protected void nodeShutdown(ShutdownEvent event)
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.