Class ConduitSpec
-
Method Summary
Modifier and TypeMethodDescription@Nullable com.github.philippheuer.credentialmanager.domain.OAuth2Credential
The app access token for helix requests.appAccessToken
(@Nullable com.github.philippheuer.credentialmanager.domain.OAuth2Credential appAccessToken) The app access token for helix requests.@Nullable String
clientId()
Your application's client ID.Your application's client ID.@Nullable String
Your application's client secret.clientSecret
(@Nullable String clientSecret) Your application's client secret.@Nullable String
The ID of an already created Conduit (optional); otherwiseTwitchConduitSocketPool
will create a new Conduit.The ID of an already created Conduit (optional); otherwiseTwitchConduitSocketPool
will create a new Conduit.boolean
@Nullable com.github.philippheuer.events4j.core.EventManager
An optionalEventManager
(if one is already created).eventManager
(@Nullable com.github.philippheuer.events4j.core.EventManager eventManager) An optionalEventManager
(if one is already created).@Nullable ScheduledThreadPoolExecutor
executor()
An optionalScheduledThreadPoolExecutor
.executor
(@Nullable ScheduledThreadPoolExecutor executor) An optionalScheduledThreadPoolExecutor
.int
hashCode()
@Nullable TwitchHelix
helix()
An optionalTwitchHelix
instance (if one is already created).helix
(@Nullable TwitchHelix helix) An optionalTwitchHelix
instance (if one is already created).int
The number of websockets that should be created by theTwitchConduitSocketPool
instance.poolShards
(int poolShards) The number of websockets that should be created by theTwitchConduitSocketPool
instance.static @NotNull ConduitSpec
process
(@NotNull Consumer<ConduitSpec> spec) @Nullable ProxyConfig
Optional: the proxy to use for helix requests and the websocket connections.proxyConfig
(@Nullable ProxyConfig proxyConfig) Optional: the proxy to use for helix requests and the websocket connections.int
An integer offset for the Shard IDs to be registered with the Conduit.shardOffset
(int shardOffset) An integer offset for the Shard IDs to be registered with the Conduit.@Nullable Duration
The amount of time to wait for the websocket shards to be welcomed by Twitch.socketWelcomeTimeout
(@Nullable Duration socketWelcomeTimeout) The amount of time to wait for the websocket shards to be welcomed by Twitch.toString()
@Nullable Integer
The total number of shards associated with the Conduit ID (optional).totalShardCount
(@Nullable Integer totalShardCount) The total number of shards associated with the Conduit ID (optional).void
validate()
-
Method Details
-
validate
public void validate() -
process
-
conduitId
The ID of an already created Conduit (optional); otherwiseTwitchConduitSocketPool
will create a new Conduit. -
poolShards
public int poolShards()The number of websockets that should be created by theTwitchConduitSocketPool
instance.Must be positive.
-
totalShardCount
The total number of shards associated with the Conduit ID (optional).If the Conduit is already created, specifying this value avoids a
TwitchHelix.getConduits(String)
call.If the Conduit is not created yet, this field can be used to create a larger Conduit than
poolShards()
(if you plan to create anotherTwitchConduitSocketPool
instance on another server). -
shardOffset
public int shardOffset()An integer offset for the Shard IDs to be registered with the Conduit.This field should only be set if the Conduit is already created with some shards already registered.
-
clientId
Your application's client ID.Not required if
appAccessToken()
is specified orhelix()
already has client credentials. -
clientSecret
Your application's client secret.Not required if
appAccessToken()
is specified orhelix()
already has client credentials. -
helix
An optionalTwitchHelix
instance (if one is already created). -
appAccessToken
@Nullable public @Nullable com.github.philippheuer.credentialmanager.domain.OAuth2Credential appAccessToken()The app access token for helix requests.Not required if client id and secret are specified OR the specified helix instance already has client credentials.
-
executor
An optionalScheduledThreadPoolExecutor
. -
eventManager
@Nullable public @Nullable com.github.philippheuer.events4j.core.EventManager eventManager()An optionalEventManager
(if one is already created).Prefer using
IEventSubConduit.getEventManager()
(instead of creating anEventManager
). -
proxyConfig
Optional: the proxy to use for helix requests and the websocket connections. -
socketWelcomeTimeout
The amount of time to wait for the websocket shards to be welcomed by Twitch.If a shard does not connect within this timeout,
ShardTimeoutException
is thrown byTwitchConduitSocketPool
. -
conduitId
The ID of an already created Conduit (optional); otherwiseTwitchConduitSocketPool
will create a new Conduit.- Returns:
this
.
-
poolShards
The number of websockets that should be created by theTwitchConduitSocketPool
instance.Must be positive.
- Returns:
this
.
-
totalShardCount
The total number of shards associated with the Conduit ID (optional).If the Conduit is already created, specifying this value avoids a
TwitchHelix.getConduits(String)
call.If the Conduit is not created yet, this field can be used to create a larger Conduit than
poolShards()
(if you plan to create anotherTwitchConduitSocketPool
instance on another server).- Returns:
this
.
-
shardOffset
An integer offset for the Shard IDs to be registered with the Conduit.This field should only be set if the Conduit is already created with some shards already registered.
- Returns:
this
.
-
clientId
Your application's client ID.Not required if
appAccessToken()
is specified orhelix()
already has client credentials.- Returns:
this
.
-
clientSecret
Your application's client secret.Not required if
appAccessToken()
is specified orhelix()
already has client credentials.- Returns:
this
.
-
helix
An optionalTwitchHelix
instance (if one is already created).- Returns:
this
.
-
appAccessToken
public ConduitSpec appAccessToken(@Nullable @Nullable com.github.philippheuer.credentialmanager.domain.OAuth2Credential appAccessToken) The app access token for helix requests.Not required if client id and secret are specified OR the specified helix instance already has client credentials.
- Returns:
this
.
-
executor
An optionalScheduledThreadPoolExecutor
.- Returns:
this
.
-
eventManager
public ConduitSpec eventManager(@Nullable @Nullable com.github.philippheuer.events4j.core.EventManager eventManager) An optionalEventManager
(if one is already created).Prefer using
IEventSubConduit.getEventManager()
(instead of creating anEventManager
).- Returns:
this
.
-
proxyConfig
Optional: the proxy to use for helix requests and the websocket connections.- Returns:
this
.
-
socketWelcomeTimeout
The amount of time to wait for the websocket shards to be welcomed by Twitch.If a shard does not connect within this timeout,
ShardTimeoutException
is thrown byTwitchConduitSocketPool
.- Returns:
this
.
-
equals
-
hashCode
public int hashCode() -
toString
-