Interface ConfigurableServerChannel

All Superinterfaces:
Channel
All Known Subinterfaces:
ServerChannel
All Known Implementing Classes:
ServerChannelImpl

public interface ConfigurableServerChannel extends Channel

A ConfigurableServerChannel offers an API that can be used to configure ServerChannels at creation time.

ServerChannels 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.

  • Method Details Link icon

    • addListener Link icon

      Parameters:
      listener - the listener to add
      See Also:
    • removeListener Link icon

      void removeListener(ConfigurableServerChannel.ServerChannelListener listener)
      Parameters:
      listener - the listener to remove
      See Also:
    • getListeners Link icon

      Returns:
      an immutable list of listeners
      See Also:
    • isLazy Link icon

      boolean isLazy()
      Returns:
      whether the channel is lazy
      See Also:
    • setLazy Link icon

      void setLazy(boolean lazy)
      A lazy channel marks all messages published to it as lazy.
      Parameters:
      lazy - whether the channel is lazy
      See Also:
    • getLazyTimeout Link icon

      long getLazyTimeout()
      Returns:
      the lazy timeout for this channel
      See Also:
    • setLazyTimeout Link icon

      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:
    • isPersistent Link icon

      boolean isPersistent()
      Returns:
      whether the channel is persistent
      See Also:
    • setPersistent Link icon

      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:
    • isBroadcastToPublisher Link icon

      boolean isBroadcastToPublisher()
      Returns:
      whether the channel broadcasts messages back to the publisher
    • setBroadcastToPublisher Link icon

      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 Link icon

      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.

      Parameters:
      authorizer - the Authorizer to add
      See Also:
    • removeAuthorizer Link icon

      void removeAuthorizer(Authorizer authorizer)

      Removes the given Authorizer.

      Parameters:
      authorizer - the Authorizer to remove
      See Also:
    • getAuthorizers Link icon

      List<Authorizer> getAuthorizers()
      Returns:
      an immutable list of authorizers for this channel