Package com.github.twitch4j
Class TwitchClientPoolBuilder
java.lang.Object
com.github.twitch4j.TwitchClientPoolBuilder
public class TwitchClientPoolBuilder
extends java.lang.Object
Builder to get a TwitchClientPool Instance by provided various options, to provide the user with a lot of customizable options.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Collection<java.lang.String>botOwnerIdsUser IDs of Bot Owners for applyingCommandPermission.OWNERprotected java.lang.IntegerchatQueueSizeSize of the ChatQueueprotected io.github.bucket4j.BandwidthchatRateLimitCustom RateLimit for ChatMessagesprotected java.util.Set<java.lang.String>commandPrefixesIRC Command Handlers -
Method Summary
Modifier and Type Method Description TwitchClientPoolbuild()Initializestatic TwitchClientPoolBuilderbuilder()Initialize the builderjava.util.Collection<java.lang.String>getBotOwnerIds()User IDs of Bot Owners for applyingCommandPermission.OWNERcom.github.philippheuer.credentialmanager.domain.OAuth2CredentialgetChatAccount()Chat Accountjava.lang.IntegergetChatQueueSize()Size of the ChatQueuelonggetChatQueueTimeout()Wait time for taking items off chat queue in milliseconds.io.github.bucket4j.BandwidthgetChatRateLimit()Custom RateLimit for ChatMessagesjava.lang.StringgetChatServer()Sets the default server used for chatjava.lang.StringgetClientId()Client Idjava.lang.StringgetClientSecret()Client Secretjava.util.Set<java.lang.String>getCommandPrefixes()IRC Command Handlerscom.github.philippheuer.credentialmanager.CredentialManagergetCredentialManager()CredentialManagercom.github.philippheuer.credentialmanager.domain.OAuth2CredentialgetDefaultAuthToken()Default Auth Token for API Requestsjava.lang.Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler>getDefaultEventHandler()EventManagerjava.lang.BooleangetEnableChat()Enabled: Chatjava.lang.BooleangetEnableChatPool()java.lang.BooleangetEnableExtensions()Enabled: Extensionsjava.lang.BooleangetEnableGraphQL()Enabled: GraphQLjava.lang.BooleangetEnableHelix()Enabled: Helixjava.lang.BooleangetEnableKraken()Enabled: Krakenjava.lang.BooleangetEnablePubSub()Enabled: PubSubjava.lang.BooleangetEnablePubSubPool()java.lang.BooleangetEnableTMI()Enabled: TMIcom.github.philippheuer.events4j.core.EventManagergetEventManager()EventManagerfeign.Logger.LevelgetFeignLogLevel()you can overwrite the feign loglevel to print the full requests + responses if neededlonggetHelperThreadDelay()Millisecond Delay for Client Helper ThreadintgetMaxChannelsPerChatInstance()intgetMaxTopicsPerPubSubInstance()com.github.twitch4j.common.config.ProxyConfiggetProxyConfig()Proxy Configurationjava.lang.StringgetRedirectUrl()Redirect Urljava.lang.IntegergetRequestQueueSize()HTTP Request Queue Sizejava.util.concurrent.ScheduledThreadPoolExecutorgetScheduledThreadPoolExecutor()Scheduler Thread Pool Executorjava.lang.IntegergetTimeout()Default Timeoutjava.lang.StringgetUserAgent()User AgentTwitchClientPoolBuildersetBotOwnerIds(java.util.Collection<java.lang.String> botOwnerIds)User IDs of Bot Owners for applyingCommandPermission.OWNERTwitchClientPoolBuilderwithBotOwnerId(java.lang.String userId)With a Bot Owner's User IDTwitchClientPoolBuilderwithChatAccount(com.github.philippheuer.credentialmanager.domain.OAuth2Credential chatAccount)Chat AccountTwitchClientPoolBuilderwithChatQueueSize(java.lang.Integer chatQueueSize)Size of the ChatQueueTwitchClientPoolBuilderwithChatQueueTimeout(long chatQueueTimeout)Wait time for taking items off chat queue in milliseconds.TwitchClientPoolBuilderwithChatRateLimit(io.github.bucket4j.Bandwidth chatRateLimit)Custom RateLimit for ChatMessagesTwitchClientPoolBuilderwithChatServer(java.lang.String chatServer)Sets the default server used for chatTwitchClientPoolBuilderwithClientId(java.lang.String clientId)Client IdTwitchClientPoolBuilderwithClientSecret(java.lang.String clientSecret)Client SecretTwitchClientPoolBuilderwithCommandTrigger(java.lang.String commandTrigger)With a CommandTriggerTwitchClientPoolBuilderwithCredentialManager(com.github.philippheuer.credentialmanager.CredentialManager credentialManager)CredentialManagerTwitchClientPoolBuilderwithDefaultAuthToken(com.github.philippheuer.credentialmanager.domain.OAuth2Credential defaultAuthToken)Default Auth Token for API RequestsTwitchClientPoolBuilderwithDefaultEventHandler(java.lang.Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> defaultEventHandler)EventManagerTwitchClientPoolBuilderwithEnableChat(java.lang.Boolean enableChat)Enabled: ChatTwitchClientPoolBuilderwithEnableChatPool(java.lang.Boolean enableChatPool)TwitchClientPoolBuilderwithEnableExtensions(java.lang.Boolean enableExtensions)Enabled: ExtensionsTwitchClientPoolBuilderwithEnableGraphQL(java.lang.Boolean enableGraphQL)Enabled: GraphQLTwitchClientPoolBuilderwithEnableHelix(java.lang.Boolean enableHelix)Enabled: HelixTwitchClientPoolBuilderwithEnableKraken(java.lang.Boolean enableKraken)Enabled: KrakenTwitchClientPoolBuilderwithEnablePubSub(java.lang.Boolean enablePubSub)Enabled: PubSubTwitchClientPoolBuilderwithEnablePubSubPool(java.lang.Boolean enablePubSubPool)TwitchClientPoolBuilderwithEnableTMI(java.lang.Boolean enableTMI)Enabled: TMITwitchClientPoolBuilderwithEventManager(com.github.philippheuer.events4j.core.EventManager eventManager)EventManagerTwitchClientPoolBuilderwithFeignLogLevel(feign.Logger.Level feignLogLevel)you can overwrite the feign loglevel to print the full requests + responses if neededTwitchClientPoolBuilderwithHelperThreadDelay(long helperThreadDelay)Millisecond Delay for Client Helper ThreadTwitchClientPoolBuilderwithHelperThreadRate(long helperThreadDelay)Deprecated.in favor of withHelperThreadDelayTwitchClientPoolBuilderwithMaxChannelsPerChatInstance(int maxChannelsPerChatInstance)TwitchClientPoolBuilderwithMaxTopicsPerPubSubInstance(int maxTopicsPerPubSubInstance)TwitchClientPoolBuilderwithProxyConfig(com.github.twitch4j.common.config.ProxyConfig proxyConfig)Proxy ConfigurationTwitchClientPoolBuilderwithRedirectUrl(java.lang.String redirectUrl)Redirect UrlTwitchClientPoolBuilderwithRequestQueueSize(java.lang.Integer requestQueueSize)HTTP Request Queue SizeTwitchClientPoolBuilderwithScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor scheduledThreadPoolExecutor)Scheduler Thread Pool ExecutorTwitchClientPoolBuilderwithTimeout(java.lang.Integer timeout)Default TimeoutTwitchClientPoolBuilderwithUserAgent(java.lang.String userAgent)User AgentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
botOwnerIds
protected java.util.Collection<java.lang.String> botOwnerIdsUser IDs of Bot Owners for applyingCommandPermission.OWNER -
commandPrefixes
protected final java.util.Set<java.lang.String> commandPrefixesIRC Command Handlers -
chatQueueSize
protected java.lang.Integer chatQueueSizeSize of the ChatQueue -
chatRateLimit
protected io.github.bucket4j.Bandwidth chatRateLimitCustom RateLimit for ChatMessages
-
-
Method Details
-
withBotOwnerId
With a Bot Owner's User ID- Parameters:
userId- the user id- Returns:
- TwitchClientPoolBuilder
-
withCommandTrigger
With a CommandTrigger- Parameters:
commandTrigger- Command Trigger (Prefix)- Returns:
- TwitchClientPoolBuilder
-
withHelperThreadRate
Deprecated.in favor of withHelperThreadDelayWith a base thread delay for API calls byTwitchClientHelperNote: the method name has been a misnomer as it has always set the delay rather than a rate. One can change the rate at any time via
TwitchClientHelper.setThreadRate(long).- Parameters:
helperThreadDelay- TwitchClientHelper Base Thread Delay- Returns:
- TwitchClientPoolBuilder
-
builder
Initialize the builder- Returns:
- Twitch Client Pool Builder
-
build
Initialize- Returns:
TwitchClientPoolinitialized class
-
getClientId
public java.lang.String getClientId()Client Id -
getClientSecret
public java.lang.String getClientSecret()Client Secret -
getUserAgent
public java.lang.String getUserAgent()User Agent -
getRequestQueueSize
public java.lang.Integer getRequestQueueSize()HTTP Request Queue Size -
getRedirectUrl
public java.lang.String getRedirectUrl()Redirect Url -
getTimeout
public java.lang.Integer getTimeout()Default Timeout -
getEnableExtensions
public java.lang.Boolean getEnableExtensions()Enabled: Extensions -
getEnableHelix
public java.lang.Boolean getEnableHelix()Enabled: Helix -
getEnableKraken
public java.lang.Boolean getEnableKraken()Enabled: Kraken -
getEnableTMI
public java.lang.Boolean getEnableTMI()Enabled: TMI -
getEnableChat
public java.lang.Boolean getEnableChat()Enabled: Chat -
getEnableChatPool
public java.lang.Boolean getEnableChatPool() -
getMaxChannelsPerChatInstance
public int getMaxChannelsPerChatInstance() -
getBotOwnerIds
public java.util.Collection<java.lang.String> getBotOwnerIds()User IDs of Bot Owners for applyingCommandPermission.OWNER -
getCommandPrefixes
public java.util.Set<java.lang.String> getCommandPrefixes()IRC Command Handlers -
getEnablePubSub
public java.lang.Boolean getEnablePubSub()Enabled: PubSub -
getEnablePubSubPool
public java.lang.Boolean getEnablePubSubPool() -
getMaxTopicsPerPubSubInstance
public int getMaxTopicsPerPubSubInstance() -
getEnableGraphQL
public java.lang.Boolean getEnableGraphQL()Enabled: GraphQL -
getChatAccount
public com.github.philippheuer.credentialmanager.domain.OAuth2Credential getChatAccount()Chat Account -
getEventManager
public com.github.philippheuer.events4j.core.EventManager getEventManager()EventManager -
getDefaultEventHandler
public java.lang.Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> getDefaultEventHandler()EventManager -
getChatQueueSize
public java.lang.Integer getChatQueueSize()Size of the ChatQueue -
getChatRateLimit
public io.github.bucket4j.Bandwidth getChatRateLimit()Custom RateLimit for ChatMessages -
getChatQueueTimeout
public long getChatQueueTimeout()Wait time for taking items off chat queue in milliseconds. Default recommended -
getChatServer
public java.lang.String getChatServer()Sets the default server used for chatDefaults to TwitchChat.TWITCH_WEB_SOCKET_SERVER, you can use TwitchChat.FDGT_TEST_SOCKET_SERVER for testing
-
getCredentialManager
public com.github.philippheuer.credentialmanager.CredentialManager getCredentialManager()CredentialManager -
getScheduledThreadPoolExecutor
public java.util.concurrent.ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor()Scheduler Thread Pool Executor -
getHelperThreadDelay
public long getHelperThreadDelay()Millisecond Delay for Client Helper Thread -
getDefaultAuthToken
public com.github.philippheuer.credentialmanager.domain.OAuth2Credential getDefaultAuthToken()Default Auth Token for API Requests -
getProxyConfig
public com.github.twitch4j.common.config.ProxyConfig getProxyConfig()Proxy Configuration -
getFeignLogLevel
public feign.Logger.Level getFeignLogLevel()you can overwrite the feign loglevel to print the full requests + responses if needed -
withClientId
Client Id- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withClientSecret
Client Secret- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withUserAgent
User Agent- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withRequestQueueSize
HTTP Request Queue Size- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withRedirectUrl
Redirect Url- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withTimeout
Default Timeout- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnableExtensions
Enabled: Extensions- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnableHelix
Enabled: Helix- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnableKraken
Enabled: Kraken- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnableTMI
Enabled: TMI- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnableChat
Enabled: Chat- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnableChatPool
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withMaxChannelsPerChatInstance
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
setBotOwnerIds
User IDs of Bot Owners for applyingCommandPermission.OWNER- Returns:
this.
-
withEnablePubSub
Enabled: PubSub- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnablePubSubPool
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withMaxTopicsPerPubSubInstance
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnableGraphQL
Enabled: GraphQL- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatAccount
public TwitchClientPoolBuilder withChatAccount(com.github.philippheuer.credentialmanager.domain.OAuth2Credential chatAccount)Chat Account- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEventManager
public TwitchClientPoolBuilder withEventManager(com.github.philippheuer.events4j.core.EventManager eventManager)EventManager- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withDefaultEventHandler
public TwitchClientPoolBuilder withDefaultEventHandler(java.lang.Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> defaultEventHandler)EventManager- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatQueueSize
Size of the ChatQueue- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatRateLimit
Custom RateLimit for ChatMessages- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatQueueTimeout
Wait time for taking items off chat queue in milliseconds. Default recommended- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatServer
Sets the default server used for chatDefaults to TwitchChat.TWITCH_WEB_SOCKET_SERVER, you can use TwitchChat.FDGT_TEST_SOCKET_SERVER for testing
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withCredentialManager
public TwitchClientPoolBuilder withCredentialManager(com.github.philippheuer.credentialmanager.CredentialManager credentialManager)CredentialManager- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withScheduledThreadPoolExecutor
public TwitchClientPoolBuilder withScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor scheduledThreadPoolExecutor)Scheduler Thread Pool Executor- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withHelperThreadDelay
Millisecond Delay for Client Helper Thread- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withDefaultAuthToken
public TwitchClientPoolBuilder withDefaultAuthToken(com.github.philippheuer.credentialmanager.domain.OAuth2Credential defaultAuthToken)Default Auth Token for API Requests- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withProxyConfig
public TwitchClientPoolBuilder withProxyConfig(com.github.twitch4j.common.config.ProxyConfig proxyConfig)Proxy Configuration- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withFeignLogLevel
you can overwrite the feign loglevel to print the full requests + responses if needed- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-