Interface Context<T>

Type Parameters:
T - type of the data
All Superinterfaces:
AsynchronousCloseable, AutoCloseable

public interface Context<T> extends AsynchronousCloseable
A shared context.
  • Method Details

    • name

      String name()
      The name of the context.
      Returns:
      name of the context
    • isSystem

      default boolean isSystem()
    • getData

      T getData()
      The current view of the context data.
      Returns:
      current view of the context data
    • data

      Subscribe a specified callback for data updates.
      Parameters:
      subscriber - subscriber callback
      Returns:
      stage that is completed when subscriber is ready to receive updates, never null
    • update

      CompletionStage<?> update(Map<String,Object> delta)
      Update context data with specified delta.
      Parameters:
      delta - a map with context fields to be updated/removed.
      Returns:
      stage that is completed when context is updated, never null
      Since:
      1.2
    • updatePaths

      CompletionStage<?> updatePaths(Map<String,Object> deltaPaths)
      Update context data with specified delta. Allows you to use "paths" in the structure to update/remove nested properties.
      Parameters:
      deltaPaths - a map with context paths to be updated/removed.
      Returns:
      stage that is completed when context is updated, never null
      Since:
      1.3.9
    • reset

      CompletionStage<T> reset(T value)
      Reset context data with specified value.
      Parameters:
      value - new context value
      Returns:
      stage that is completed when context is reset, never null