Interface ChannelContext<T>

  • Type Parameters:
    T - type of the context data

    public interface ChannelContext<T>
    Channel context.
    • Method Detail

      • channel

        Optional<String> channel()
        Returns the current name of the channel.

        When there is no current channel returned Optional is empty.

        Returns:
        name of the channel
      • changeChannel

        CompletionStage<?> changeChannel​(String channel)
        Changes the current channel of this context.
        Parameters:
        channel - name of the channel, use null to leave the current channel
        Returns:
        stage that is completed when channel is changed, never null
      • getData

        T getData()
        Returns a snapshot of the current channel context data, or null if there is no current channel.
        Returns:
        current context data or null if no current context
      • publish

        CompletionStage<?> publish​(Map<String,​Object> update)
        Publish update to the channel context data.
        Parameters:
        update - data update
        Returns:
        stage that is completed when update is published, never null