public class PingService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
apiKey
The API-key for the current instance.
|
PingServiceDelegate |
delegate
The object that will be notified about status-changes.
|
static java.lang.String |
location
The location, the bot is running on
Note: Accessing this variable will not contact Redunda.
|
static java.util.concurrent.atomic.AtomicBoolean |
standby
Stores if the bot should be on standby; true by default
|
Constructor and Description |
---|
PingService()
Initialize with default values
|
PingService(java.lang.String key)
Initializes the object with the api key
|
PingService(java.lang.String key,
java.lang.String botVersion)
Initializes the object with the api key and bot-version
|
PingService(java.lang.String key,
java.lang.String botVersion,
int pingInterval)
Initializes the object with a `pingInterval` in seconds, the bot's verision and the api key
|
Modifier and Type | Method and Description |
---|---|
DataService |
buildDataService()
Returns a `DataService` with the same API-key as `PingService`
|
boolean |
checkStandbyStatus()
Fetches the current standby status synchronously from the server
If an exception occurs, the status will be `true`.
|
boolean |
getDebugging()
Returns is PingService is in debugging mode.
|
void |
setDebugging(boolean debug)
Enables or disables the debugging mode.
|
void |
start()
Resets the executor services and starts pinging the server
|
public java.lang.String apiKey
public PingServiceDelegate delegate
public static java.util.concurrent.atomic.AtomicBoolean standby
public static java.lang.String location
public PingService()
public PingService(java.lang.String key)
key
- The API key for Redunda. You can get it form the instances overviewpublic PingService(java.lang.String key, java.lang.String botVersion)
key
- The API key for Redunda. You can get it form the instances overviewbotVersion
- The version of your bot as stringpublic PingService(java.lang.String key, java.lang.String botVersion, int pingInterval)
key
- The API key for Redunda. You can get it form the instances overviewbotVersion
- The version of your bot as stringpingInterval
- The time in seconds between two pings. (30 by default)public DataService buildDataService()
public void setDebugging(boolean debug)
debug
- The new valuepublic boolean getDebugging()
public final void start()
public boolean checkStandbyStatus()