|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.client.protocol.local.LocalConnection
public class LocalConnection
A local connections.
This driver may be used to get in vm direct calls into XmlBlaster. Some sutiations this may be used is to write a plgin for the client that gets started in the standalone XmlBlaster, or to be used when XMlBlaster is access in the same embedded anvironment, such as JBoss.
There is one very important requirement for this to work: The client that gets the XmlBlasterAccess from wich this driver is instantiated MUST have access to the serverside engine.Global singleton, it MUST use a cloned Global for each connection that contains the engine.Global in the cloned globals objectEntry at key: ServerNodeScope.
LocalCallbackImpl
,
org.xmlBlaster.protocol.local.CallbackLocalDriver
Field Summary | |
---|---|
protected Address |
clientAddress
|
protected ConnectReturnQos |
connectReturnQos
|
Constructor Summary | |
---|---|
LocalConnection()
Called by plugin loader which calls init(Global, PluginInfo) thereafter. |
Method Summary | |
---|---|
java.lang.String |
connect(java.lang.String connectQos)
Login to the server. |
void |
connectLowlevel(Address address)
Initialize the driver and verify if the remote side is reachable on the low-level protocol layer. |
boolean |
disconnect(java.lang.String disconnectQos)
Does a logout. |
java.lang.String[] |
erase(java.lang.String xmlKey_literal,
java.lang.String qos_literal)
Delete messages. |
MsgUnitRaw[] |
get(java.lang.String xmlKey_literal,
java.lang.String qos_literal)
Synchronous access a message. |
java.lang.String |
getProtocol()
|
java.lang.String |
getType()
Enforced by I_Plugin |
java.lang.String |
getVersion()
Enforced by I_Plugin |
void |
init(Global glob_,
PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin). |
boolean |
isLoggedIn()
|
java.lang.String |
ping(java.lang.String str)
Check server. |
java.lang.String |
publish(MsgUnitRaw msgUnit)
Publish a message. |
java.lang.String[] |
publishArr(MsgUnitRaw[] msgUnitArr)
Publish multiple messages in one sweep. |
void |
publishOneway(MsgUnitRaw[] msgUnitArr)
Publish multiple messages in one sweep. |
I_ProgressListener |
registerProgressListener(I_ProgressListener listener)
Register a listener for to receive information about the progress of incoming data. |
void |
resetConnection()
Reset the driver on problems. |
void |
setConnectReturnQos(ConnectReturnQos connectReturnQos)
Pass the driver the decrypted and parsed ConnectReturnQos directly after a connect. |
void |
shutdown()
Shut down. |
java.lang.String |
subscribe(java.lang.String xmlKey_literal,
java.lang.String qos_literal)
Enforced by I_XmlBlasterConnection interface (failsafe mode). |
java.lang.String |
toXml()
|
java.lang.String |
toXml(java.lang.String extraOffset)
Dump of the server, remove in future. |
java.lang.String[] |
unSubscribe(java.lang.String xmlKey_literal,
java.lang.String qos_literal)
Unsubscribe from messages. |
static java.lang.String |
usage()
Command line usage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConnectReturnQos connectReturnQos
protected Address clientAddress
Constructor Detail |
---|
public LocalConnection()
Method Detail |
---|
public java.lang.String getType()
getType
in interface I_Plugin
public java.lang.String getVersion()
getVersion
in interface I_Plugin
public void init(Global glob_, PluginInfo pluginInfo) throws XmlBlasterException
The given global must contain the serverside org.xmlBlaster.engine.Global in its ObjectEntry "ServerNodeScope"
init
in interface I_Plugin
XmlBlasterException
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)
public final java.lang.String getProtocol()
getProtocol
in interface I_XmlBlasterConnection
public void connectLowlevel(Address address) throws XmlBlasterException
I_XmlBlasterConnection
connectLowlevel
in interface I_XmlBlasterConnection
address
- Contains the remote address,
e.g. the host and port where the remote server listens
XmlBlasterException
- ErrorCode.COMMUNICATION* if the server is not reachable,
in this case we can poll for the server.I_XmlBlasterConnection.connectLowlevel(Address)
public void resetConnection()
I_XmlBlasterConnection
resetConnection
in interface I_XmlBlasterConnection
public java.lang.String connect(java.lang.String connectQos) throws XmlBlasterException
connect
in interface I_XmlBlasterConnection
connectQos
- The encrypted connect QoS
XmlBlasterException
- if login failspublic void setConnectReturnQos(ConnectReturnQos connectReturnQos)
I_XmlBlasterConnection
setConnectReturnQos
in interface I_XmlBlasterConnection
I_XmlBlasterConnection.setConnectReturnQos(ConnectReturnQos)
public boolean disconnect(java.lang.String disconnectQos)
disconnect
in interface I_XmlBlasterConnection
sessionId
- The client sessionIdpublic void shutdown() throws XmlBlasterException
shutdown
in interface I_XmlBlasterConnection
shutdown
in interface I_Plugin
XmlBlasterException
- if an exception occurs. The exception is
handled by the RunLevelManager depending on how the plugin has been
configured with the action:
<action do='STOP' onShutdownRunlevel='2' sequence='5'
onFail='resource.configuration.pluginFailed'>
If onFail is defined to something, the RunLevelManager will stop.public boolean isLoggedIn()
isLoggedIn
in interface I_XmlBlasterConnection
public final java.lang.String subscribe(java.lang.String xmlKey_literal, java.lang.String qos_literal) throws XmlBlasterException
subscribe
in interface I_XmlBlasterConnection
XmlBlasterException
public final java.lang.String[] unSubscribe(java.lang.String xmlKey_literal, java.lang.String qos_literal) throws XmlBlasterException
unSubscribe
in interface I_XmlBlasterConnection
XmlBlasterException
RequestBroker
public final java.lang.String publish(MsgUnitRaw msgUnit) throws XmlBlasterException
publish
in interface I_XmlBlasterConnection
XmlBlasterException
public final java.lang.String[] publishArr(MsgUnitRaw[] msgUnitArr) throws XmlBlasterException
publishArr
in interface I_XmlBlasterConnection
XmlBlasterException
RequestBroker
public final void publishOneway(MsgUnitRaw[] msgUnitArr) throws XmlBlasterException
publishOneway
in interface I_XmlBlasterConnection
XmlBlasterException
RequestBroker
public final java.lang.String[] erase(java.lang.String xmlKey_literal, java.lang.String qos_literal) throws XmlBlasterException
erase
in interface I_XmlBlasterConnection
XmlBlasterException
RequestBroker
public final MsgUnitRaw[] get(java.lang.String xmlKey_literal, java.lang.String qos_literal) throws XmlBlasterException
get
in interface I_XmlBlasterConnection
XmlBlasterException
RequestBroker
public java.lang.String ping(java.lang.String str) throws XmlBlasterException
ping
in interface I_XmlBlasterConnection
XmlBlasterException
public java.lang.String toXml() throws XmlBlasterException
XmlBlasterException
public java.lang.String toXml(java.lang.String extraOffset) throws XmlBlasterException
XmlBlasterException
public I_ProgressListener registerProgressListener(I_ProgressListener listener)
registerProgressListener
in interface I_XmlBlasterConnection
listener
- Your listener, pass 0 to unregister.
public static java.lang.String usage()
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |