public class ClusterElement extends Object
<cluster xmlns="tigase:cluster" from="source" to="dest" type="set">
<data>
<message xmlns="jabber:client" from="source-u" to="dest-x" type="chat">
<body>Hello world!</body>
</message>
</data>
<control>
<first-node>node1 JID address</first-node>
<visited-nodes>
<node-id>node1 JID address</node-id>
<node-id>node2 JID address</node-id>
</visited-nodes>
<method-call name="method name">
<par name="param1 name">value</par>
<par name="param2 name">value</par>
<results>
<val name="val1 name">value</var>
<val name="val2 name">value</var>
</results>
</method-call>
</control>
</cluster>
If none of nodes could process the packet it goes back to the first node as
this node is the most likely to process the packet correctly.
Created: Fri May 2 09:40:40 2008Modifier and Type | Field and Description |
---|---|
static String |
CLUSTER_CONTROL_EL_NAME
Field description
|
static String[] |
CLUSTER_CONTROL_PATH
Field description
|
static String |
CLUSTER_DATA_EL_NAME
Field description
|
static String[] |
CLUSTER_DATA_PATH
Field description
|
static String |
CLUSTER_EL_NAME
Field description
|
static String |
CLUSTER_METHOD_EL_NAME
Field description
|
static String |
CLUSTER_METHOD_PAR_EL_NAME
Field description
|
static String[] |
CLUSTER_METHOD_PATH
Field description
|
static String |
CLUSTER_METHOD_RESULTS_EL_NAME
Field description
|
static String[] |
CLUSTER_METHOD_RESULTS_PATH
Field description
|
static String |
CLUSTER_METHOD_RESULTS_VAL_EL_NAME
Field description
|
static String |
CLUSTER_NAME_ATTR
Field description
|
static String |
FIRST_NODE_EL_NAME
Field description
|
static String[] |
FIRST_NODE_PATH
Field description
|
static String |
NODE_ID_EL_NAME
Field description
|
static String |
VISITED_NODES_EL_NAME
Field description
|
static String[] |
VISITED_NODES_PATH
Field description
|
static String |
XMLNS
Field description
|
Constructor and Description |
---|
ClusterElement(tigase.xml.Element elem)
Creates a new
ClusterElement instance. |
ClusterElement(tigase.xmpp.JID from,
tigase.xmpp.JID to,
StanzaType type,
Packet packet)
Constructs ...
|
Modifier and Type | Method and Description |
---|---|
void |
addDataPacket(tigase.xml.Element packet)
Method description
|
void |
addDataPacket(Packet packet)
Method description
|
void |
addDataPackets(Queue<tigase.xml.Element> packets)
Method description
|
void |
addMethodResult(String key,
String val)
Method description
|
void |
addVisitedNode(tigase.xmpp.JID node_id)
Method description
|
void |
addVisitedNodes(Set<tigase.xmpp.JID> nodes)
Method description
|
static tigase.xml.Element |
clusterElement(tigase.xmpp.JID from,
tigase.xmpp.JID to,
StanzaType type)
Method description
|
static tigase.xml.Element |
createClusterElement(tigase.xmpp.JID from,
tigase.xmpp.JID to,
StanzaType type,
String packet_from)
Method description
|
static ClusterElement |
createClusterMethodCall(tigase.xmpp.JID from,
tigase.xmpp.JID to,
StanzaType type,
String method_name,
Map<String,String> params)
Method description
|
static ClusterElement |
createForNextNode(ClusterElement clel,
List<tigase.xmpp.JID> cluster_nodes,
tigase.xmpp.JID comp_id)
Method description
|
ClusterElement |
createMethodResponse(tigase.xmpp.JID from,
tigase.xmpp.JID to,
StanzaType type,
Map<String,String> results)
Method description
|
ClusterElement |
createMethodResponse(tigase.xmpp.JID from,
StanzaType type,
Map<String,String> results)
Method description
|
Map<String,String> |
getAllMethodParams()
Method description
|
Map<String,String> |
getAllMethodResults()
Method description
|
tigase.xml.Element |
getClusterElement(String id)
Method description
|
Queue<tigase.xml.Element> |
getDataPackets()
Method description
|
tigase.xmpp.JID |
getFirstNode()
Method description
|
String |
getMethodName()
Method description
|
String |
getMethodParam(String par_name)
Method description
|
long |
getMethodParam(String par_name,
long def)
Method description
|
String |
getMethodResultVal(String val_name)
Method description
|
long |
getMethodResultVal(String val_name,
long def)
Method description
|
Set<tigase.xmpp.JID> |
getVisitedNodes()
Method description
|
boolean |
isVisitedNode(tigase.xmpp.JID node_id)
Method description
|
ClusterElement |
nextClusterNode(tigase.xmpp.JID node_id)
Method description
|
protected void |
parseMethodCall(tigase.xml.Element method_call)
Method description
|
public static final String CLUSTER_CONTROL_EL_NAME
public static final String CLUSTER_DATA_EL_NAME
public static final String CLUSTER_EL_NAME
public static final String CLUSTER_METHOD_EL_NAME
public static final String CLUSTER_METHOD_PAR_EL_NAME
public static final String CLUSTER_METHOD_RESULTS_EL_NAME
public static final String CLUSTER_METHOD_RESULTS_VAL_EL_NAME
public static final String CLUSTER_NAME_ATTR
public static final String FIRST_NODE_EL_NAME
public static final String NODE_ID_EL_NAME
public static final String VISITED_NODES_EL_NAME
public static final String XMLNS
public static final String[] VISITED_NODES_PATH
public static final String[] FIRST_NODE_PATH
public static final String[] CLUSTER_METHOD_RESULTS_PATH
public static final String[] CLUSTER_METHOD_PATH
public static final String[] CLUSTER_DATA_PATH
public static final String[] CLUSTER_CONTROL_PATH
public ClusterElement(tigase.xml.Element elem)
ClusterElement
instance.elem
- public ClusterElement(tigase.xmpp.JID from, tigase.xmpp.JID to, StanzaType type, Packet packet)
from
- to
- type
- packet
- public static tigase.xml.Element clusterElement(tigase.xmpp.JID from, tigase.xmpp.JID to, StanzaType type)
from
- to
- type
- public static tigase.xml.Element createClusterElement(tigase.xmpp.JID from, tigase.xmpp.JID to, StanzaType type, String packet_from)
from
- to
- type
- packet_from
- public static ClusterElement createClusterMethodCall(tigase.xmpp.JID from, tigase.xmpp.JID to, StanzaType type, String method_name, Map<String,String> params)
from
- to
- type
- method_name
- params
- public static ClusterElement createForNextNode(ClusterElement clel, List<tigase.xmpp.JID> cluster_nodes, tigase.xmpp.JID comp_id)
clel
- cluster_nodes
- comp_id
- public void addDataPacket(Packet packet)
packet
- public void addDataPacket(tigase.xml.Element packet)
packet
- public void addDataPackets(Queue<tigase.xml.Element> packets)
packets
- public void addMethodResult(String key, String val)
key
- val
- public void addVisitedNode(tigase.xmpp.JID node_id)
node_id
- public void addVisitedNodes(Set<tigase.xmpp.JID> nodes)
nodes
- public ClusterElement createMethodResponse(tigase.xmpp.JID from, StanzaType type, Map<String,String> results)
from
- type
- results
- public ClusterElement createMethodResponse(tigase.xmpp.JID from, tigase.xmpp.JID to, StanzaType type, Map<String,String> results)
from
- to
- type
- results
- public tigase.xml.Element getClusterElement(String id)
id
- public Queue<tigase.xml.Element> getDataPackets()
public tigase.xmpp.JID getFirstNode()
public String getMethodName()
public String getMethodParam(String par_name)
par_name
- public long getMethodParam(String par_name, long def)
par_name
- def
- public String getMethodResultVal(String val_name)
val_name
- public long getMethodResultVal(String val_name, long def)
val_name
- def
- public Set<tigase.xmpp.JID> getVisitedNodes()
public boolean isVisitedNode(tigase.xmpp.JID node_id)
node_id
- public ClusterElement nextClusterNode(tigase.xmpp.JID node_id)
node_id
- protected void parseMethodCall(tigase.xml.Element method_call)
method_call
- Copyright © 2015 "Tigase, Inc.". All rights reserved.