Record Class GatewayConnectionContext

java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.client.gateway_interface.GatewayConnectionContext
Record Components:
launchContext - The LaunchContext provided at the time of setup. Must not be null.
worker - A worker thread pool used by the GatewayConnection to execute blocking tasks in the background. All blocking work performed by the GatewayConnection must be performed on this worker thread pool. Must not be null.
scheduler - This thread pool is used by the GatewayConnection to schedule work to be done later. DO NOT perform blocking work directly on this thread pool. Instead, schedule a task which itself submits the blocking work task on the worker thread pool. Must not be null.
ticker - A monotonic clock equivalent to System.nanoTime() suitable for measuring elapsed time. Must not be null.
webSocketClient - The WebSocketClient which also manages the HttpClient used by GatewayInterface instances. Must not be null.

public record GatewayConnectionContext(LaunchContext launchContext, ExecutorService worker, ScheduledExecutorService scheduler, LongSupplier ticker, org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient) extends Record
This record contains the context required for GatewayConnection instances.
  • Constructor Details

    • GatewayConnectionContext

      public GatewayConnectionContext(LaunchContext launchContext, ExecutorService worker, ScheduledExecutorService scheduler, LongSupplier ticker, org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient)
      Creates an instance of a GatewayConnectionContext record class.
      Parameters:
      launchContext - the value for the launchContext record component
      worker - the value for the worker record component
      scheduler - the value for the scheduler record component
      ticker - the value for the ticker record component
      webSocketClient - the value for the webSocketClient record component
  • Method Details

    • getHttpClient

      public org.eclipse.jetty.client.HttpClient getHttpClient()
      Returns:
      the HttpClient in this context
    • builder

      public static GatewayConnectionContext.Builder builder(LaunchContext launchContext)
      Factory method which creates a new GatewayConnectionContext.Builder given a LaunchContext. The Builder will give the caller the opportunity to customize and build a new GatewayConnectionContext instance.
      Parameters:
      launchContext - The LaunchContext for the new connection context. Must not be null.
      Returns:
      The new GatewayConnectionContext.Builder instance. Never null.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • launchContext

      public LaunchContext launchContext()
      Returns the value of the launchContext record component.
      Returns:
      the value of the launchContext record component
    • worker

      public ExecutorService worker()
      Returns the value of the worker record component.
      Returns:
      the value of the worker record component
    • scheduler

      public ScheduledExecutorService scheduler()
      Returns the value of the scheduler record component.
      Returns:
      the value of the scheduler record component
    • ticker

      public LongSupplier ticker()
      Returns the value of the ticker record component.
      Returns:
      the value of the ticker record component
    • webSocketClient

      public org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient()
      Returns the value of the webSocketClient record component.
      Returns:
      the value of the webSocketClient record component