xmlBlaster 2.2.0 API

org.xmlBlaster.client.protocol.http.common
Interface I_XmlBlasterAccessRaw

All Known Implementing Classes:
XmlBlasterAccessRaw, XmlBlasterAccessRawBase

public interface I_XmlBlasterAccessRaw

Interface for XmlBlaster, the supported methods on applet client side.

All returned parameters are hold in Hashtables, to access the different key/QoS elements use JXPath syntax, see the API references below for more details.

Author:
Marcel Ruff
See Also:
MsgQosData.toJXPath(), MsgKeyData.toJXPath(), The interface requirement, CORBA xmlBlaster.idl

Field Summary
static java.lang.String CONNECT_NAME
           
static java.lang.String CREATE_SESSIONID_NAME
           
static java.lang.String DISCONNECT_NAME
           
static java.lang.String ERASE_NAME
           
static java.lang.String EXCEPTION_NAME
           
static java.lang.String GET_NAME
           
static java.lang.String PING_NAME
           
static java.lang.String PONG_NAME
           
static java.lang.String PUBLISH_NAME
           
static java.lang.String SUBSCRIBE_NAME
           
static java.lang.String UNSUBSCRIBE_NAME
           
static java.lang.String UPDATE_NAME
           
 
Method Summary
 java.lang.String connect(java.lang.String qos, I_CallbackRaw callback)
          Connect to xmlBlaster.
 I_Connection createConnection(java.lang.String urlString)
          Creates a connection to the specified servlet.
 void disconnect(java.lang.String qos)
           
 java.util.Hashtable[] erase(java.lang.String xmlKey, java.lang.String qos)
           
 Msg[] get(java.lang.String xmlKey, java.lang.String qos)
           
 java.util.Hashtable getHtmlProperties()
          Get a list of all PARAM in the HTML file following our convention.
 java.lang.String getInstanceId()
          Access the unique counter of this object instance for logging.
 boolean isConnected()
          Check wether we are connected
 void log(java.lang.String location, java.lang.String level, java.lang.String text)
          Log to the logListener or to the java console of the browser if logListener is null.
 java.util.Hashtable ping(java.lang.String qos)
          Returns "/qos/state/@info"="OK" if communication from servlet to xmlBlaster is OK
Returns "/qos/state/@info"="POLLING" if communication from servlet to xmlBlaster is down but polling
Returns "/qos/state/@info"="DEAD" if communication from servlet to xmlBlaster is permanently lost
 java.util.Hashtable publish(java.lang.String xmlKey, byte[] content, java.lang.String qos)
           
 java.lang.String sendXmlScript(java.lang.String xmlRequest)
          Send a xml script request to xmlBlaster.
 void setLogListener(I_Log logListener)
          Register to receive the logging output
 java.util.Hashtable subscribe(java.lang.String xmlKey, java.lang.String qos)
           
 java.util.Hashtable[] unSubscribe(java.lang.String xmlKey, java.lang.String qos)
           
 

Field Detail

CONNECT_NAME

static final java.lang.String CONNECT_NAME
See Also:
Constant Field Values

PUBLISH_NAME

static final java.lang.String PUBLISH_NAME
See Also:
Constant Field Values

GET_NAME

static final java.lang.String GET_NAME
See Also:
Constant Field Values

SUBSCRIBE_NAME

static final java.lang.String SUBSCRIBE_NAME
See Also:
Constant Field Values

UNSUBSCRIBE_NAME

static final java.lang.String UNSUBSCRIBE_NAME
See Also:
Constant Field Values

ERASE_NAME

static final java.lang.String ERASE_NAME
See Also:
Constant Field Values

DISCONNECT_NAME

static final java.lang.String DISCONNECT_NAME
See Also:
Constant Field Values

EXCEPTION_NAME

static final java.lang.String EXCEPTION_NAME
See Also:
Constant Field Values

CREATE_SESSIONID_NAME

static final java.lang.String CREATE_SESSIONID_NAME
See Also:
Constant Field Values

PONG_NAME

static final java.lang.String PONG_NAME
See Also:
Constant Field Values

PING_NAME

static final java.lang.String PING_NAME
See Also:
Constant Field Values

UPDATE_NAME

