Package org.cometd.client.transport
Class ClientTransport
- java.lang.Object
-
- org.cometd.common.AbstractTransport
-
- org.cometd.client.transport.ClientTransport
-
- All Implemented Interfaces:
Transport
- Direct Known Subclasses:
HttpClientTransport
public abstract class ClientTransport extends AbstractTransport
ClientTransport
s are used byBayeuxClient
to send and receive Bayeux messages.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ClientTransport.Factory
static interface
ClientTransport.FailureHandler
static class
ClientTransport.FailureInfo
-
Field Summary
Fields Modifier and Type Field Description static String
JSON_CONTEXT_OPTION
protected org.slf4j.Logger
logger
static String
MAX_MESSAGE_SIZE_OPTION
static String
MAX_NETWORK_DELAY_OPTION
static String
SCHEDULER_OPTION
static String
URL_OPTION
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
abort()
Aborts this transport, usually by cancelling all pending Bayeux messages that require a response, such as/meta/connect
s, without waiting for a response.abstract boolean
accept(String version)
protected String
generateJSON(List<Message.Mutable> messages)
long
getMaxNetworkDelay()
String
getURL()
void
init()
protected List<Message.Mutable>
parseMessages(String content)
abstract void
send(TransportListener listener, List<Message.Mutable> messages)
protected void
setMaxNetworkDelay(long maxNetworkDelay)
void
setURL(String url)
void
terminate()
Terminates this transport, usually by closing network connections opened directly by this transport.-
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
-
-
-
Field Detail
-
URL_OPTION
public static final String URL_OPTION
- See Also:
- Constant Field Values
-
MAX_NETWORK_DELAY_OPTION
public static final String MAX_NETWORK_DELAY_OPTION
- See Also:
- Constant Field Values
-
JSON_CONTEXT_OPTION
public static final String JSON_CONTEXT_OPTION
- See Also:
- Constant Field Values
-
SCHEDULER_OPTION
public static final String SCHEDULER_OPTION
- See Also:
- Constant Field Values
-
MAX_MESSAGE_SIZE_OPTION
public static final String MAX_MESSAGE_SIZE_OPTION
- See Also:
- Constant Field Values
-
logger
protected final org.slf4j.Logger logger
-
-
Method Detail
-
getURL
public String getURL()
-
setURL
public void setURL(String url)
-
init
public void init()
-
abort
public abstract void abort()
Aborts this transport, usually by cancelling all pending Bayeux messages that require a response, such as/meta/connect
s, without waiting for a response.- See Also:
BayeuxClient.abort()
-
terminate
public void terminate()
Terminates this transport, usually by closing network connections opened directly by this transport.- See Also:
ClientSession.disconnect()
-
accept
public abstract boolean accept(String version)
-
send
public abstract void send(TransportListener listener, List<Message.Mutable> messages)
-
parseMessages
protected List<Message.Mutable> parseMessages(String content) throws ParseException
- Throws:
ParseException
-
generateJSON
protected String generateJSON(List<Message.Mutable> messages)
-
getMaxNetworkDelay
public long getMaxNetworkDelay()
-
setMaxNetworkDelay
protected void setMaxNetworkDelay(long maxNetworkDelay)
-
-