Class DefaultSecurityPolicy
java.lang.Object
org.cometd.server.DefaultSecurityPolicy
- All Implemented Interfaces:
SecurityPolicy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreate
(BayeuxServer server, ServerSession session, String channelId, ServerMessage message) boolean
canHandshake
(BayeuxServer server, ServerSession session, ServerMessage message) Blocking version ofSecurityPolicy.canHandshake(BayeuxServer, ServerSession, ServerMessage, Promise)
.boolean
canPublish
(BayeuxServer server, ServerSession session, ServerChannel channel, ServerMessage message) boolean
canSubscribe
(BayeuxServer server, ServerSession session, ServerChannel channel, ServerMessage message) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cometd.bayeux.server.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:SecurityPolicy
Blocking version of
SecurityPolicy.canCreate(BayeuxServer, ServerSession, String, ServerMessage, Promise)
.- Specified by:
canCreate
in interfaceSecurityPolicy
- Parameters:
server
- theBayeuxServer
objectsession
- 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:SecurityPolicy
Blocking version of
SecurityPolicy.canHandshake(BayeuxServer, ServerSession, ServerMessage, Promise)
.- Specified by:
canHandshake
in interfaceSecurityPolicy
- Parameters:
server
- theBayeuxServer
objectsession
- 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:SecurityPolicy
Blocking version of
SecurityPolicy.canPublish(BayeuxServer, ServerSession, ServerChannel, ServerMessage, Promise)
.- Specified by:
canPublish
in interfaceSecurityPolicy
- Parameters:
server
- theBayeuxServer
objectsession
- 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:SecurityPolicy
Blocking version of
SecurityPolicy.canSubscribe(BayeuxServer, ServerSession, ServerChannel, ServerMessage, Promise)
.- Specified by:
canSubscribe
in interfaceSecurityPolicy
- Parameters:
server
- theBayeuxServer
objectsession
- the client sending the messagechannel
- the channel to subscribe tomessage
- the subscribe message- Returns:
- whether the channel subscription is allowed
-