org.cometd.bayeux.server
Interface SecurityPolicy


public interface SecurityPolicy

Plugable security policy for Bayeux

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

Method Summary
 boolean canCreate(BayeuxServer server, ServerSession session, java.lang.String channelId, ServerMessage message)
          Test if a message should be allowed to create a new Channel
 boolean canHandshake(BayeuxServer server, ServerSession session, ServerMessage message)
          Test if a handshake message should be accepted.
 boolean canPublish(BayeuxServer server, ServerSession client, ServerChannel channel, ServerMessage messsage)
          Test if a client can publish a message to a channel
 boolean canSubscribe(BayeuxServer server, ServerSession client, ServerChannel channel, ServerMessage messsage)
          Test if a client is allowed to subscribe to a channel
 

Method Detail

canCreate

boolean canCreate(BayeuxServer server,
                  ServerSession session,
                  java.lang.String channelId,
                  ServerMessage message)
Test if a message should be allowed to create a new Channel

Parameters:
session - The client sending the message. The client may be null if an anonymous publish is attempted.
channelId - The channel to be created
message - The message trying to create the chanmel
Returns:
true if the channel should be created

canHandshake

boolean canHandshake(BayeuxServer server,
                     ServerSession session,
                     ServerMessage message)
Test if a handshake message should be accepted.

Parameters:
message - A handshake message.
client - The session (not yet added to the BayeuxServer)
Returns:
True if the handshake message should be accepted and a Session instance created

canPublish

boolean canPublish(BayeuxServer server,
                   ServerSession client,
                   ServerChannel channel,
                   ServerMessage 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 Session#isLocal()
messsage - The message to publish
Returns:
true if the client can publish to the channel.

canSubscribe

boolean canSubscribe(BayeuxServer server,
                     ServerSession client,
                     ServerChannel channel,
                     ServerMessage 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 Session#isLocal()
messsage - The message to /meta/subscribe
Returns:
true if the client can subscribe to the channel


Copyright © 2010 Dojo Foundation. All Rights Reserved.