|
||||||||||
| 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/muc muc/fixed-domain=example.comAbove options set all possible parameters to setup virtual MUC component. Created: Dec 13, 2008 7:44:35 PM
| Field Summary | |
|---|---|
static String |
DISCO_CATEGORY_PROP_KEY
Parameter to set service discovery item category name for the virtual component. |
static String |
DISCO_CATEGORY_PROP_VAL
Field description |
static String |
DISCO_FEATURES_PROP_KEY
Comma separated list of features for the service discovery item represented by this virtual component. |
static String |
DISCO_FEATURES_PROP_VAL
Field description |
static String |
DISCO_NAME_PROP_KEY
Parameter to set service discovery item name for the virtual component instance. |
static String |
DISCO_NAME_PROP_VAL
Field description |
static String |
DISCO_NODE_PROP_KEY
Parameter to set service discovery node name. |
static String |
DISCO_NODE_PROP_VAL
Field description |
static String |
DISCO_TYPE_PROP_KEY
Parameter to set service discovery item type for the virtual component. |
static String |
DISCO_TYPE_PROP_VAL
A default value for service discovery item type, which is 'text' |
static String |
FIXED_DOMAIN_PROP_KEY
If set, then it is used as the component domain name part. |
static String |
REDIRECT_TO_PROP_KEY
Virtual component parameter setting packet redirect destination address. |
protected VHostManagerIfc |
vHostManager
Field description |
| Fields inherited from interface tigase.disco.XMPPService |
|---|
CMD_FEATURES, DEF_FEATURES, INFO_XMLNS, ITEMS_XMLNS |
| Constructor Summary | |
|---|---|
VirtualComponent()
|
|
| Method Summary | |
|---|---|
tigase.xmpp.JID |
getComponentId()
Method description |
Map<String,Object> |
getDefaults(Map<String,Object> params)
Method description |
List<tigase.xml.Element> |
getDiscoFeatures(tigase.xmpp.JID from)
Method description |
tigase.xml.Element |
getDiscoInfo(String node,
tigase.xmpp.JID jid,
tigase.xmpp.JID from)
Method description |
List<tigase.xml.Element> |
getDiscoItems(String node,
tigase.xmpp.JID jid,
tigase.xmpp.JID from)
Method description |
String |
getName()
Method description |
boolean |
handlesLocalDomains()
Method description |
boolean |
handlesNameSubdomains()
Method description |
boolean |
handlesNonLocalDomains()
Method description |
void |
initializationCompleted()
Method description |
boolean |
isInitializationComplete()
Method description |
void |
processPacket(Packet packet,
Queue<Packet> results)
Method description |
void |
release()
Method description |
void |
setName(String name)
Method description |
void |
setProperties(Map<String,Object> properties)
Method description |
void |
setVHostManager(VHostManagerIfc manager)
Method description |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DISCO_CATEGORY_PROP_KEY
public static final String DISCO_CATEGORY_PROP_VAL
public static final String DISCO_FEATURES_PROP_KEY
public static final String DISCO_FEATURES_PROP_VAL
public static final String DISCO_NAME_PROP_KEY
public static final String DISCO_NAME_PROP_VAL
public static final String DISCO_NODE_PROP_KEY
public static final String DISCO_NODE_PROP_VAL
public static final String DISCO_TYPE_PROP_KEY
public static final String DISCO_TYPE_PROP_VAL
public static final String FIXED_DOMAIN_PROP_KEY
public static final String REDIRECT_TO_PROP_KEY
protected VHostManagerIfc vHostManager
| Constructor Detail |
|---|
public VirtualComponent()
| Method Detail |
|---|
public boolean handlesLocalDomains()
handlesLocalDomains in interface VHostListenerpublic boolean handlesNameSubdomains()
handlesNameSubdomains in interface VHostListenerpublic boolean handlesNonLocalDomains()
handlesNonLocalDomains in interface VHostListenerpublic void initializationCompleted()
initializationCompleted in interface ServerComponent
public void processPacket(Packet packet,
Queue<Packet> results)
processPacket in interface ServerComponentpacket - results - public void release()
release in interface ServerComponentpublic tigase.xmpp.JID getComponentId()
getComponentId in interface ServerComponentpublic Map<String,Object> getDefaults(Map<String,Object> params)
getDefaults in interface Configurableparams -
public List<tigase.xml.Element> getDiscoFeatures(tigase.xmpp.JID from)
getDiscoFeatures in interface XMPPServicefrom -
public tigase.xml.Element getDiscoInfo(String node,
tigase.xmpp.JID jid,
tigase.xmpp.JID from)
getDiscoInfo in interface XMPPServicenode - jid - from -
public List<tigase.xml.Element> getDiscoItems(String node,
tigase.xmpp.JID jid,
tigase.xmpp.JID from)
getDiscoItems in interface XMPPServicenode - jid - from -
public String getName()
getName in interface ServerComponentpublic boolean isInitializationComplete()
isInitializationComplete in interface ServerComponentpublic void setName(String name)
setName in interface ServerComponentname - public void setProperties(Map<String,Object> properties)
setProperties in interface Configurableproperties - public void setVHostManager(VHostManagerIfc manager)
setVHostManager in interface VHostListenermanager -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||