Package com.tick42.glue.desktop.channels

# Interface ChannelContext<T>

Type Parameters:
  `T` - type of the context data

    public interface ChannelContext<T>

Channel context.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `CompletionStage<?>` | `changeChannel​(String channel)` | Changes the current channel of this context.
  `Optional<String>` | `channel()` | The current name of the channel.
  `T` | `getData()` | A snapshot of the current channel context data.
  `CompletionStage<?>` | `publish​(Map<String,​Object> update)` | Publish update to the channel context data.
  `CompletionStage<AsynchronousCloseable>` | `subscribe​(ChannelContextSubscriber<T> subscriber)` | Subscribes the specified `subscriber` for channel context updates.

- ## Method Details

  - ### channel

    Optional<String> channel()
    The current name of the channel.
    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()
    A snapshot of the current channel context data.
    Returns:
      current context data

  - ### 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`

  - ### subscribe

    CompletionStage<AsynchronousCloseable> subscribe​(ChannelContextSubscriber<T> subscriber)
    Subscribes the specified `subscriber` for channel context updates.
    Parameters:
      `subscriber` - subscriber that will receive updates
    Returns:
      stage that is completed when subscription is done, never `null`