public class TwitchClient
extends java.lang.Object
The TwitchClient class is the central component, that grants access to the various rest endpoints, the twitch chat interface and the client related services. (CredentialManager/CommandHandler/...)
Modifier and Type | Field and Description |
---|---|
int |
twitchEndpointVersion
Twitch API Version
|
Constructor and Description |
---|
TwitchClient(java.lang.String clientId,
java.lang.String clientSecret)
Class Constructor - Creates a new TwitchClient Instance for the provided app.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to other related services.
|
void |
disconnect()
Disconnect from other related services.
|
ChannelEndpoint |
getChannelEndpoint()
Returns an a new ChannelEndpoint instance - identifying the channel by the channel id.
|
ChannelFeedEndpoint |
getChannelFeedEndpoint()
Deprecated.
Twitch removes Channel Feeds and Pulse. More info here.
|
ChatEndpoint |
getChatEndpoint()
Returns a new ChatEndpoint instance.
|
CommunityEndpoint |
getCommunityEndpoint()
Returns an a new CommunityEndpoint instance.
|
GameEndpoint |
getGameEndpoint()
Returns an a new GameEndpoint instance.
|
IngestEndpoint |
getIngestEndpoint()
Returns an a new IngestEndpoint instance.
|
KrakenEndpoint |
getKrakenEndpoint()
Returns an a new KrakenEndpoint instance.
|
SearchEndpoint |
getSearchEndpoint()
Returns an a new SearchEndpoint instance.
|
StreamEndpoint |
getStreamEndpoint()
Returns an a new StreamEndpoint instance.
|
TeamEndpoint |
getTeamEndpoint()
Returns an a new TeamEndpoint instance.
|
TMIEndpoint |
getTMIEndpoint()
Returns an a new TMIEndpoint instance.
|
UnofficialEndpoint |
getUnofficialEndpoint()
Returns an a new UnofficialEndpoint instance.
|
UserEndpoint |
getUserEndpoint()
Returns an a new UserEndpoint instance.
|
VideoEndpoint |
getVideoEndpoint()
Returns an a new VideoEndpoint instance.
|
void |
reconnect()
Reconnect to other related services.
|
public final int twitchEndpointVersion
public TwitchClient(java.lang.String clientId, java.lang.String clientSecret)
This will also initialize the rest interceptors, that provide oauth tokens/get/post parameters on the fly to easily build the rest requests.
clientId
- Twitch Application - IdclientSecret
- Twitch Application - Secretpublic void connect()
This methods opens the connection to the twitch irc server and the pubsub endpoint.
Connect needs to be called after initalizing the CredentialManager
.
public void disconnect()
This methods closes the connection to the twitch irc server and the pubsub endpoint.
public void reconnect()
This methods reconnects to the twitch irc server and the pubsub endpoint.
public KrakenEndpoint getKrakenEndpoint()
The Kraken Endpoint is the root of the twitch api. Querying the Kraken Endpoint gives information about the currently used token.
KrakenEndpoint
@Deprecated public ChannelFeedEndpoint getChannelFeedEndpoint()
ChannelFeedEndpoint
public ChannelEndpoint getChannelEndpoint()
The Channel Endpoint instances allow you the query or set data for a specific channel, therefore you need to provide information to identify a unique channel.
ChannelEndpoint
Channel
public GameEndpoint getGameEndpoint()
The Game Endpoint instance allows you to access information about the all available games on twitch.
GameEndpoint
Game
public StreamEndpoint getStreamEndpoint()
The Stream Endpoint provides information about all current live streams and related metadata.
For more information about the data, check out the Stream
model.
StreamEndpoint
Stream
public UserEndpoint getUserEndpoint()
The User Endpoint provides access to user-related informations and actions.
For more information about the available methods, check out the UserEndpoint
.
UserEndpoint
User
public CommunityEndpoint getCommunityEndpoint()
The Community Endpoint allows you to fetch information or manage your communities using the api.
The community methods usually return a Community
model.
CommunityEndpoint
Community
public IngestEndpoint getIngestEndpoint()
The Ingest Endpoint allows you to fetch a list of the twitch ingest servers.
IngestEndpoint
Ingest
public SearchEndpoint getSearchEndpoint()
The Search Endpoint allows you to search for Channel
s,
Game
s or Stream
s.
SearchEndpoint
Stream
,
Game
,
Channel
public TeamEndpoint getTeamEndpoint()
The Team Endpoint provides a list of all teams and detailed information about single teams.
TeamEndpoint
Team
public VideoEndpoint getVideoEndpoint()
The Video Endpoint provides access to videos that twitch users recoded.
VideoEndpoint
Video
public TMIEndpoint getTMIEndpoint()
The Twitch Messaging Service (TMI) is the chat service used in twitch. This is an unofficial api and can break at any point without any notice.
TMIEndpoint
public UnofficialEndpoint getUnofficialEndpoint()
UnofficialEndpoint
public ChatEndpoint getChatEndpoint()
ChatEndpoint