org.mortbay.cometd
Class ClientImpl

java.lang.Object
  extended by org.mortbay.cometd.ClientImpl
All Implemented Interfaces:
Client

public class ClientImpl
extends Object
implements Client

Author:
gregw

Field Summary
protected  AbstractBayeux _bayeux
           
 
Constructor Summary
protected ClientImpl(AbstractBayeux bayeux, String idPrefix, Listener listener)
           
 
Method Summary
protected  void addSubscription(ChannelImpl channel)
           
 ChannelImpl connect()
          Connect the client.
 void deliver(Client from, Map<String,Object> message)
          Deliver a message to the client Deliver a message directly to the client.
 String getBrowserId()
           
 ChannelImpl getConnection()
           
 String getConnectionType()
           
 String getId()
           
 Listener getListener()
           
 boolean hasMessages()
           
 boolean isJSONCommented()
           
 boolean isLocal()
           
 int onBrowser(String browserId)
           
 void remove(boolean timeout)
           
protected  void removeSubscription(ChannelImpl channel)
           
 int responded()
           
 int responsePending()
           
 void resume()
          Called by deliver to resume anything waiting on this client.
 void setBrowserId(String id)
           
protected  void setConnectionType(String type)
           
protected  void setId(String _id)
           
 void setJSONCommented(boolean commented)
           
 void setListener(Listener listener)
           
 Queue<Map<String,Object>> takeMessages()
          Take any messages queued for a client.
 String toString()
           
protected  void unsubscribeAll()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_bayeux

protected AbstractBayeux _bayeux
Constructor Detail

ClientImpl

protected ClientImpl(AbstractBayeux bayeux,
                     String idPrefix,
                     Listener listener)
Method Detail

connect

public ChannelImpl connect()
Connect the client.

Returns:
the meta Channel for the connection

deliver

public void deliver(Client from,
                    Map<String,Object> message)
Description copied from interface: Client
Deliver a message to the client Deliver a message directly to the client. The message is not filtered or published to a channel.

Specified by:
deliver in interface Client

getConnection

public ChannelImpl getConnection()
Returns:
the meta Channel for the connection or null if not connected.

getConnectionType

public String getConnectionType()

getId

public String getId()
Specified by:
getId in interface Client

hasMessages

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

isJSONCommented

public boolean isJSONCommented()
Returns:
the commented

isLocal

public boolean isLocal()
Specified by:
isLocal in interface Client
Returns:
True if the client is local

remove

public void remove(boolean timeout)
Specified by:
remove in interface Client

responded

public int responded()

responsePending

public int responsePending()

resume

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


setJSONCommented

public void setJSONCommented(boolean commented)
Parameters:
commented - the commented to set

setListener

public void setListener(Listener listener)
Specified by:
setListener in interface Client

getListener

public Listener getListener()
Specified by:
getListener in interface Client

takeMessages

public Queue<Map<String,Object>> takeMessages()
Description copied from interface: Client
Take any messages queued for a client.

Specified by:
takeMessages in interface Client

toString

public String toString()
Overrides:
toString in class Object

addSubscription

protected void addSubscription(ChannelImpl channel)

removeSubscription

protected void removeSubscription(ChannelImpl channel)

setConnectionType

protected void setConnectionType(String type)

setId

protected void setId(String _id)

unsubscribeAll

protected void unsubscribeAll()

setBrowserId

public void setBrowserId(String id)

getBrowserId

public String getBrowserId()

onBrowser

public int onBrowser(String browserId)


Copyright © 2007 Mort Bay Consulting. All Rights Reserved.