|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.cometd.AbstractBayeux
public abstract class AbstractBayeux
Field Summary | |
---|---|
static String |
ADVICE_FIELD
|
static String |
CHANNEL_FIELD
|
static String |
CLIENT_FIELD
|
static String |
DATA_FIELD
|
static String |
EXT_FIELD
|
static String |
ID_FIELD
|
static String |
META
|
static String |
META_CONNECT
|
static ChannelId |
META_CONNECT_ID
|
static String |
META_DISCONNECT
|
static ChannelId |
META_DISCONNECT_ID
|
static String |
META_HANDSHAKE
|
static ChannelId |
META_HANDSHAKE_ID
|
static String |
META_PING
|
static ChannelId |
META_PING_ID
|
static String |
META_RECONNECT
|
static ChannelId |
META_RECONNECT_ID
|
static String |
META_STATUS
|
static ChannelId |
META_STATUS_ID
|
static String |
META_SUBSCRIBE
|
static ChannelId |
META_SUBSCRIBE_ID
|
static String |
META_UNSUBSCRIBE
|
static ChannelId |
META_UNSUBSCRIBE_ID
|
static String |
SUBSCRIPTION_FIELD
|
static String |
SUCCESSFUL_FIELD
|
static String |
TIMESTAMP_FIELD
|
static String |
TRANSPORT_FIELD
|
static JSON.Literal |
TRANSPORTS
|
Fields inherited from interface dojox.cometd.Bayeux |
---|
DOJOX_COMETD_BAYEUX |
Constructor Summary | |
---|---|
protected |
AbstractBayeux()
|
Method Summary | |
---|---|
void |
addFilter(String channels,
DataFilter filter)
|
void |
advise(Client client,
Transport transport,
Object advice)
Send advice to a client |
boolean |
getAlwaysResumePoll()
|
ChannelImpl |
getChannel(ChannelId id)
|
ChannelImpl |
getChannel(String id)
|
Channel |
getChannel(String id,
boolean create)
|
ChannelId |
getChannelId(String id)
|
Client |
getClient(String client_id)
|
Set |
getClientIDs()
|
long |
getClientTimeoutMs()
|
int |
getLogLevel()
|
protected long |
getRandom(long variation)
|
SecurityPolicy |
getSecurityPolicy()
|
String |
handle(ClientImpl client,
Transport transport,
Map<String,Object> message)
Handle a Bayeux message. |
boolean |
hasChannel(String id)
|
protected void |
initialize(ServletContext context)
|
boolean |
isInitialized()
|
boolean |
isJSONCommented()
|
boolean |
isLogDebug()
|
boolean |
isLogInfo()
|
void |
logDebug(String message)
|
void |
logDebug(String message,
Throwable th)
|
void |
logInfo(String message)
|
Client |
newClient(String idPrefix,
Listener listener)
|
abstract ClientImpl |
newRemoteClient()
|
Transport |
newTransport(ClientImpl client,
Map message)
Create new transport object for a bayeux message |
void |
publish(ChannelId to,
Client from,
Object data,
String msgId)
|
void |
publish(Client fromClient,
String toChannelId,
Object data,
String msgId)
Deliver data to a channel. |
boolean |
removeChannel(ChannelId channelId)
|
void |
removeFilter(String channels,
DataFilter filter)
|
void |
setAlwaysResumePoll(boolean always)
|
void |
setClientTimeoutMs(long ms)
|
void |
setJSONCommented(boolean commented)
|
void |
setLogLevel(int logLevel)
|
void |
setSecurityPolicy(SecurityPolicy securityPolicy)
|
void |
subscribe(String toChannel,
Client subscriber)
Subscribe to a channel. |
void |
unsubscribe(String toChannel,
Client subscriber)
Unsubscribe to a channel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String META
public static final String META_CONNECT
public static final String META_DISCONNECT
public static final String META_HANDSHAKE
public static final String META_PING
public static final String META_RECONNECT
public static final String META_STATUS
public static final String META_SUBSCRIBE
public static final String META_UNSUBSCRIBE
public static final String CLIENT_FIELD
public static final String DATA_FIELD
public static final String CHANNEL_FIELD
public static final String ID_FIELD
public static final String TIMESTAMP_FIELD
public static final String TRANSPORT_FIELD
public static final String ADVICE_FIELD
public static final String SUCCESSFUL_FIELD
public static final String SUBSCRIPTION_FIELD
public static final String EXT_FIELD
public static final ChannelId META_CONNECT_ID
public static final ChannelId META_DISCONNECT_ID
public static final ChannelId META_HANDSHAKE_ID
public static final ChannelId META_PING_ID
public static final ChannelId META_RECONNECT_ID
public static final ChannelId META_STATUS_ID
public static final ChannelId META_SUBSCRIBE_ID
public static final ChannelId META_UNSUBSCRIBE_ID
public static final JSON.Literal TRANSPORTS
Constructor Detail |
---|
protected AbstractBayeux()
context.
- The logLevel init parameter is used to set the logging to
0=none, 1=info, 2=debugMethod Detail |
---|
public void addFilter(String channels, DataFilter filter)
addFilter
in interface Bayeux
channels
- A ChannelId
filter
- The filter instance to apply to new channels matching the
patternpublic void removeFilter(String channels, DataFilter filter)
removeFilter
in interface Bayeux
public ChannelImpl getChannel(ChannelId id)
id
-
public ChannelImpl getChannel(String id)
public Channel getChannel(String id, boolean create)
getChannel
in interface Bayeux
public ChannelId getChannelId(String id)
public Client getClient(String client_id)
getClient
in interface Bayeux
public Set getClientIDs()
public long getClientTimeoutMs()
public int getLogLevel()
public SecurityPolicy getSecurityPolicy()
public String handle(ClientImpl client, Transport transport, Map<String,Object> message) throws IOException
client
- The client if knowntransport
- The transport to use for the messagemessage
- The bayeux message.
IOException
public boolean hasChannel(String id)
hasChannel
in interface Bayeux
public boolean isInitialized()
public boolean isJSONCommented()
public boolean isLogDebug()
public boolean isLogInfo()
public void logDebug(String message)
public void logDebug(String message, Throwable th)
public void logInfo(String message)
public Client newClient(String idPrefix, Listener listener)
newClient
in interface Bayeux
public abstract ClientImpl newRemoteClient()
public Transport newTransport(ClientImpl client, Map message)
client
- The clientmessage
- the bayeux message
public void publish(ChannelId to, Client from, Object data, String msgId)
public void publish(Client fromClient, String toChannelId, Object data, String msgId)
Bayeux
publish
in interface Bayeux
fromClient
- The client sending the datatoChannelId
- The Channel ID to which the data is targetteddata
- The data itself which must be an Object that can be encoded with JSON
.msgId
- optional message ID or null for automatic generation of a message ID.public boolean removeChannel(ChannelId channelId)
public void setClientTimeoutMs(long ms)
public void setJSONCommented(boolean commented)
commented
- the commented to setpublic void setLogLevel(int logLevel)
logLevel
- the logLevel: 0=none, 1=info, 2=debugpublic void setSecurityPolicy(SecurityPolicy securityPolicy)
public void subscribe(String toChannel, Client subscriber)
Bayeux
subscribe
in interface Bayeux
public void unsubscribe(String toChannel, Client subscriber)
Bayeux
unsubscribe
in interface Bayeux
protected void initialize(ServletContext context)
public void advise(Client client, Transport transport, Object advice) throws IOException
client
- The client to send the advice totransport
- The transport to useadvice
- The advice to send.
IOException
protected long getRandom(long variation)
public boolean getAlwaysResumePoll()
public void setAlwaysResumePoll(boolean always)
always
- True if polls are always resumed when messages are received. This may be needed for some cross domain transports.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |