public class SeeOtherHost extends Object implements SeeOtherHostIfc
SeeOtherHostIfc.Phase
Modifier and Type | Field and Description |
---|---|
protected List<tigase.xmpp.BareJID> |
defaultHost |
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 |
---|---|
tigase.xmpp.BareJID |
findHostForJID(tigase.xmpp.BareJID jid,
tigase.xmpp.BareJID host)
Finds an appropriate host for a given JID
|
void |
getDefaults(Map<String,Object> defs,
Map<String,Object> params) |
tigase.xml.Element |
getStreamError(String xmlns,
tigase.xmpp.BareJID destination)
Returns Element object containing stream:error message
|
boolean |
isEnabled(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
|
void |
setNodes(List<tigase.xmpp.BareJID> nodes)
Sets list of available nodes in cluster environment
|
void |
setProperties(Map<String,Object> props) |
protected List<tigase.xmpp.BareJID> defaultHost
public tigase.xmpp.BareJID findHostForJID(tigase.xmpp.BareJID jid, tigase.xmpp.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 getDefaults(Map<String,Object> defs, Map<String,Object> params)
getDefaults
in interface SeeOtherHostIfc
public void setProperties(Map<String,Object> props)
setProperties
in interface SeeOtherHostIfc
public void setNodes(List<tigase.xmpp.BareJID> nodes)
SeeOtherHostIfc
setNodes
in interface SeeOtherHostIfc
nodes
- current list of nodespublic tigase.xml.Element getStreamError(String xmlns, tigase.xmpp.BareJID destination)
SeeOtherHostIfc
getStreamError
in interface SeeOtherHostIfc
xmlns
- xml namespace of the elementdestination
- BareJID address of the redirect destinationpublic boolean isEnabled(SeeOtherHostIfc.Phase ph)
SeeOtherHostIfc
isEnabled
in interface SeeOtherHostIfc
ph
- phase for which the check should be performedCopyright © 2014 "Tigase, Inc.". All rights reserved.