Class DefaultSecurityPolicy
java.lang.Object
org.cometd.server.DefaultSecurityPolicy
- All Implemented Interfaces:
SecurityPolicy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCreate(BayeuxServer server, ServerSession session, String channelId, ServerMessage message) booleancanHandshake(BayeuxServer server, ServerSession session, ServerMessage message) Blocking version ofSecurityPolicy.canHandshake(BayeuxServer, ServerSession, ServerMessage, Promise).booleancanPublish(BayeuxServer server, ServerSession session, ServerChannel channel, ServerMessage message) booleancanSubscribe(BayeuxServer server, ServerSession session, ServerChannel channel, ServerMessage message) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SecurityPolicy
canCreate, canHandshake, canPublish, canSubscribe
-
Constructor Details
-
DefaultSecurityPolicy
public DefaultSecurityPolicy()
-
-
Method Details
-
canCreate
public boolean canCreate(BayeuxServer server, ServerSession session, String channelId, ServerMessage message) Description copied from interface:SecurityPolicyBlocking version of
SecurityPolicy.canCreate(BayeuxServer, ServerSession, String, ServerMessage, Promise).- Specified by:
canCreatein interfaceSecurityPolicy- Parameters:
server- theBayeuxServerobjectsession- the client sending the messagechannelId- the channel to be createdmessage- the message trying to create the channel- Returns:
- whether the channel creation is allowed
-
canHandshake
Description copied from interface:SecurityPolicyBlocking version of
SecurityPolicy.canHandshake(BayeuxServer, ServerSession, ServerMessage, Promise).- Specified by:
canHandshakein interfaceSecurityPolicy- Parameters:
server- theBayeuxServerobjectsession- the session (not yet added to the BayeuxServer)message- the handshake message- Returns:
- whether the handshake message is allowed
-
canPublish
public boolean canPublish(BayeuxServer server, ServerSession session, ServerChannel channel, ServerMessage message) Description copied from interface:SecurityPolicyBlocking version of
SecurityPolicy.canPublish(BayeuxServer, ServerSession, ServerChannel, ServerMessage, Promise).- Specified by:
canPublishin interfaceSecurityPolicy- Parameters:
server- theBayeuxServerobjectsession- the client sending the messagechannel- the channel to publish tomessage- the message to being published- Returns:
- whether the publish is allowed
-
canSubscribe
public boolean canSubscribe(BayeuxServer server, ServerSession session, ServerChannel channel, ServerMessage message) Description copied from interface:SecurityPolicyBlocking version of
SecurityPolicy.canSubscribe(BayeuxServer, ServerSession, ServerChannel, ServerMessage, Promise).- Specified by:
canSubscribein interfaceSecurityPolicy- Parameters:
server- theBayeuxServerobjectsession- the client sending the messagechannel- the channel to subscribe tomessage- the subscribe message- Returns:
- whether the channel subscription is allowed
-