| CODENOTIFIER | HelpYou are not signed inSign in |
Project: cometd
Revision: 515
Author: gregw
Date: 29 Aug 2008 01:56:02
Changes:Diff:| ... | ...@@ -20,8 +20,43 @@ | |
| 20 | 20 | */ |
| 21 | 21 | public interface SecurityPolicy |
| 22 | 22 | { |
| 23 | /** | |
| 24 | * Test if a handshake message should be accepted. | |
| 25 | * @param message A handshake message. | |
| 26 | * @return True if the handshake message should be accepted and a {@link Client} instance created | |
| 27 | */ | |
| 23 | 28 | boolean canHandshake(Message message); |
| 29 | ||
| 30 | /** | |
| 31 | * Test if a message should be allowed to create a new Channel | |
| 32 | * @param client The client sending the message. The client may be | |
| 33 | * null if an anonymous publish is attempted. Server clients are | |
| 34 | * indicated by {@link Client#isLocal()} | |
| 35 | * @param channel The channel the message is trying to create | |
| 36 | * @param message The message | |
| 37 | * @return true if the channel should be created | |
| 38 | */ | |
| 24 | 39 | boolean canCreate(Client client,String channel,Message message); |
| 40 | ||
| 41 | /** | |
| 42 | * Test if a client is allowed to subscribe to a channel | |
| 43 | * @param client The client sending the message. The client may be | |
| 44 | * null if an anonymous publish is attempted. Server clients are | |
| 45 | * indicated by {@link Client#isLocal()} | |
| 46 | * @param channel The channel the message is trying to subscribe to | |
| 47 | * @param messsage The message to /meta/subscribe | |
| 48 | * @return true if the client can subscribe to the channel | |
| 49 | */ | |
| 25 | 50 | boolean canSubscribe(Client client,String channel,Message messsage); |
| 51 | ||
| 52 | /** | |
| 53 | * Test if a client can publish a message to a channel | |
| 54 | * @param client The client sending the message. The client may be | |
| 55 | * null if an anonymous publish is attempted. Server clients are | |
| 56 | * indicated by {@link Client#isLocal()} | |
| 57 | * @param channel The channel the message is trying to publish to | |
| 58 | * @param messsage The message to publish | |
| 59 | * @return true if the client can publish to the channel. | |
| 60 | */ | |
| 26 | 61 | boolean canPublish(Client client,String channel,Message messsage); |
| 27 | 62 | } |