public class API extends Object
Modifier and Type | Method and Description |
---|---|
void |
addPluginDataSource(PluginData dataSource)
Add a source of plugin data to the Plugins tab on Analysis and/or Inspect
page.
|
void |
cacheUserDataToInspectCache(UUID uuid)
Cache the UserData to InspectCache.
|
AnalysisData |
getAnalysisDataFromCache()
Used to get the AnalysisData object.
|
String |
getAnalysisHtmlAsString()
Used to get the full Html of the Analysis page as a string.
|
String |
getPlayerHtmlAsString(UUID uuid)
Used to get the full Html of the Inspect page as a string.
|
String |
getPlayerInspectPageLink(String name)
Used to get the link to InspectPage of a player.
|
String |
getPlayerName(UUID uuid)
Used to get the playerName of a player who has played on the server.
|
boolean |
isAnalysisCached()
Check if the Analysis has been run and is cached to the AnalysisCache.
|
boolean |
isEnabled()
Check whether or not the plugin enabled successfully.
|
boolean |
isPlayersDataInspectCached(UUID uuid)
Check if the UserData is cached to the InspectCache.
|
void |
placeDataToCache(UserData data)
Used to cache a UserData object.
|
UUID |
playerNameToUUID(String playerName)
Uses UUIDFetcher to turn PlayerName to UUID.
|
void |
saveCachedData()
Used to save the cached data to the database.
|
void |
scheduleEventHandlingInfo(HandlingInfo info)
Schedule a HandlingInfo object to be processed.
|
void |
scheduleForGet(UUID uuid,
DBCallableProcessor processor)
Schedule a UserData object to be fetched from the database or cache if
the player is online.
|
void |
updateAnalysisCache()
Run's the analysis with the current data in the cache and fetches rest from
the database.
|
public API(Plan plugin)
plugin
- Current instance of Planpublic boolean isEnabled()
public void addPluginDataSource(PluginData dataSource)
dataSource
- an object that extends PluginData-object, thus allowing
Analysis and Inspect to manage the data of a plugin correctly.PluginData
public String getPlayerInspectPageLink(String name)
<a href="Link">Playername</a>
name
- Playername of the playerpublic void scheduleForGet(UUID uuid, DBCallableProcessor processor)
uuid
- UUID of the player.processor
- Object implementing DBCallableProcessor, which
process(UserData data) method will be called.public void scheduleEventHandlingInfo(HandlingInfo info)
info
- object that extends HandlingInfo.public void placeDataToCache(UserData data)
data
- UserData object. Will be placed to the data.getUuid() key in
the cache.public void saveCachedData()
public boolean isPlayersDataInspectCached(UUID uuid)
uuid
- UUID of the player.public void cacheUserDataToInspectCache(UUID uuid)
uuid
- UUID of the player.public String getPlayerHtmlAsString(UUID uuid)
uuid
- UUID of the player.public boolean isAnalysisCached()
public void updateAnalysisCache()
public String getAnalysisHtmlAsString()
public AnalysisData getAnalysisDataFromCache()
AnalysisData
public String getPlayerName(UUID uuid) throws IllegalStateException
uuid
- UUID of the player.IllegalStateException
- If the player has not played on the server
before.Copyright © 2017. All rights reserved.