Modifier and Type | Field and Description |
---|---|
protected LinkedHashMap<String,Channel> |
channels
a list of all active channels
|
protected HashMap<String,Client> |
clients
a list of all active clients
|
protected static ClientImpl |
errorClient
default client to use when we need to send an error message but don't have a client valid reference
|
protected int |
reconnectInterval |
protected SecurityPolicy |
securityPolicy
security policy to be used.
|
ADVICE_FIELD, CHANNEL_FIELD, CLIENT_FIELD, CONNECTION_TYPE_FIELD, DATA_FIELD, DOJOX_COMETD_BAYEUX, ERROR_FIELD, EXT_FIELD, HANDSHAKE_RESPONSE, ID_FIELD, INTERVAL_FIELD, JSON_COMMENT_FILTERED_FIELD, JSON_CONTENT_TYPE, JSONP_DEFAULT_NAME, JSONP_PARAMETER, MESSAGE_PARAMETER, META, META_CLIENT, META_CONNECT, META_DISCONNECT, META_HANDSHAKE, META_PING, META_RECONNECT, META_SLASH, META_STATUS, META_SUBSCRIBE, META_UNSUBSCRIBE, MIN_VERSION_FIELD, NONE_RESPONSE, RECONNECT_FIELD, RETRY_RESPONSE, SERVICE, SERVICE_SLASH, SUBSCRIPTION_FIELD, SUCCESSFUL_FIELD, SUPP_CONNECTION_TYPE_FIELD, TIMESTAMP_FIELD, TRANSPORT_CALLBACK_POLL, TRANSPORT_FIELD, TRANSPORT_FLASH, TRANSPORT_IFRAME, TRANSPORT_LONG_POLL, VERSION_FIELD
Modifier | Constructor and Description |
---|---|
protected |
TomcatBayeux() |
Modifier and Type | Method and Description |
---|---|
String |
createUUID(String idprefix) |
void |
destroy()
should be invoked when the servlet is destroyed or when the context shuts down
|
Channel |
getChannel(String channelId,
boolean create)
Returns the channel for a given channel id.
|
List<Channel> |
getChannels()
Returns a list of currently active channels in this Bayeux session.
|
Client |
getClient(String clientId)
retrieve a client based on an ID.
|
protected ClientImpl |
getClientImpl(HttpEvent event) |
List<Client> |
getClients()
Returns a non modifiable list of all the clients that are currently active
in this Bayeux session
|
static ClientImpl |
getErrorClient()
returns the default error client
|
int |
getReconnectInterval() |
SecurityPolicy |
getSecurityPolicy()
Returns the security policy associated with this Bayeux session
|
boolean |
hasChannel(String channel)
returns true if a channel with the given channelId exists.
|
boolean |
hasClient(String clientId)
Returns true if a client with the given id exists.
Same as executing getClient(id)!=null . |
Client |
newClient(String idprefix,
Listener listener)
Creates a new server side client.
|
Client |
newClient(String idprefix,
Listener listener,
boolean local,
HttpEvent event) |
protected Message |
newMessage() |
Message |
newMessage(Client from)
Creates a new message to be sent by a server side client.
|
Channel |
remove(Channel channel)
Removes a channel from the Bayeux object.
|
Client |
remove(Client client)
Removes the client all together.
|
protected void |
remove(HttpEvent event) |
void |
setReconnectInterval(int reconnectTimeout) |
void |
setSecurityPolicy(SecurityPolicy securityPolicy)
Sets the security policy to be used in this Bayeux session
|
protected static String |
toString(byte[] data) |
protected static String |
toString(byte[] data,
int offset,
int length) |
protected int reconnectInterval
protected LinkedHashMap<String,Channel> channels
protected SecurityPolicy securityPolicy
protected static ClientImpl errorClient
public static ClientImpl getErrorClient()
public void destroy()
public Channel getChannel(String channelId, boolean create)
Bayeux
create
parameter is set to true,
the channel will be created and added to the list of active channels.create
is set to false, and the channel doesn't exist, null will be returned.getChannel
in interface Bayeux
channelId
- String - the id of the channel to be retrieved or createdcreate
- boolean - true if the Bayeux impl should create the channelcreate
is set to false and the channel doesn't exist,
otherwise it returns a channel object.public Channel remove(Channel channel)
Bayeux
public Client remove(Client client)
Bayeux
public Client getClient(String clientId)
Bayeux
public boolean hasClient(String clientId)
Bayeux
getClient(id)!=null
.public List<Client> getClients()
Bayeux
getClients
in interface Bayeux
public SecurityPolicy getSecurityPolicy()
Bayeux
getSecurityPolicy
in interface Bayeux
public int getReconnectInterval()
public boolean hasChannel(String channel)
Bayeux
Bayeux.getChannel(channelId,false)!=null
hasChannel
in interface Bayeux
channel
- Stringpublic Client newClient(String idprefix, Listener listener, boolean local, HttpEvent event)
public Client newClient(String idprefix, Listener listener)
Bayeux
protected ClientImpl getClientImpl(HttpEvent event)
protected void remove(HttpEvent event)
protected static String toString(byte[] data)
protected static String toString(byte[] data, int offset, int length)
public List<Channel> getChannels()
Bayeux
getChannels
in interface Bayeux
protected Message newMessage()
public Message newMessage(Client from)
Bayeux
newMessage
in interface Bayeux
public void setSecurityPolicy(SecurityPolicy securityPolicy)
Bayeux
setSecurityPolicy
in interface Bayeux
securityPolicy
- SecurityPolicypublic void setReconnectInterval(int reconnectTimeout)
Copyright © 2015 JBoss by Red Hat. All rights reserved.