Package org.cometd.bayeux.server
Interface ConfigurableServerChannel
-
- All Superinterfaces:
Channel
- All Known Subinterfaces:
ServerChannel
- All Known Implementing Classes:
ServerChannelImpl
public interface ConfigurableServerChannel extends Channel
A
ConfigurableServerChanneloffers an API that can be used to configureServerChannels at creation time.ServerChannels may be created concurrently viaBayeuxServer.createChannelIfAbsent(String, ConfigurableServerChannel.Initializer...)and it is important that the creation of a channel is atomic so that its configuration is executed only once, and so that it is guaranteed that it happens before any message can be published or received by the channel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceConfigurableServerChannel.InitializerA listener interface by means of which listeners can atomically set the initial configuration of a channel.static interfaceConfigurableServerChannel.ServerChannelListenerCommon interface forServerChannellisteners.
-
Field Summary
-
Fields inherited from interface org.cometd.bayeux.Channel
META, META_CONNECT, META_DISCONNECT, META_HANDSHAKE, META_SUBSCRIBE, META_UNSUBSCRIBE, SERVICE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAuthorizer(Authorizer authorizer)Adds the givenAuthorizerthat grants or denies operations on this channel.voidaddListener(ConfigurableServerChannel.ServerChannelListener listener)java.util.List<Authorizer>getAuthorizers()longgetLazyTimeout()java.util.List<ConfigurableServerChannel.ServerChannelListener>getListeners()booleanisBroadcastToPublisher()booleanisLazy()booleanisPersistent()voidremoveAuthorizer(Authorizer authorizer)Removes the givenAuthorizer.voidremoveListener(ConfigurableServerChannel.ServerChannelListener listener)voidsetBroadcastToPublisher(boolean broadcastToPublisher)Sets whether a publisher that is also a subscriber to the channel will receive the messages it publishes on that channel.voidsetLazy(boolean lazy)A lazy channel marks all messages published to it as lazy.voidsetLazyTimeout(long lazyTimeout)Sets the lazy timeout for this channel.voidsetPersistent(boolean persistent)A persistent channel is not removed when the last subscription is removed-
Methods inherited from interface org.cometd.bayeux.Channel
getAttribute, getAttributeNames, getChannelId, getId, isBroadcast, isDeepWild, isMeta, isService, isWild, removeAttribute, setAttribute
-
-
-
-
Method Detail
-
addListener
void addListener(ConfigurableServerChannel.ServerChannelListener listener)
- Parameters:
listener- the listener to add- See Also:
removeListener(ServerChannelListener)
-
removeListener
void removeListener(ConfigurableServerChannel.ServerChannelListener listener)
- Parameters:
listener- the listener to remove- See Also:
addListener(ServerChannelListener)
-
getListeners
java.util.List<ConfigurableServerChannel.ServerChannelListener> getListeners()
- Returns:
- an immutable list of listeners
- See Also:
addListener(ServerChannelListener)
-
isLazy
boolean isLazy()
- Returns:
- whether the channel is lazy
- See Also:
setLazy(boolean)
-
setLazy
void setLazy(boolean lazy)
A lazy channel marks all messages published to it as lazy.- Parameters:
lazy- whether the channel is lazy- See Also:
isLazy()
-
getLazyTimeout
long getLazyTimeout()
- Returns:
- the lazy timeout for this channel
- See Also:
setLazyTimeout(long)
-
setLazyTimeout
void setLazyTimeout(long lazyTimeout)
Sets the lazy timeout for this channel. A positive value makes the channel lazy, a negative value makes the channel non-lazy.- Parameters:
lazyTimeout- the lazy timeout for this channel- See Also:
setLazy(boolean)
-
isPersistent
boolean isPersistent()
- Returns:
- whether the channel is persistent
- See Also:
setPersistent(boolean)
-
setPersistent
void setPersistent(boolean persistent)
A persistent channel is not removed when the last subscription is removed- Parameters:
persistent- whether the channel is persistent- See Also:
isPersistent()
-
isBroadcastToPublisher
boolean isBroadcastToPublisher()
- Returns:
- whether the channel broadcasts messages back to the publisher
-
setBroadcastToPublisher
void setBroadcastToPublisher(boolean broadcastToPublisher)
Sets whether a publisher that is also a subscriber to the channel will receive the messages it publishes on that channel.- Parameters:
broadcastToPublisher- whether the channel broadcasts messages back to the publisher
-
addAuthorizer
void addAuthorizer(Authorizer authorizer)
Adds the given
Authorizerthat grants or denies operations on this channel.Operations must be granted by at least one Authorizer and must not be denied by any.
- Parameters:
authorizer- the Authorizer to add- See Also:
removeAuthorizer(Authorizer),Authorizer
-
removeAuthorizer
void removeAuthorizer(Authorizer authorizer)
Removes the given
Authorizer.- Parameters:
authorizer- the Authorizer to remove- See Also:
addAuthorizer(Authorizer)
-
getAuthorizers
java.util.List<Authorizer> getAuthorizers()
- Returns:
- an immutable list of authorizers for this channel
-
-