Record Class GatewayConnectionContext
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.client.gateway_interface.GatewayConnectionContext
- Record Components:
launchContext- TheLaunchContextprovided 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- TheWebSocketClientwhich also manages theHttpClientused byGatewayInterfaceinstances. 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 classBuilder 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 aGatewayConnectionContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuilder(LaunchContext launchContext) Factory method which creates a newGatewayConnectionContext.Buildergiven aLaunchContext.final booleanIndicates whether some other object is "equal to" this one.org.eclipse.jetty.client.HttpClientfinal inthashCode()Returns a hash code value for this object.Returns the value of thelaunchContextrecord component.Returns the value of theschedulerrecord component.ticker()Returns the value of thetickerrecord component.final StringtoString()Returns a string representation of this record class.org.eclipse.jetty.websocket.client.WebSocketClientReturns the value of thewebSocketClientrecord component.worker()Returns the value of theworkerrecord 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 aGatewayConnectionContextrecord class.- Parameters:
launchContext- the value for thelaunchContextrecord componentworker- the value for theworkerrecord componentscheduler- the value for theschedulerrecord componentticker- the value for thetickerrecord componentwebSocketClient- the value for thewebSocketClientrecord component
-
-
Method Details
-
getHttpClient
public org.eclipse.jetty.client.HttpClient getHttpClient()- Returns:
- the
HttpClientin this context
-
builder
Factory method which creates a newGatewayConnectionContext.Buildergiven aLaunchContext. The Builder will give the caller the opportunity to customize and build a new GatewayConnectionContext instance.- Parameters:
launchContext- TheLaunchContextfor the new connection context. Must not be null.- Returns:
- The new
GatewayConnectionContext.Builderinstance. 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 thelaunchContextrecord component.- Returns:
- the value of the
launchContextrecord component
-
worker
Returns the value of theworkerrecord component.- Returns:
- the value of the
workerrecord component
-
scheduler
Returns the value of theschedulerrecord component.- Returns:
- the value of the
schedulerrecord component
-
ticker
Returns the value of thetickerrecord component.- Returns:
- the value of the
tickerrecord component
-
webSocketClient
public org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient()Returns the value of thewebSocketClientrecord component.- Returns:
- the value of the
webSocketClientrecord component
-