com.bea.wlevs.adapters.httppubsub.support
Class HttpPubSubHelper.Client

java.lang.Object
  |
  +--com.bea.wlevs.adapters.httppubsub.support.HttpPubSubHelper.Client

public static class HttpPubSubHelper.Client
extends java.lang.Object

PubSub Client representing a single client connection to a pubsub server. This holds state that applies to a given client connection, and is not thread safe.


Constructor Summary
HttpPubSubHelper.Client(java.lang.String serverURL, java.lang.String user, java.lang.String password)
           
 
Method Summary
 com.bea.httppubsub.json.JSONArray connect()
          Send a connect request to the server.
 void disconnect()
          Send disconnect message to the server.
 void handshake()
          Send a handshake request to the server.
 void publish(java.lang.String data, java.lang.String channelName)
          Publish data to a channel
 com.bea.httppubsub.json.JSONArray subscribe(java.lang.String channelName)
          Subscribe to a channel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpPubSubHelper.Client

public HttpPubSubHelper.Client(java.lang.String serverURL,
                               java.lang.String user,
                               java.lang.String password)
Method Detail

handshake

public void handshake()
               throws java.io.IOException
Send a handshake request to the server.

Throws:
java.io.IOException - if the handshake was unsuccessful

connect

public com.bea.httppubsub.json.JSONArray connect()
                                          throws java.io.IOException
Send a connect request to the server. This may block until there is a message available for the client.

Returns:
Response from server, or null if the request was unsuccessful and the server did not return advice "retry"
Throws:
java.io.IOException - if the server returned invalid data

publish

public void publish(java.lang.String data,
                    java.lang.String channelName)
             throws java.io.IOException
Publish data to a channel

Parameters:
data -  
channelName -  
Throws:
java.io.IOException -  

subscribe

public com.bea.httppubsub.json.JSONArray subscribe(java.lang.String channelName)
                                            throws java.io.IOException
Subscribe to a channel

Parameters:
channelName -  
Returns:
Response from server, or null if the request was unsuccessful
Throws:
java.io.IOException -  

disconnect

public void disconnect()
Send disconnect message to the server.


Copyright © 2007 BEA Systems All Rights Reserved.