|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tomcat.bayeux.TomcatBayeux
public class TomcatBayeux
Field Summary | |
---|---|
protected java.util.LinkedHashMap<java.lang.String,Channel> |
channels
a list of all active channels |
protected java.util.HashMap<java.lang.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. |
Constructor Summary | |
---|---|
protected |
TomcatBayeux()
|
Method Summary | |
---|---|
java.lang.String |
createUUID(java.lang.String idprefix)
|
void |
destroy()
should be invoked when the servlet is destroyed or when the context shuts down |
Channel |
getChannel(java.lang.String channelId,
boolean create)
Returns the channel for a given channel id. |
java.util.List<Channel> |
getChannels()
Returns a list of currently active channels in this Bayeux session. |
Client |
getClient(java.lang.String clientId)
retrieve a client based on an ID. |
protected ClientImpl |
getClientImpl(org.jboss.servlet.http.HttpEvent event)
|
java.util.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(java.lang.String channel)
returns true if a channel with the given channelId exists. |
boolean |
hasClient(java.lang.String clientId)
Returns true if a client with the given id exists. |
Client |
newClient(java.lang.String idprefix,
Listener listener)
Creates a new server side client. |
Client |
newClient(java.lang.String idprefix,
Listener listener,
boolean local,
org.jboss.servlet.http.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(org.jboss.servlet.http.HttpEvent event)
|
void |
setReconnectInterval(int reconnectTimeout)
|
void |
setSecurityPolicy(SecurityPolicy securityPolicy)
Sets the security policy to be used in this Bayeux session |
protected static java.lang.String |
toString(byte[] data)
|
protected static java.lang.String |
toString(byte[] data,
int offset,
int length)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int reconnectInterval
protected java.util.HashMap<java.lang.String,Client> clients
protected java.util.LinkedHashMap<java.lang.String,Channel> channels
protected SecurityPolicy securityPolicy
protected static ClientImpl errorClient
Constructor Detail |
---|
protected TomcatBayeux()
Method Detail |
---|
public static ClientImpl getErrorClient()
public void destroy()
public Channel getChannel(java.lang.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 channel
create
is set to false and the channel doesn't exist,
otherwise it returns a channel object.public Channel remove(Channel channel)
Bayeux
remove
in interface Bayeux
channel
- Channel - the channel to be removed
public Client remove(Client client)
Bayeux
remove
in interface Bayeux
client
- Client
public Client getClient(java.lang.String clientId)
Bayeux
getClient
in interface Bayeux
clientId
- String
public boolean hasClient(java.lang.String clientId)
Bayeux
getClient(id)!=null
.
hasClient
in interface Bayeux
clientId
- String
public java.util.List<Client> getClients()
Bayeux
getClients
in interface Bayeux
public SecurityPolicy getSecurityPolicy()
Bayeux
getSecurityPolicy
in interface Bayeux
public int getReconnectInterval()
public boolean hasChannel(java.lang.String channel)
Bayeux
Bayeux.getChannel(channelId,false)!=null
hasChannel
in interface Bayeux
channel
- String
public Client newClient(java.lang.String idprefix, Listener listener, boolean local, org.jboss.servlet.http.HttpEvent event)
public Client newClient(java.lang.String idprefix, Listener listener)
Bayeux
newClient
in interface Bayeux
idprefix
- String - the prefix string for the id generated, can be nulllistener
- Listener - a callback object to be called when messages are to be delivered to the new client
protected ClientImpl getClientImpl(org.jboss.servlet.http.HttpEvent event)
protected void remove(org.jboss.servlet.http.HttpEvent event)
public java.lang.String createUUID(java.lang.String idprefix)
protected static java.lang.String toString(byte[] data)
protected static java.lang.String toString(byte[] data, int offset, int length)
public java.util.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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |