|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.cluster.VirtualComponent
public class VirtualComponent
The purpose of this component implementation is to forward packets to a target
real component implementation in the cluster installation. Let's say you have
a cluster installation with full Tigase server installed on each node and you
also want to use a component which doesn't have clustered implementation yet.
In such case you deploy the component on one of the cluster nodes and put the
virtual component on all other nodes. With proper configuration they pretend
to be the component returning a correct service disco information and forward
all packets for this component to a cluster node with real component running.
This is a very lightweight implementation which doesn't use much resources
either memory or CPU.
It can work well for any kind of a component: MUC, PubSub, transport either
native Tigase components or third-party components connected via XEP-0114 -
external protocol component.
Basic configuration parameters are actually the same as for a real component.
You set a real component name as a name for the virtual component and a vritual
component class name to load. Let's say we want to deploy MUC component this
way. The MUC component is visible as muc.domain.our in our
installation. Thus the name of the component is: muc:
--comp-name-1=muc --comp-class-1=tigase.cluster.VirtualComponentThis is pretty much all you need to load a virtual component. A few other options are needed to point to correct destination addresses for forwarded packets and to set correct service discovery parameters:
muc/redirect-to=muc@cluster-node-with-real-muc.domain.our muc/disco-name=Multi User Chat muc/disco-node= muc/disco-type=text muc/disco-category=conference muc/disco-features=http://jabber.org/protocol/mucAbove options set all possible parameters to setup virtual MUC component. Created: Dec 13, 2008 7:44:35 PM
| Field Summary | |
|---|---|
static java.lang.String |
DISCO_CATEGORY_PROP_KEY
Parameter to set service discovery item category name for the virtual component. |
static java.lang.String |
DISCO_CATEGORY_PROP_VAL
|
static java.lang.String |
DISCO_FEATURES_PROP_KEY
Comma separated list of features for the service discovery item reprezented by this virtual component. |
static java.lang.String |
DISCO_FEATURES_PROP_VAL
|
static java.lang.String |
DISCO_NAME_PROP_KEY
Parameter to set service discovery item name for the virtual component instance. |
static java.lang.String |
DISCO_NAME_PROP_VAL
|
static java.lang.String |
DISCO_NODE_PROP_KEY
Parameter to set service discovery node name. |
static java.lang.String |
DISCO_NODE_PROP_VAL
|
static java.lang.String |
DISCO_TYPE_PROP_KEY
Parameter to set service discovery item type for the virtual component. |
static java.lang.String |
DISCO_TYPE_PROP_VAL
|
static java.lang.String |
REDIRECT_TO_PROP_KEY
Virtual component parameter setting packet redirect destination address. |
| Fields inherited from interface tigase.disco.XMPPService |
|---|
CMD_FEATURES, DEF_FEATURES, INFO_XMLNS, ITEMS_XMLNS |
| Constructor Summary | |
|---|---|
VirtualComponent()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getComponentId()
|
java.util.Map<java.lang.String,java.lang.Object> |
getDefaults(java.util.Map<java.lang.String,java.lang.Object> params)
Returns defualt configuration settings for this object. |
java.util.List<tigase.xml.Element> |
getDiscoFeatures()
Returns features for top level disco info |
tigase.xml.Element |
getDiscoInfo(java.lang.String node,
java.lang.String jid)
|
java.util.List<tigase.xml.Element> |
getDiscoItems(java.lang.String node,
java.lang.String jid)
|
java.lang.String |
getName()
Get object name. |
void |
initializationCompleted()
|
void |
processPacket(Packet packet,
java.util.Queue<Packet> results)
processPacket is a blocking processing method implemented
by all components. |
void |
release()
|
void |
setName(java.lang.String name)
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Sets all configuration properties for the object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String REDIRECT_TO_PROP_KEY
public static final java.lang.String DISCO_NAME_PROP_KEY
public static final java.lang.String DISCO_NAME_PROP_VAL
public static final java.lang.String DISCO_NODE_PROP_KEY
public static final java.lang.String DISCO_NODE_PROP_VAL
public static final java.lang.String DISCO_TYPE_PROP_KEY
public static final java.lang.String DISCO_TYPE_PROP_VAL
public static final java.lang.String DISCO_CATEGORY_PROP_KEY
public static final java.lang.String DISCO_CATEGORY_PROP_VAL
public static final java.lang.String DISCO_FEATURES_PROP_KEY
public static final java.lang.String DISCO_FEATURES_PROP_VAL
| Constructor Detail |
|---|
public VirtualComponent()
| Method Detail |
|---|
public void setName(java.lang.String name)
setName in interface ServerComponentpublic java.lang.String getName()
Configurable
getName in interface ConfigurablegetName in interface ServerComponentString value of object name.public java.lang.String getComponentId()
getComponentId in interface ServerComponentpublic void release()
release in interface ServerComponent
public void processPacket(Packet packet,
java.util.Queue<Packet> results)
ServerComponentprocessPacket is a blocking processing method implemented
by all components. This method processes packet and returns results
instantly without waiting for any resources.
processPacket in interface ServerComponentpacket - a Packet valuepublic void initializationCompleted()
initializationCompleted in interface ServerComponent
public tigase.xml.Element getDiscoInfo(java.lang.String node,
java.lang.String jid)
getDiscoInfo in interface XMPPService
public java.util.List<tigase.xml.Element> getDiscoItems(java.lang.String node,
java.lang.String jid)
getDiscoItems in interface XMPPServicepublic java.util.List<tigase.xml.Element> getDiscoFeatures()
XMPPService
getDiscoFeatures in interface XMPPServicepublic void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Configurable
setProperties in interface Configurablepublic java.util.Map<java.lang.String,java.lang.Object> getDefaults(java.util.Map<java.lang.String,java.lang.Object> params)
Configurable
getDefaults in interface Configurable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||