Record Class GatewayConnectionContext
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.client.gateway_interface.GatewayConnectionContext
- Record Components:
launchContext
- TheLaunchContext
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 toSystem.nanoTime()
suitable for measuring elapsed time. Must not be null.webSocketClient
- TheWebSocketClient
which also manages theHttpClient
used byGatewayInterface
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builder class for customizing a new instance of GatewayConnectionContext using a fluent-style API. -
Constructor Summary
ConstructorsConstructorDescriptionGatewayConnectionContext
(LaunchContext launchContext, ExecutorService worker, ScheduledExecutorService scheduler, LongSupplier ticker, org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient) Creates an instance of aGatewayConnectionContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionbuilder
(LaunchContext launchContext) Factory method which creates a newGatewayConnectionContext.Builder
given aLaunchContext
.final boolean
Indicates whether some other object is "equal to" this one.org.eclipse.jetty.client.HttpClient
final int
hashCode()
Returns a hash code value for this object.Returns the value of thelaunchContext
record component.Returns the value of thescheduler
record component.ticker()
Returns the value of theticker
record component.final String
toString()
Returns a string representation of this record class.org.eclipse.jetty.websocket.client.WebSocketClient
Returns the value of thewebSocketClient
record component.worker()
Returns the value of theworker
record component.
-
Constructor Details
-
GatewayConnectionContext
public GatewayConnectionContext(LaunchContext launchContext, ExecutorService worker, ScheduledExecutorService scheduler, LongSupplier ticker, org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient) Creates an instance of aGatewayConnectionContext
record class.- Parameters:
launchContext
- the value for thelaunchContext
record componentworker
- the value for theworker
record componentscheduler
- the value for thescheduler
record componentticker
- the value for theticker
record componentwebSocketClient
- the value for thewebSocketClient
record component
-
-
Method Details
-
getHttpClient
public org.eclipse.jetty.client.HttpClient getHttpClient()- Returns:
- the
HttpClient
in this context
-
builder
Factory method which creates a newGatewayConnectionContext.Builder
given aLaunchContext
. The Builder will give the caller the opportunity to customize and build a new GatewayConnectionContext instance.- Parameters:
launchContext
- TheLaunchContext
for the new connection context. Must not be null.- Returns:
- The new
GatewayConnectionContext.Builder
instance. Never null.
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
launchContext
Returns the value of thelaunchContext
record component.- Returns:
- the value of the
launchContext
record component
-
worker
Returns the value of theworker
record component.- Returns:
- the value of the
worker
record component
-
scheduler
Returns the value of thescheduler
record component.- Returns:
- the value of the
scheduler
record component
-
ticker
Returns the value of theticker
record component.- Returns:
- the value of the
ticker
record component
-
webSocketClient
public org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient()Returns the value of thewebSocketClient
record component.- Returns:
- the value of the
webSocketClient
record component
-