|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cometd.server.ClientImpl
public class ClientImpl
Field Summary | |
---|---|
protected AbstractBayeux |
_bayeux
|
Constructor Summary | |
---|---|
protected |
ClientImpl(AbstractBayeux bayeux)
|
protected |
ClientImpl(AbstractBayeux bayeux,
java.lang.String idPrefix)
|
Method Summary | |
---|---|
void |
addExtension(Extension ext)
Adds a bayeux client extension. |
void |
addListener(ClientListener listener)
Adds a listener. |
protected void |
addSubscription(ChannelImpl channel)
|
void |
deliver(Client from,
java.lang.String toChannel,
java.lang.Object data,
java.lang.String id)
Delivers a message to the remote client represented by this object. |
void |
deliverLazy(Client from,
java.lang.String toChannel,
java.lang.Object data,
java.lang.String id)
|
void |
disconnect()
Disconnects this Client from the server. |
void |
doDeliverListeners()
|
protected void |
doDelivery(Client from,
Message msg)
|
void |
endBatch()
Ends a batch of messages. |
boolean |
equals(java.lang.Object o)
|
JSON.Literal |
getAdvice()
Get the advice specific for this Client |
java.lang.String |
getBrowserId()
|
java.lang.String |
getConnectionType()
|
java.lang.String |
getId()
|
long |
getInterval()
|
int |
getLag()
|
int |
getMaxQueue()
|
int |
getMessages()
|
java.util.Queue<Message> |
getQueue()
|
Channel[] |
getSubscriptions()
Get the subscribed to channels |
long |
getTimeout()
|
boolean |
hasMessages()
|
boolean |
hasNonLazyMessages()
|
boolean |
isExpired()
|
boolean |
isLocal()
|
boolean |
isMetaConnectDeliveryOnly()
|
void |
lazyResume()
Called by deliver to resume anything waiting on this client lazily |
void |
remove(boolean timeout)
|
void |
removeExtension(Extension ext)
Removes a bayeux client extension. |
void |
removeListener(ClientListener listener)
Removes a listener |
protected void |
removeSubscription(ChannelImpl channel)
|
int |
responded()
|
int |
responsePending()
|
void |
resume()
Called by deliver to resume anything waiting on this client. |
void |
returnMessages(java.util.List<Message> messages)
|
void |
setAdvice(JSON.Literal advice)
|
void |
setBrowserId(java.lang.String id)
|
protected void |
setConnectionType(java.lang.String type)
|
protected void |
setId(java.lang.String id)
|
void |
setInterval(long intervalMS)
Set per client interval |
void |
setLag(int lag)
|
void |
setMaxQueue(int maxQueue)
|
void |
setMetaConnectDeliveryOnly(boolean deliverViaMetaConnectOnly)
|
void |
setTimeout(long timeoutMS)
Set per client timeout |
void |
startBatch()
Starts a batch of messages. |
java.util.List<Message> |
takeMessages()
Takes any messages queued for a client. |
java.lang.String |
toString()
|
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)
protected ClientImpl(AbstractBayeux bayeux, java.lang.String idPrefix)
Method Detail |
---|
public void addExtension(Extension ext)
Client
addExtension
in interface Client
ext
- the extension to addClient.removeExtension(Extension)
public void removeExtension(Extension ext)
Client
removeExtension
in interface Client
ext
- the extension to remove��Client.addExtension(Extension)
public void deliver(Client from, java.lang.String toChannel, java.lang.Object data, java.lang.String id)
Client
deliver
in interface Client
from
- the Client that sends the messagetoChannel
- the channel onto which the message is sentdata
- the data of the messageid
- the message IDpublic void deliverLazy(Client from, java.lang.String toChannel, java.lang.Object data, java.lang.String id)
protected void doDelivery(Client from, Message msg)
public void doDeliverListeners()
public void setMetaConnectDeliveryOnly(boolean deliverViaMetaConnectOnly)
public boolean isMetaConnectDeliveryOnly()
public void startBatch()
Client
Client.endBatch()
is called.
Batches may be nested and messages are only sent once all batches are ended.
startBatch
in interface Client
Client.endBatch()
public void endBatch()
Client
Client.startBatch()
is called.
Batches may be nested and messages are only sent once all batches are ended.
endBatch
in interface Client
Client.startBatch()
public java.lang.String getConnectionType()
public java.lang.String getId()
getId
in interface Client
public boolean hasMessages()
hasMessages
in interface Client
public boolean hasNonLazyMessages()
public boolean isLocal()
isLocal
in interface Client
public void disconnect()
Client
disconnect
in interface Client
public void remove(boolean timeout)
public boolean isExpired()
public int responded()
public int responsePending()
public void lazyResume()
public void resume()
public int getMessages()
public java.util.List<Message> takeMessages()
Client
takeMessages
in interface Client
public void returnMessages(java.util.List<Message> messages)
public java.lang.String toString()
toString
in class java.lang.Object
protected void addSubscription(ChannelImpl channel)
protected void removeSubscription(ChannelImpl channel)
protected void setConnectionType(java.lang.String type)
protected void setId(java.lang.String id)
public void unsubscribeAll()
public void setBrowserId(java.lang.String id)
public java.lang.String getBrowserId()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public JSON.Literal getAdvice()
public void setAdvice(JSON.Literal advice)
advice
- specific for this clientpublic void addListener(ClientListener listener)
Client
addListener
in interface Client
listener
- the listener to addClient.removeListener(ClientListener)
public void removeListener(ClientListener listener)
Client
removeListener
in interface Client
listener
- the listener to removeClient.addListener(ClientListener)
public long getInterval()
public void setInterval(long intervalMS)
intervalMS
- timeout in MS for longpoll duration or 0 to use default from
AbstractBayeux.getMaxInterval()
.public long getTimeout()
public void setTimeout(long timeoutMS)
timeoutMS
- timeout in MS for longpoll duration or 0 to use default from
AbstractBayeux.getTimeout()
.public void setMaxQueue(int maxQueue)
setMaxQueue
in interface Client
maxQueue
- The size which if a client queue exceeds, forces a call to
QueueListener.queueMaxed(Client, Client, Message)
to check if the message should be added.
If set to -1, there is no queue limit. If set to zero, messages are not queued.Client.getMaxQueue()
public int getMaxQueue()
getMaxQueue
in interface Client
Client.setMaxQueue(int)
public java.util.Queue<Message> getQueue()
getQueue
in interface Client
public int getLag()
TimesyncExtension
public void setLag(int lag)
lag
- in msTimesyncExtension
public Channel[] getSubscriptions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |