Channel
ServerChannel
public interface ConfigurableServerChannel extends Channel
A ConfigurableServerChannel
offers an API that can be used to
configure ServerChannel
s at creation time.
ServerChannel
s may be created concurrently via
BayeuxServer.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.
Modifier and Type | Interface | Description |
---|---|---|
static interface |
ConfigurableServerChannel.Initializer |
A listener interface by means of which listeners can atomically
set the initial configuration of a channel.
|
static interface |
ConfigurableServerChannel.ServerChannelListener |
Common interface for
ServerChannel listeners. |
META, META_CONNECT, META_DISCONNECT, META_HANDSHAKE, META_SUBSCRIBE, META_UNSUBSCRIBE, SERVICE
Modifier and Type | Method | Description |
---|---|---|
void |
addAuthorizer(Authorizer authorizer) |
Adds the given
Authorizer that grants or denies operations on this channel. |
void |
addListener(ConfigurableServerChannel.ServerChannelListener listener) |
|
List<Authorizer> |
getAuthorizers() |
|
long |
getLazyTimeout() |
|
List<ConfigurableServerChannel.ServerChannelListener> |
getListeners() |
|
boolean |
isLazy() |
|
boolean |
isPersistent() |
|
void |
removeAuthorizer(Authorizer authorizer) |
Removes the given
Authorizer . |
void |
removeListener(ConfigurableServerChannel.ServerChannelListener listener) |
|
void |
setLazy(boolean lazy) |
A lazy channel marks all messages published to it as lazy.
|
void |
setLazyTimeout(long lazyTimeout) |
Sets the lazy timeout for this channel.
|
void |
setPersistent(boolean persistent) |
A persistent channel is not removed when the last subscription is removed
|
getAttribute, getAttributeNames, getChannelId, getId, isBroadcast, isDeepWild, isMeta, isService, isWild, removeAttribute, setAttribute
void addListener(ConfigurableServerChannel.ServerChannelListener listener)
listener
- the listener to addremoveListener(ServerChannelListener)
void removeListener(ConfigurableServerChannel.ServerChannelListener listener)
listener
- the listener to removeaddListener(ServerChannelListener)
List<ConfigurableServerChannel.ServerChannelListener> getListeners()
addListener(ServerChannelListener)
boolean isLazy()
setLazy(boolean)
void setLazy(boolean lazy)
lazy
- whether the channel is lazyisLazy()
long getLazyTimeout()
setLazyTimeout(long)
void setLazyTimeout(long lazyTimeout)
lazyTimeout
- the lazy timeout for this channelsetLazy(boolean)
boolean isPersistent()
setPersistent(boolean)
void setPersistent(boolean persistent)
persistent
- whether the channel is persistentisPersistent()
void addAuthorizer(Authorizer authorizer)
Adds the given Authorizer
that grants or denies operations on this channel.
Operations must be granted by at least one Authorizer and must not be denied by any.
authorizer
- the Authorizer to addremoveAuthorizer(Authorizer)
,
Authorizer
void removeAuthorizer(Authorizer authorizer)
Removes the given Authorizer
.
authorizer
- the Authorizer to removeaddAuthorizer(Authorizer)
List<Authorizer> getAuthorizers()
Copyright © 2008–2017 The CometD Project. All rights reserved.