org.cometd.server
Class AbstractBayeux.DefaultPolicy

java.lang.Object
  extended by org.cometd.server.AbstractBayeux.DefaultPolicy
All Implemented Interfaces:
SecurityPolicy
Enclosing class:
AbstractBayeux

public static class AbstractBayeux.DefaultPolicy
extends java.lang.Object
implements SecurityPolicy


Constructor Summary
AbstractBayeux.DefaultPolicy()
           
 
Method Summary
 boolean canCreate(Client client, java.lang.String channel, Message message)
          Test if a message should be allowed to create a new Channel
 boolean canHandshake(Message message)
          Test if a handshake message should be accepted.
 boolean canPublish(Client client, java.lang.String channel, Message message)
          Test if a client can publish a message to a channel
 boolean canSubscribe(Client client, java.lang.String channel, Message message)
          Test if a client is allowed to subscribe to a channel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBayeux.DefaultPolicy

public AbstractBayeux.DefaultPolicy()
Method Detail

canHandshake

public boolean canHandshake(Message message)
Description copied from interface: SecurityPolicy
Test if a handshake message should be accepted.

Specified by:
canHandshake in interface SecurityPolicy
Parameters:
message - A handshake message.
Returns:
True if the handshake message should be accepted and a Client instance created

canCreate

public boolean canCreate(Client client,
                         java.lang.String channel,
                         Message message)
Description copied from interface: SecurityPolicy
Test if a message should be allowed to create a new Channel

Specified by:
canCreate in interface SecurityPolicy
Parameters:
client - The client sending the message. The client may be null if an anonymous publish is attempted. Server clients are indicated by Client.isLocal()
channel - The channel the message is trying to create
message - The message
Returns:
true if the channel should be created

canSubscribe

public boolean canSubscribe(Client client,
                            java.lang.String channel,
                            Message message)
Description copied from interface: SecurityPolicy
Test if a client is allowed to subscribe to a channel

Specified by:
canSubscribe in interface SecurityPolicy
Parameters:
client - The client sending the message. The client may be null if an anonymous publish is attempted. Server clients are indicated by Client.isLocal()
channel - The channel the message is trying to subscribe to
message - The message to /meta/subscribe
Returns:
true if the client can subscribe to the channel

canPublish

public boolean canPublish(Client client,
                          java.lang.String channel,
                          Message message)
Description copied from interface: SecurityPolicy
Test if a client can publish a message to a channel

Specified by:
canPublish in interface SecurityPolicy
Parameters:
client - The client sending the message. The client may be null if an anonymous publish is attempted. Server clients are indicated by Client.isLocal()
channel - The channel the message is trying to publish to
message - The message to publish
Returns:
true if the client can publish to the channel.


Copyright © 2011 Dojo Foundation. All Rights Reserved.