Class Context


public class Context extends ContextSource
  • Field Details

    • id

      public final String id
      Unique context ID
    • name

      public final String name
      Action name
    • params

      public final io.datatree.Tree params
      Request parameters (including meta)
    • level

      public final int level
      Request level (in nested-calls) - the first level is 1
    • parentID

      public final String parentID
      Parent context ID (in nested-calls)
    • requestID

      public final String requestID
      Request ID (= first context ID)
    • stream

      public final PacketStream stream
      Streamed content
    • opts

      public final CallOptions.Options opts
      Calling options
    • nodeID

      public final String nodeID
      Source nodeID
    • createdAt

      protected final long createdAt
      Timestamp
  • Constructor Details

  • Method Details

    • emit

      protected void emit(String name, io.datatree.Tree payload, Groups groups, PacketStream stream, CallOptions.Options opts)
      Overrides:
      emit in class ContextSource
    • broadcast

      protected void broadcast(String name, io.datatree.Tree payload, Groups groups, PacketStream stream, CallOptions.Options opts, boolean local)
      Overrides:
      broadcast in class ContextSource
    • call

      protected io.datatree.Promise call(String name, io.datatree.Tree params, CallOptions.Options opts, PacketStream stream)
      Calls an action (local or remote).
      Overrides:
      call in class ContextSource
      Parameters:
      name - action name (eg. "math.add" in "service.action" syntax)
      params - Tree structure (input parameters of the method call)
      opts - calling options (target nodeID, call timeout, number of retries)
      stream - streamed data (optional)
      Returns:
      response Promise
    • mergeMeta

      protected io.datatree.Tree mergeMeta(io.datatree.Tree newParams)
    • toString

      public String toString()
      Overrides:
      toString in class Object