static final java.lang.String UPDATE_NAME
See Also:
Constant Field Values
Method Detail

getInstanceId

java.lang.String getInstanceId()
Access the unique counter of this object instance for logging.


sendXmlScript

java.lang.String sendXmlScript(java.lang.String xmlRequest)
                               throws java.lang.Exception
Send a xml script request to xmlBlaster. You need to call connect() first!

Returns:
xml script returned
Throws:
java.lang.Exception
See Also:
client.script requirement

connect

java.lang.String connect(java.lang.String qos,
                         I_CallbackRaw callback)
                         throws java.lang.Exception
Connect to xmlBlaster.

Parameters:
qos - If your qos is null the APPLET PARAMs will be checked for"xmlBlaster/loginName" and "xmlBlaster/passwd"
If your qos is "" the servlet will choose its configured connectQoS (take care on security issues!)
If qos is not null and pre-filled with authentication informations it will be used to authenticate at xmlBlaster
callback - Where to send asynchronous callback messages.
Returns:
never null TODO!!!: return JXPath Hashtable for easier parameter access Currently the ConnectQos.toXml() is returned
Throws:
java.lang.Exception

isConnected

boolean isConnected()
Check wether we are connected


ping

java.util.Hashtable ping(java.lang.String qos)
                         throws java.lang.Exception
Returns "/qos/state/@info"="OK" if communication from servlet to xmlBlaster is OK
Returns "/qos/state/@info"="POLLING" if communication from servlet to xmlBlaster is down but polling
Returns "/qos/state/@info"="DEAD" if communication from servlet to xmlBlaster is permanently lost

Returns:
never null, contains QoS in XJPath format
Throws:
java.lang.Exception

subscribe

java.util.Hashtable subscribe(java.lang.String xmlKey,
                              java.lang.String qos)
                              throws java.lang.Exception
Returns:
never null, contains QoS in XJPath format
Throws:
java.lang.Exception

get

Msg[] get(java.lang.String xmlKey,
          java.lang.String qos)
          throws java.lang.Exception
Returns:
never null, contains keys and QoS in XJPath format
Throws:
java.lang.Exception

unSubscribe

java.util.Hashtable[] unSubscribe(java.lang.String xmlKey,
                                  java.lang.String qos)
                                  throws java.lang.Exception
Returns:
never null, contains QoS in XJPath format
Throws:
java.lang.Exception

publish

java.util.Hashtable publish(java.lang.String xmlKey,
                            byte[] content,
                            java.lang.String qos)
                            throws java.lang.Exception
Returns:
never null, contains QoS in XJPath format
Throws:
java.lang.Exception

erase

java.util.Hashtable[] erase(java.lang.String xmlKey,
                            java.lang.String qos)
                            throws java.lang.Exception
Returns:
never null, contains QoS in XJPath format
Throws:
java.lang.Exception

disconnect

void disconnect(java.lang.String qos)

setLogListener

void setLogListener(I_Log logListener)
Register to receive the logging output


log

void log(java.lang.String location,
         java.lang.String level,
         java.lang.String text)
Log to the logListener or to the java console of the browser if logListener is null.

Parameters:
location - Your class and/or method name
leve - One of "ERROR", "WARN", "INFO", "DEBUG"
text - The text to log

getHtmlProperties

java.util.Hashtable getHtmlProperties()
Get a list of all PARAM in the HTML file following our convention.

All param names starting with "servlet/" are passed to the servlet. They must start with "servlet/xyz=someValue". The "servlet/" will be stripped away and in the web-servlet will arrive "xyz=someValue". The key/values are send in the URL.

As the applet class has no getAllParameters() method we expect a PARAM deliveredParamKeys which contains a list of all delivered PARAM in the HTML page:

    <applet ...>
       <param name="deliveredParamKeys" value="protocol,anotherKey,Key3">
       <param name="protocol" value="SOCKET">
       <param name="anotherKey" value="someValue">
       <param name="Key3" value="xxx">
    </applet>
 

It may contain additional customized properties from the applet programmer.

Returns:
The found parameters

createConnection

I_Connection createConnection(java.lang.String urlString)
                              throws java.lang.Exception
Creates a connection to the specified servlet.

Parameters:
urlString -
Returns:
Throws:
java.lang.Exception

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.