|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.cometd.ClientImpl
public class ClientImpl
Field Summary | |
---|---|
protected AbstractBayeux |
_bayeux
|
Constructor Summary | |
---|---|
protected |
ClientImpl(AbstractBayeux bayeux,
String idPrefix,
Listener listener)
|
Method Summary | |
---|---|
protected void |
addSubscription(ChannelImpl channel)
|
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. |
boolean |
equals(Object o)
|
int |
getAdviceVersion()
|
String |
getBrowserId()
|
String |
getConnectionType()
|
String |
getId()
|
Listener |
getListener()
|
int |
getMessages()
|
boolean |
hasMessages()
|
boolean |
isJSONCommented()
|
boolean |
isLocal()
|
int |
onBrowser(String browserId)
|
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. |
protected void |
removeSubscription(ChannelImpl channel)
|
int |
responded()
|
int |
responsePending()
|
void |
resume()
Called by deliver to resume anything waiting on this client. |
void |
setAdviceVersion(int version)
|
void |
setBrowserId(String id)
|
protected void |
setConnectionType(String type)
|
protected void |
setId(String _id)
|
void |
setJSONCommented(boolean commented)
|
void |
setListener(Listener listener)
|
void |
startBatch()
Start a batch of messages. |
void |
subscribe(String toChannel)
Subscribe this client to a channel. |
Map<String,Object> |
takeMessage()
|
List<Map<String,Object>> |
takeMessages()
Take any messages queued for a client. |
String |
toString()
|
void |
unsubscribe(String toChannel)
Unsubscribe this client from a channel. |
protected void |
unsubscribeAll()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected AbstractBayeux _bayeux
Constructor Detail |
---|
protected ClientImpl(AbstractBayeux bayeux, String idPrefix, Listener listener)
Method Detail |
---|
public void publish(String toChannel, Object data, String msgId)
Client
Bayeux.publish(Client, String, Object, String)
with this client passed
as the fromClient.
publish
in interface Client
toChannel
- 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)
Client
Bayeux.subscribe(String, Client)
with this client passed.
Equivalent to getChannel(toChannel).subscribe(subscriber).
subscribe
in interface Client
public void unsubscribe(String toChannel)
Client
Bayeux.unsubscribe(String, Client)
with this client passed.
unsubscribe
in interface Client
public void deliver(Client from, Map<String,Object> message)
Client
deliver
in interface Client
from
- The Client that published the message, or null if not known/availablepublic void startBatch()
Client
startBatch
in interface Client
public void endBatch()
Client
endBatch
in interface Client
public String getConnectionType()
public String getId()
getId
in interface Client
public boolean hasMessages()
hasMessages
in interface Client
public boolean isJSONCommented()
public boolean isLocal()
isLocal
in interface Client
public void remove(boolean timeout)
Client
remove
in interface Client
public int responded()
public int responsePending()
public void resume()
public void setJSONCommented(boolean commented)
commented
- the commented to setpublic void setListener(Listener listener)
setListener
in interface Client
public Listener getListener()
getListener
in interface Client
public int getMessages()
public List<Map<String,Object>> takeMessages()
Client
takeMessages
in interface Client
public Map<String,Object> takeMessage()
public String toString()
toString
in class Object
protected void addSubscription(ChannelImpl channel)
protected void removeSubscription(ChannelImpl channel)
protected void setConnectionType(String type)
protected void setId(String _id)
protected void unsubscribeAll()
public void setBrowserId(String id)
public String getBrowserId()
public int onBrowser(String browserId)
public boolean equals(Object o)
equals
in class Object
public int getAdviceVersion()
public void setAdviceVersion(int version)
advised
- the advised to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |