org.cometd.client
Class BayeuxClient
java.lang.Object
org.cometd.common.AbstractClientSession
org.cometd.client.BayeuxClient
- All Implemented Interfaces:
- Bayeux, ClientSession, Session
public class BayeuxClient
- extends AbstractClientSession
- implements Bayeux
|
Method Summary |
void |
abort()
|
void |
disconnect()
|
protected void |
enqueueSend(Message.Mutable message)
|
protected void |
failMessages(Throwable x,
Message... messages)
|
List<String> |
getAllowedTransports()
|
long |
getBackoffIncrement()
|
String |
getCookie(String name)
|
String |
getId()
|
Set<String> |
getKnownTransportNames()
|
long |
getMaxBackoff()
|
Object |
getOption(String qualifiedName)
|
Set<String> |
getOptionNames()
|
Map<String,Object> |
getOptions()
|
protected BayeuxClient.State |
getState()
|
Transport |
getTransport(String transport)
|
void |
handshake()
|
BayeuxClient.State |
handshake(long waitMs)
|
void |
handshake(Map<String,Object> handshakeFields)
|
BayeuxClient.State |
handshake(Map<String,Object> template,
long waitMs)
|
protected void |
initialize()
|
boolean |
isConnected()
|
boolean |
isDisconnected()
|
boolean |
isHandshook()
|
protected AbstractClientSession.AbstractSessionChannel |
newChannel(ChannelId channelId)
|
protected ChannelId |
newChannelId(String channelId)
|
protected Message.Mutable |
newMessage()
|
void |
onFailure(Throwable x,
Message[] messages)
|
void |
onMessages(List<Message.Mutable> messages)
|
void |
onSending(Message[] messages)
|
protected void |
processConnect(Message.Mutable connect)
|
protected void |
processDisconnect(Message.Mutable disconnect)
|
protected void |
processHandshake(Message.Mutable handshake)
|
protected void |
processMessage(Message.Mutable message)
|
protected boolean |
scheduleConnect(long interval,
long backoff)
|
protected boolean |
scheduleHandshake(long interval,
long backoff)
|
protected void |
sendBatch()
|
protected boolean |
sendConnect()
|
protected boolean |
sendHandshake()
|
protected boolean |
sendMessages(Message.Mutable... messages)
|
void |
setCookie(String name,
String value)
|
void |
setCookie(String name,
String value,
int maxAge)
|
void |
setOption(String qualifiedName,
Object value)
|
protected void |
terminate()
|
boolean |
waitFor(long waitMs,
BayeuxClient.State state,
BayeuxClient.State... states)
|
| Methods inherited from class org.cometd.common.AbstractClientSession |
addExtension, batch, dump, endBatch, extendRcv, extendSend, getAttribute, getAttributeNames, getChannel, getChannels, isBatching, newMessageId, receive, removeAttribute, removeExtension, setAttribute, startBatch |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BACKOFF_INCREMENT_OPTION
public static final String BACKOFF_INCREMENT_OPTION
- See Also:
- Constant Field Values
MAX_BACKOFF_OPTION
public static final String MAX_BACKOFF_OPTION
- See Also:
- Constant Field Values
BAYEUX_VERSION
public static final String BAYEUX_VERSION
- See Also:
- Constant Field Values
BayeuxClient
public BayeuxClient(String url,
ClientTransport transport,
ClientTransport... transports)
BayeuxClient
public BayeuxClient(String url,
ScheduledExecutorService scheduler,
ClientTransport transport,
ClientTransport... transports)
getBackoffIncrement
public long getBackoffIncrement()
getMaxBackoff
public long getMaxBackoff()
getCookie
public String getCookie(String name)
setCookie
public void setCookie(String name,
String value)
setCookie
public void setCookie(String name,
String value,
int maxAge)
getId
public String getId()
- Specified by:
getId in interface Session
isConnected
public boolean isConnected()
- Specified by:
isConnected in interface Session
isHandshook
public boolean isHandshook()
- Specified by:
isHandshook in interface Session
isDisconnected
public boolean isDisconnected()
getState
protected BayeuxClient.State getState()
handshake
public void handshake()
- Specified by:
handshake in interface ClientSession
handshake
public void handshake(Map<String,Object> handshakeFields)
- Specified by:
handshake in interface ClientSession
handshake
public BayeuxClient.State handshake(long waitMs)
handshake
public BayeuxClient.State handshake(Map<String,Object> template,
long waitMs)
sendHandshake
protected boolean sendHandshake()
waitFor
public boolean waitFor(long waitMs,
BayeuxClient.State state,
BayeuxClient.State... states)
sendConnect
protected boolean sendConnect()
newChannelId
protected ChannelId newChannelId(String channelId)
- Specified by:
newChannelId in class AbstractClientSession
newChannel
protected AbstractClientSession.AbstractSessionChannel newChannel(ChannelId channelId)
- Specified by:
newChannel in class AbstractClientSession
sendBatch
protected void sendBatch()
- Specified by:
sendBatch in class AbstractClientSession
sendMessages
protected boolean sendMessages(Message.Mutable... messages)
disconnect
public void disconnect()
- Specified by:
disconnect in interface Session
abort
public void abort()
processMessage
protected void processMessage(Message.Mutable message)
processHandshake
protected void processHandshake(Message.Mutable handshake)
processConnect
protected void processConnect(Message.Mutable connect)
processDisconnect
protected void processDisconnect(Message.Mutable disconnect)
scheduleHandshake
protected boolean scheduleHandshake(long interval,
long backoff)
scheduleConnect
protected boolean scheduleConnect(long interval,
long backoff)
getAllowedTransports
public List<String> getAllowedTransports()
- Specified by:
getAllowedTransports in interface Bayeux
getKnownTransportNames
public Set<String> getKnownTransportNames()
- Specified by:
getKnownTransportNames in interface Bayeux
getTransport
public Transport getTransport(String transport)
- Specified by:
getTransport in interface Bayeux
initialize
protected void initialize()
terminate
protected void terminate()
getOption
public Object getOption(String qualifiedName)
- Specified by:
getOption in interface Bayeux
setOption
public void setOption(String qualifiedName,
Object value)
- Specified by:
setOption in interface Bayeux
getOptionNames
public Set<String> getOptionNames()
- Specified by:
getOptionNames in interface Bayeux
getOptions
public Map<String,Object> getOptions()
newMessage
protected Message.Mutable newMessage()
enqueueSend
protected void enqueueSend(Message.Mutable message)
failMessages
protected void failMessages(Throwable x,
Message... messages)
onSending
public void onSending(Message[] messages)
onMessages
public void onMessages(List<Message.Mutable> messages)
onFailure
public void onFailure(Throwable x,
Message[] messages)
Copyright © 2008-2010 Dojo Foundation. All Rights Reserved.