org.cometd.server
Class ClientImpl

java.lang.Object
  extended by org.cometd.server.ClientImpl
All Implemented Interfaces:
Client
Direct Known Subclasses:
ContinuationClient

public class ClientImpl
extends java.lang.Object
implements Client

Author:
gregw

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)
           
 void addListener(ClientListener listener)
           
protected  void addSubscription(ChannelImpl channel)
           
 void deliver(Client from, java.lang.String toChannel, java.lang.Object data, java.lang.String id)
           
 void deliverLazy(Client from, java.lang.String toChannel, java.lang.Object data, java.lang.String id)
           
 void disconnect()
           
 void doDeliverListeners()
           
protected  void doDelivery(Client from, Message msg)
           
 void endBatch()
           
 boolean equals(java.lang.Object o)
           
 org.eclipse.jetty.util.ajax.JSON.Literal getAdvice()
          Get the advice specific for this Client
 java.lang.String getBrowserId()
           
 java.lang.String getConnectionType()
           
 java.lang.String getId()
           
 int getLag()
           
 int getMaxQueue()
           
 int getMessages()
           
 java.util.Queue<Message> getQueue()
           
 long getTimeout()
           
 boolean hasMessages()
           
 boolean hasNonLazyMessages()
           
 boolean isLocal()
           
 boolean isMetaConnectDeliveryOnly()
           
 void remove(boolean timeout)
           
 void removeListener(ClientListener 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(org.eclipse.jetty.util.ajax.JSON.Literal advice)
           
 void setBrowserId(java.lang.String id)
           
protected  void setConnectionType(java.lang.String type)
           
protected  void setId(java.lang.String id)
           
 void setLag(int lag)
           
 void setMaxQueue(int maxQueue)
           
 void setMetaConnectDeliveryOnly(boolean deliverViaMetaConnectOnly)
           
 void setTimeout(long timeoutMS)
           
 void startBatch()
           
 java.util.List<Message> takeMessages()
           
 java.lang.String toString()
           
protected  void unsubscribeAll()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_bayeux

protected AbstractBayeux _bayeux
Constructor Detail

ClientImpl

protected ClientImpl(AbstractBayeux bayeux)

ClientImpl

protected ClientImpl(AbstractBayeux bayeux,
                     java.lang.String idPrefix)
Method Detail

addExtension

public void addExtension(Extension ext)
Specified by:
addExtension in interface Client

deliver

public void deliver(Client from,
                    java.lang.String toChannel,
                    java.lang.Object data,
                    java.lang.String id)
Specified by:
deliver in interface Client

deliverLazy

public void deliverLazy(Client from,
                        java.lang.String toChannel,
                        java.lang.Object data,
                        java.lang.String id)

doDelivery

protected void doDelivery(Client from,
                          Message msg)

doDeliverListeners

public void doDeliverListeners()

setMetaConnectDeliveryOnly

public void setMetaConnectDeliveryOnly(boolean deliverViaMetaConnectOnly)

isMetaConnectDeliveryOnly

public boolean isMetaConnectDeliveryOnly()

startBatch

public void startBatch()
Specified by:
startBatch in interface Client

endBatch

public void endBatch()
Specified by:
endBatch in interface Client

getConnectionType

public java.lang.String getConnectionType()

getId

public java.lang.String getId()
Specified by:
getId in interface Client

hasMessages

public boolean hasMessages()
Specified by:
hasMessages in interface Client

hasNonLazyMessages

public boolean hasNonLazyMessages()

isLocal

public boolean isLocal()
Specified by:
isLocal in interface Client

disconnect

public void disconnect()
Specified by:
disconnect in interface Client

remove

public void remove(boolean timeout)

responded

public int responded()

responsePending

public int responsePending()

resume

public void resume()
Called by deliver to resume anything waiting on this client.


getMessages

public int getMessages()

takeMessages

public java.util.List<Message> takeMessages()
Specified by:
takeMessages in interface Client

returnMessages

public void returnMessages(java.util.List<Message> messages)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addSubscription

protected void addSubscription(ChannelImpl channel)

removeSubscription

protected void removeSubscription(ChannelImpl channel)

setConnectionType

protected void setConnectionType(java.lang.String type)

setId

protected void setId(java.lang.String id)

unsubscribeAll

protected void unsubscribeAll()

setBrowserId

public void setBrowserId(java.lang.String id)

getBrowserId

public java.lang.String getBrowserId()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getAdvice

public org.eclipse.jetty.util.ajax.JSON.Literal getAdvice()
Get the advice specific for this Client

Returns:
advice specific for this client or null

setAdvice

public void setAdvice(org.eclipse.jetty.util.ajax.JSON.Literal advice)
Parameters:
advice - specific for this client

addListener

public void addListener(ClientListener listener)
Specified by:
addListener in interface Client

removeListener

public void removeListener(ClientListener listener)
Specified by:
removeListener in interface Client

getTimeout

public long getTimeout()

setTimeout

public void setTimeout(long timeoutMS)

setMaxQueue

public void setMaxQueue(int maxQueue)
Specified by:
setMaxQueue in interface Client

getMaxQueue

public int getMaxQueue()
Specified by:
getMaxQueue in interface Client

getQueue

public java.util.Queue<Message> getQueue()
Specified by:
getQueue in interface Client

getLag

public int getLag()
Returns:
The lag in ms as measured by an extension like the TimesyncExtension
See Also:
TimesyncExtension

setLag

public void setLag(int lag)
Parameters:
lag - in ms
See Also:
TimesyncExtension


Copyright © 2009 Dojo Foundation. All Rights Reserved.