Interface IClientHelper
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
TwitchClientHelper
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
disableClipEventListener
(Iterable<String> channelNames) Disable Clip Creation Listener for the given channel namesdefault boolean
disableClipEventListener
(String channelName) Disable Clip Creation Listenerboolean
disableClipEventListenerForId
(String channelId) Disable Clip Creation Listener, without invoking a Helix API calldefault void
disableFollowEventListener
(Iterable<String> channelNames) Disable Follow Listener for the given channel namesdefault void
disableFollowEventListener
(String channelName) Disable Follow Listenerboolean
disableFollowEventListenerForId
(String channelId) Disable Follow Listener, without invoking a Helix API calldefault void
disableStreamEventListener
(Iterable<String> channelNames) Disable StreamEvent Listener for the given channel namesdefault void
disableStreamEventListener
(String channelName) Disable StreamEvent Listenerboolean
disableStreamEventListenerForId
(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 User
enableClipEventListener
(String channelName) Clip Creation Listenerdefault boolean
enableClipEventListener
(String channelId, String channelName) Enable Clip Creation Listener, without invoking a Helix API callboolean
enableClipEventListener
(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 User
enableFollowEventListener
(String channelName) Enable Follow Listener for the given channel nameboolean
enableFollowEventListener
(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 User
enableStreamEventListener
(String channelName) Enable StreamEvent Listenerboolean
enableStreamEventListener
(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.void
setThreadDelay
(long threadDelay) UpdatesExponentialBackoffStrategy.getBaseMillis()
for each of the independent listeners (i.e.default void
setThreadRate
(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
FollowEvent
to fire, defaultAuthToken must be a user access token from a moderator of the channel with theTwitchScopes.HELIX_CHANNEL_FOLLOWERS_READ
scope. Otherwise, the client helper can only fireChannelFollowCountUpdateEvent
due 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
FollowEvent
to fire, defaultAuthToken must be a user access token from a moderator of the channel with theTwitchScopes.HELIX_CHANNEL_FOLLOWERS_READ
scope. Otherwise, the client helper can only fireChannelFollowCountUpdateEvent
due to Twitch restrictions implemented on 2023-09-12.- Parameters:
channelName
- Channel Name
-
enableFollowEventListener
Enable Follow Listener for the given channel namesFor
FollowEvent
to fire, defaultAuthToken must be a user access token from a moderator of the channel with theTwitchScopes.HELIX_CHANNEL_FOLLOWERS_READ
scope. Otherwise, the client helper can only fireChannelFollowCountUpdateEvent
due 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
-