|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.client.protocol.xmlrpc.XmlRpcConnection
public class XmlRpcConnection
This is an xmlBlaster proxy. It implements the interface I_XmlBlasterConnection. The client can invoke it as if the xmlBlaster would be on the same VM, making this way the xml-rpc protocol totally transparent.
Field Summary | |
---|---|
private static java.lang.String |
AUTH
|
protected Address |
clientAddress
|
protected ConnectReturnQos |
connectReturnQos
|
private boolean |
contentAsString
|
private boolean |
forceNewConnectionOnReconnect
This flag is used since it may be necessary to throw away the connection if a proxy or a gateway is somehow holding the session and after a failure constantly throwing exceptions. |
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
ME
|
protected PluginInfo |
pluginInfo
|
private java.lang.String |
secretSessionId
|
private XmlScriptSerializer |
serializer
|
private java.lang.String |
sessionId
|
static java.lang.String |
XML_SCRIPT_INVOKE
|
private static java.lang.String |
XMLBLASTER
|
private org.apache.xmlrpc.client.XmlRpcClient |
xmlRpcClient
|
private XmlRpcUrl |
xmlRpcUrl
|
private boolean |
xmlScript
|
Constructor Summary | |
---|---|
XmlRpcConnection()
Called by plugin loader which calls init(Global, PluginInfo) thereafter. |
|
XmlRpcConnection(Global glob)
Connect to xmlBlaster using XMLRPC. |
|
XmlRpcConnection(Global glob,
java.applet.Applet ap)
Connect to xmlBlaster using XMLRPC. |
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. |
static XmlBlasterException |
extractXmlBlasterException(Global glob,
org.apache.xmlrpc.XmlRpcException e,
ErrorCode fallback,
java.lang.String txt)
Helma XmlRpc does in XmlRpcServer.java:314 an exception.toString() which is sent back to the client. |
static XmlBlasterException |
extractXmlBlasterException(Global glob,
org.apache.xmlrpc.XmlRpcException e,
java.lang.String txt)
|
MsgUnitRaw[] |
get(java.lang.String xmlKey_literal,
java.lang.String qos_literal)
Synchronous access a message. |
XmlRpcConnection |
getCopy()
|
java.lang.String |
getProtocol()
|
XmlScriptSerializer |
getSerializer()
This is used by the callback driver in case the xmlScript has been set to true (for update responses and ca |
java.lang.String |
getSessionId()
|
java.lang.String |
getType()
Enforced by I_Plugin |
void |
getUpdates(I_CallbackExtended cb)
Publish multiple messages in one sweep. |
java.lang.String |
getVersion()
Enforced by I_Plugin |
org.apache.xmlrpc.client.XmlRpcClient |
getXmlRpcClient()
|
void |
init(Global global,
PluginInfo plInfo)
This method is called by the PluginManager (enforced by I_Plugin). |
boolean |
isLoggedIn()
|
static void |
main(java.lang.String[] args)
For Testing. |
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 |
sendAckOrEx(java.lang.String uniqueId,
java.lang.String[] acks,
java.lang.String exTxt)
|
void |
sendShutdownCb()
|
private java.lang.Object |
sendXmlScript(java.lang.String literal,
java.lang.String prefix,
boolean singleChannel)
|
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 |
---|
private java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private XmlRpcUrl xmlRpcUrl
private org.apache.xmlrpc.client.XmlRpcClient xmlRpcClient
private java.lang.String sessionId
protected ConnectReturnQos connectReturnQos
protected Address clientAddress
protected PluginInfo pluginInfo
private java.lang.String secretSessionId
private boolean contentAsString
private boolean xmlScript
private XmlScriptSerializer serializer
private static final java.lang.String AUTH
private static final java.lang.String XMLBLASTER
public static final java.lang.String XML_SCRIPT_INVOKE
private boolean forceNewConnectionOnReconnect
Constructor Detail |
---|
public XmlRpcConnection()
public XmlRpcConnection(Global glob) throws XmlBlasterException
XmlBlasterException
public XmlRpcConnection(Global glob, java.applet.Applet ap) throws XmlBlasterException
XmlBlasterException
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 global, PluginInfo plInfo) throws XmlBlasterException
init
in interface I_Plugin
XmlBlasterException
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)
public XmlRpcConnection getCopy() throws XmlBlasterException
XmlBlasterException
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 XmlScriptSerializer getSerializer()
public void resetConnection()
I_XmlBlasterConnection
resetConnection
in interface I_XmlBlasterConnection
public org.apache.xmlrpc.client.XmlRpcClient getXmlRpcClient() throws XmlBlasterException
XmlBlasterException
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) throws XmlBlasterException
I_XmlBlasterConnection
setConnectReturnQos
in interface I_XmlBlasterConnection
XmlBlasterException
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
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
public final void publishOneway(MsgUnitRaw[] msgUnitArr) throws XmlBlasterException
publishOneway
in interface I_XmlBlasterConnection
XmlBlasterException
public final java.lang.String[] erase(java.lang.String xmlKey_literal, java.lang.String qos_literal) throws XmlBlasterException
erase
in interface I_XmlBlasterConnection
XmlBlasterException
public final MsgUnitRaw[] get(java.lang.String xmlKey_literal, java.lang.String qos_literal) throws XmlBlasterException
get
in interface I_XmlBlasterConnection
XmlBlasterException
public static XmlBlasterException extractXmlBlasterException(Global glob, org.apache.xmlrpc.XmlRpcException e, java.lang.String txt)
public static XmlBlasterException extractXmlBlasterException(Global glob, org.apache.xmlrpc.XmlRpcException e, ErrorCode fallback, java.lang.String txt)
glob
- e
- The original exceptionfallback
- The error code to use if e is unparsablepublic 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 final void getUpdates(I_CallbackExtended cb) throws XmlBlasterException
XmlBlasterException
public void sendAckOrEx(java.lang.String uniqueId, java.lang.String[] acks, java.lang.String exTxt)
public void sendShutdownCb()
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()
private final java.lang.Object sendXmlScript(java.lang.String literal, java.lang.String prefix, boolean singleChannel) throws org.apache.xmlrpc.XmlRpcException, XmlBlasterException
org.apache.xmlrpc.XmlRpcException
XmlBlasterException
public static void main(java.lang.String[] args)
java org.xmlBlaster.client.protocol.xmlrpc.XmlRpcConnection
public java.lang.String getSessionId()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |