|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mortbay.cometd.client.BayeuxClient
public class BayeuxClient
| Constructor Summary | |
|---|---|
BayeuxClient(HttpClient client,
InetSocketAddress address,
String uri)
|
|
| Method Summary | |
|---|---|
void |
deliver(Client from,
Map<String,Object> message)
Deliver a message to this client only Deliver a message directly to the client. |
void |
endBatch()
End a batch of messages. |
String |
getClientId()
|
String |
getId()
|
Listener |
getListener()
|
boolean |
hasMessages()
|
boolean |
isLocal()
|
boolean |
isPolling()
|
void |
publish(String toChannel,
Object data,
String msgId)
Publish data from this client. |
void |
remove(boolean timeout)
Remove Client Unsubscribe client from all channels and remove it. |
void |
setListener(Listener listener)
|
void |
start()
|
void |
startBatch()
Start a batch of messages. |
void |
subscribe(String toChannel)
Subscribe this client to a channel. |
Queue<Map<String,Object>> |
takeMessages()
Take any messages queued for a client. |
void |
unsubscribe(String toChannel)
Unsubscribe this client from a channel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BayeuxClient(HttpClient client,
InetSocketAddress address,
String uri)
throws IOException
IOException| Method Detail |
|---|
public String getClientId()
public void start()
public boolean isPolling()
public void deliver(Client from,
Map<String,Object> message)
Client
deliver in interface Clientfrom - The Client that published the message, or null if not known/availablepublic String getId()
getId in interface Clientpublic Listener getListener()
getListener in interface Clientpublic boolean hasMessages()
hasMessages in interface Clientpublic boolean isLocal()
isLocal in interface Client
public void publish(String toChannel,
Object data,
String msgId)
ClientBayeux.publish(Client, String, Object, String) with this client passed.
publish in interface ClienttoChannel - The Channel ID to which the data is targetteddata - The data itself which must be an Object that can be encoded with JSON.msgId - optional message ID or null for automatic generation of a message ID.public void subscribe(String toChannel)
ClientBayeux.subscribe(String, Client) with this client passed.
Equivalent to getChannel(toChannel).subscribe(subscriber).
subscribe in interface Clientpublic void unsubscribe(String toChannel)
ClientBayeux.unsubscribe(String, Client) with this client passed.
unsubscribe in interface Clientpublic void remove(boolean timeout)
Client
remove in interface Clientpublic void setListener(Listener listener)
setListener in interface Clientpublic Queue<Map<String,Object>> takeMessages()
Client
takeMessages in interface Clientpublic void endBatch()
Client
endBatch in interface Clientpublic void startBatch()
Client
startBatch in interface Client
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||