Package tigase.server.xmppclient
Interface SeeOtherHostIfc
-
- All Superinterfaces:
Lifecycle
- All Known Implementing Classes:
SeeOtherHost,SeeOtherHostDB,SeeOtherHostDualIP,SeeOtherHostHashed
public interface SeeOtherHostIfc extends Lifecycle
- Author:
- Wojtek
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSeeOtherHostIfc.Phase
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCM_SEE_OTHER_HOST_ACTIVEstatic java.lang.StringCM_SEE_OTHER_HOST_CLASS_PROP_DEF_VALstatic java.lang.StringCM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL_CLUSTERstatic java.lang.StringCM_SEE_OTHER_HOST_CLASS_PROP_KEYstatic java.lang.StringCM_SEE_OTHER_HOST_CLASS_PROPERTYstatic java.lang.StringCM_SEE_OTHER_HOST_DEFAULT_HOSTstatic java.lang.StringCM_SEE_OTHER_HOST_DEFAULT_PORT
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description BareJIDfindHostForJID(BareJID jid, BareJID host)Finds an appropriate host for a given JIDdefault ElementgetStreamError(java.lang.String xmlns, BareJID destination, java.lang.Integer port)Returns Element object containing stream:error messagebooleanisEnabled(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 phasedefault booleanisRedirectionRequired(BareJID defaultHost, BareJID redirectionHost)Method validates whether a redirection for a particular hostname and resulting redirection hastname is requiredvoidsetNodes(java.util.List<JID> nodes)Sets list of available nodes in cluster environment
-
-
-
Field Detail
-
CM_SEE_OTHER_HOST_CLASS_PROPERTY
static final java.lang.String CM_SEE_OTHER_HOST_CLASS_PROPERTY
- See Also:
- Constant Field Values
-
CM_SEE_OTHER_HOST_CLASS_PROP_KEY
static final java.lang.String CM_SEE_OTHER_HOST_CLASS_PROP_KEY
- See Also:
- Constant Field Values
-
CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL
static final java.lang.String CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL
- See Also:
- Constant Field Values
-
CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL_CLUSTER
static final java.lang.String CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL_CLUSTER
- See Also:
- Constant Field Values
-
CM_SEE_OTHER_HOST_DEFAULT_HOST
static final java.lang.String CM_SEE_OTHER_HOST_DEFAULT_HOST
- See Also:
- Constant Field Values
-
CM_SEE_OTHER_HOST_DEFAULT_PORT
static final java.lang.String CM_SEE_OTHER_HOST_DEFAULT_PORT
- See Also:
- Constant Field Values
-
CM_SEE_OTHER_HOST_ACTIVE
static final java.lang.String CM_SEE_OTHER_HOST_ACTIVE
- See Also:
- Constant Field Values
-
-
Method Detail
-
findHostForJID
BareJID findHostForJID(BareJID jid, BareJID host)
Finds an appropriate host for a given JID- 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
-
setNodes
void setNodes(java.util.List<JID> nodes)
Sets list of available nodes in cluster environment- Parameters:
nodes- current list of nodes
-
getStreamError
default Element getStreamError(java.lang.String xmlns, BareJID destination, java.lang.Integer port)
Returns Element object containing stream:error message- Parameters:
xmlns- xml namespace of the elementdestination- BareJID address of the redirect destination- Returns:
- element containing stream:error message
-
isEnabled
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- 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
-
isRedirectionRequired
default boolean isRedirectionRequired(BareJID defaultHost, BareJID redirectionHost)
Method validates whether a redirection for a particular hostname and resulting redirection hastname is required- Parameters:
defaultHost- default hostname of the particular machineredirectionHost- destination hostname- Returns:
trueif the redirection is required, otherwisefalse
-
-