org.cometd
Interface SecurityPolicy

All Known Implementing Classes:
AbstractBayeux.DefaultPolicy

public interface SecurityPolicy

Pluggable security policy for Bayeux

Version:
$Revision: 1453 $ $Date: 2009-02-25 12:57:20 +0100 (Wed, 25 Feb 2009) $

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 messsage)
          Test if a client can publish a message to a channel
 boolean canSubscribe(Client client, java.lang.String channel, Message messsage)
          Test if a client is allowed to subscribe to a channel
 

Method Detail

canHandshake

boolean canHandshake(Message message)
Test if a handshake message should be accepted.

Parameters:
message - A handshake message.
Returns:
True if the handshake message should be accepted and a Client instance created

canCreate

boolean canCreate(Client client,
                  java.lang.String channel,
                  Message message)
Test if a message should be allowed to create a new Channel

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

boolean canSubscribe(Client client,
                     java.lang.String channel,
                     Message messsage)
Test if a client is allowed to subscribe to a channel

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
messsage - The message to /meta/subscribe
Returns:
true if the client can subscribe to the channel

canPublish

boolean canPublish(Client client,
                   java.lang.String channel,
                   Message messsage)
Test if a client can publish a message to a channel

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
messsage - The message to publish
Returns:
true if the client can publish to the channel.


Copyright © 2011 Dojo Foundation. All Rights Reserved.