Interface IClientHelper
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
TwitchClientHelper
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddisableClipEventListener(Iterable<String> channelNames) Disable Clip Creation Listener for the given channel namesdefault booleandisableClipEventListener(String channelName) Disable Clip Creation ListenerbooleandisableClipEventListenerForId(String channelId) Disable Clip Creation Listener, without invoking a Helix API calldefault voiddisableFollowEventListener(Iterable<String> channelNames) Disable Follow Listener for the given channel namesdefault voiddisableFollowEventListener(String channelName) Disable Follow ListenerbooleandisableFollowEventListenerForId(String channelId) Disable Follow Listener, without invoking a Helix API calldefault voiddisableStreamEventListener(Iterable<String> channelNames) Disable StreamEvent Listener for the given channel namesdefault voiddisableStreamEventListener(String channelName) Disable StreamEvent ListenerbooleandisableStreamEventListenerForId(String channelId) Disable StreamEventListener, without invoking a Helix API calldefault Collection<User>enableClipEventListener(Iterable<String> channelNames) Enable Clip Creation Listener for the given channel namesdefault @Nullable UserenableClipEventListener(String channelName) Clip Creation Listenerdefault booleanenableClipEventListener(String channelId, String channelName) Enable Clip Creation Listener, without invoking a Helix API callbooleanenableClipEventListener(String channelId, String channelName, Instant startedAt) Enable Clip Creation Listener, without invoking a Helix API call, starting at a custom timestampdefault Collection<User>enableFollowEventListener(Iterable<String> channelNames) Enable Follow Listener for the given channel namesdefault @Nullable UserenableFollowEventListener(String channelName) Enable Follow Listener for the given channel namebooleanenableFollowEventListener(String channelId, String channelName) Enable Follow Listener, without invoking a Helix API calldefault Collection<User>enableStreamEventListener(Iterable<String> channelNames) Enable StreamEvent Listener for the given channel namesdefault @Nullable UserenableStreamEventListener(String channelName) Enable StreamEvent ListenerbooleanenableStreamEventListener(String channelId, String channelName) Enable StreamEvent Listener, without invoking a Helix API callgetCachedInformation(String channelId) Get cached information for a channel's stream status and follower count.voidsetThreadDelay(long threadDelay) UpdatesExponentialBackoffStrategy.getBaseMillis()for each of the independent listeners (i.e.default voidsetThreadRate(long threadRate) UpdatesExponentialBackoffStrategy.getBaseMillis()for each of the independent listeners (i.e.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
getTwitchHelix
TwitchHelix getTwitchHelix() -
enableStreamEventListener
Enable StreamEvent Listener, without invoking a Helix API call- Parameters:
channelId- Channel IdchannelName- Channel Name- Returns:
- true if the channel was added, false otherwise
-
disableStreamEventListenerForId
Disable StreamEventListener, without invoking a Helix API call- Parameters:
channelId- Channel Id- Returns:
- true if the channel was removed, false otherwise
-
enableFollowEventListener
Enable Follow Listener, without invoking a Helix API callFor
FollowEventto fire, defaultAuthToken must be a user access token from a moderator of the channel with theTwitchScopes.HELIX_CHANNEL_FOLLOWERS_READscope. Otherwise, the client helper can only fireChannelFollowCountUpdateEventdue to Twitch restrictions implemented on 2023-09-12.- Parameters:
channelId- Channel IdchannelName- Channel Name- Returns:
- true if the channel was added, false otherwise
-
disableFollowEventListenerForId
Disable Follow Listener, without invoking a Helix API call- Parameters:
channelId- Channel Id- Returns:
- true when a previously-tracked channel was removed, false otherwise
-
enableClipEventListener
Enable Clip Creation Listener, without invoking a Helix API call, starting at a custom timestamp- Parameters:
channelId- Channel IdchannelName- Channel NamestartedAt- The oldest clip creation timestamp to start the queries at- Returns:
- whether the channel was added
-
disableClipEventListenerForId
Disable Clip Creation Listener, without invoking a Helix API call- Parameters:
channelId- Channel Id- Returns:
- whether a previously-tracked channel was removed
-
getCachedInformation
Get cached information for a channel's stream status and follower count.For this information to be valid, the respective event listeners need to be enabled for the channel.
For thread safety, the setters on this object should not be used; only getters.
- Parameters:
channelId- The ID of the channel whose cache is to be retrieved.- Returns:
- ChannelCache in an optional wrapper.
-
setThreadDelay
void setThreadDelay(long threadDelay) UpdatesExponentialBackoffStrategy.getBaseMillis()for each of the independent listeners (i.e. stream status and followers)- Parameters:
threadDelay- the minimum milliseconds delay between each api call
-
enableStreamEventListener
Enable StreamEvent Listener- Parameters:
channelName- Channel Name
-
enableStreamEventListener
Enable StreamEvent Listener for the given channel names- Parameters:
channelNames- the channel names to be added
-
disableStreamEventListener
Disable StreamEvent Listener- Parameters:
channelName- Channel Name
-
disableStreamEventListener
Disable StreamEvent Listener for the given channel names- Parameters:
channelNames- the channel names to be removed
-
enableFollowEventListener
Enable Follow Listener for the given channel nameFor
FollowEventto fire, defaultAuthToken must be a user access token from a moderator of the channel with theTwitchScopes.HELIX_CHANNEL_FOLLOWERS_READscope. Otherwise, the client helper can only fireChannelFollowCountUpdateEventdue to Twitch restrictions implemented on 2023-09-12.- Parameters:
channelName- Channel Name
-
enableFollowEventListener
Enable Follow Listener for the given channel namesFor
FollowEventto fire, defaultAuthToken must be a user access token from a moderator of the channel with theTwitchScopes.HELIX_CHANNEL_FOLLOWERS_READscope. Otherwise, the client helper can only fireChannelFollowCountUpdateEventdue to Twitch restrictions implemented on 2023-09-12.- Parameters:
channelNames- the channel names to be added
-
disableFollowEventListener
Disable Follow Listener- Parameters:
channelName- Channel Name
-
disableFollowEventListener
Disable Follow Listener for the given channel names- Parameters:
channelNames- the channel names to be removed
-
enableClipEventListener
Enable Clip Creation Listener, without invoking a Helix API call- Parameters:
channelId- Channel IdchannelName- Channel Name- Returns:
- whether the channel was added
-
enableClipEventListener
Clip Creation Listener- Parameters:
channelName- Channel Name- Returns:
- the channel whose clip creations are now tracked, or null (if unable to resolve or already tracking)
-
enableClipEventListener
Enable Clip Creation Listener for the given channel names- Parameters:
channelNames- the channel names to be added- Returns:
- the channels that are freshly tracked for clip creations
-
disableClipEventListener
Disable Clip Creation Listener- Parameters:
channelName- Channel Name- Returns:
- whether a previously-tracked channel was removed
-
disableClipEventListener
Disable Clip Creation Listener for the given channel names- Parameters:
channelNames- the channel names to be removed
-
setThreadRate
default void setThreadRate(long threadRate) UpdatesExponentialBackoffStrategy.getBaseMillis()for each of the independent listeners (i.e. stream status and followers)- Parameters:
threadRate- the maximum rate of api calls per second
-