Package org.cometd.server
Class DefaultSecurityPolicy
- java.lang.Object
-
- org.cometd.server.DefaultSecurityPolicy
-
- All Implemented Interfaces:
SecurityPolicy
public class DefaultSecurityPolicy extends Object implements SecurityPolicy
-
-
Constructor Summary
Constructors Constructor Description DefaultSecurityPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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
-
-
-
-
Method Detail
-
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
public boolean canHandshake(BayeuxServer server, ServerSession session, ServerMessage message)
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
-
-