public final class ServiceMediator extends Object
ServiceMediator
encapsulates the set of dependencies core module requires to function, giving access to
resources currently in use.
The following are some of the resources available through this mediator:
GatewayClient
allows retrieving specific properties and actions regarding Discord real-time
websocket connections.RestClient
provides a low-level way to perform API requests.StoreService
and StateHolder
allows low-level store manipulation. Modifying the
underlying structure during runtime can result in unexpected behavior.Constructor and Description |
---|
ServiceMediator(GatewayClient gatewayClient,
RestClient restClient,
StoreService storeService,
StateHolder stateHolder,
EventDispatcher eventDispatcher,
ClientConfig clientConfig,
VoiceClient voiceClient) |
Modifier and Type | Method and Description |
---|---|
DiscordClient |
getClient()
Return the
DiscordClient that is served by this instance. |
ClientConfig |
getClientConfig()
Return the current configuration for initiating gateway connections.
|
EventDispatcher |
getEventDispatcher()
Return the event dispatching processor used by this client.
|
GatewayClient |
getGatewayClient()
Return the current client for Gateway operations.
|
RestClient |
getRestClient()
Return the current client for REST operations providing a low-level way to perform requests.
|
StateHolder |
getStateHolder()
Return access to the stored/cached values coming from real-time Gateway updates.
|
StoreService |
getStoreService()
Return the current store factory.
|
VoiceClient |
getVoiceClient()
Return the current voice client to initiate voice gateway connections.
|
public ServiceMediator(GatewayClient gatewayClient, RestClient restClient, StoreService storeService, StateHolder stateHolder, EventDispatcher eventDispatcher, ClientConfig clientConfig, VoiceClient voiceClient)
public GatewayClient getGatewayClient()
GatewayClient
public RestClient getRestClient()
RestClient
public StoreService getStoreService()
StoreService
public StateHolder getStateHolder()
StateHolder
public EventDispatcher getEventDispatcher()
EventDispatcher
public DiscordClient getClient()
DiscordClient
that is served by this instance.DiscordClient
public ClientConfig getClientConfig()
ClientConfig
public VoiceClient getVoiceClient()
VoiceClient