public class API extends Object
Methods can be called from Asynchronous task and are thread safe unless otherwise stated.
Use Plan.getPlanAPI() to get the API.
More information about API methods can be found on GitHub.
PluginData
,
AnalysisType
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 |
cachePlayerHtml(UUID uuid)
Cache Players's Inspect page to the PageCache of the WebServer.
|
void |
cacheUserDataToInspectCache(UUID uuid)
Deprecated.
use
cachePlayerHtml |
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 a relative link to InspectPage of a player.
|
String |
getPlayerName(UUID uuid)
Used to get the PlayerName of a player who has played on the server.
|
Collection<UUID> |
getSavedUUIDs()
Get the saved UUIDs in the database.
|
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 |
isPlayerHtmlCached(UUID uuid) |
boolean |
isPlayersDataInspectCached(UUID uuid)
Deprecated.
use
isPlayerHtmlCached |
UUID |
playerNameToUUID(String playerName)
Uses UUIDUtility to turn PlayerName to UUID.
|
UUID |
PlayerNameToUUID(String playerName)
Deprecated.
Typo in method name, use playerNameToUUID instead
|
void |
updateAnalysisCache()
Run the analysis.
|
public API(Plan plugin)
plugin
- Current instance of Planpublic boolean isEnabled()
public void addPluginDataSource(PluginData dataSource)
Refer to documentation on GitHub or Javadoc of PluginData to set-up a data source that extends PluginData correctly.
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)
This method is useful if you have a table and want to link to the inspect page.
Html.LINK.parse("Link", "PlayerName") can be used to get a link
<a href="Link">PlayerName</a>
name
- Name of the player@Deprecated public boolean isPlayersDataInspectCached(UUID uuid)
isPlayerHtmlCached
uuid
- UUID of the player.public boolean isPlayerHtmlCached(UUID uuid)
@Deprecated public void cacheUserDataToInspectCache(UUID uuid)
cachePlayerHtml
uuid
- UUID of the player.public void cachePlayerHtml(UUID uuid)
uuid
- UUID of the player.public String getPlayerHtmlAsString(UUID uuid)
Check if the data is cached to InspectCache before calling this.
uuid
- UUID of the player.public boolean isAnalysisCached()
public void updateAnalysisCache()
public String getAnalysisHtmlAsString()
Check if the data is cached to AnalysisCache before calling this.
NullPointerException
- if AnalysisData has not been cached.public AnalysisData getAnalysisDataFromCache()
Check if the data is cached to AnalysisCache before calling this.
AnalysisData
public String getPlayerName(UUID uuid) throws SQLException
uuid
- UUID of the player.IllegalArgumentException
- If uuid is null.IllegalStateException
- If the player has not played on the server before.SQLException
@Deprecated public UUID PlayerNameToUUID(String playerName) throws Exception
playerName
- Player's nameException
- if player's name is not registered at Mojangpublic UUID playerNameToUUID(String playerName)
playerName
- Player's nameIllegalArgumentException
- if player's name is not registered at Mojangpublic Collection<UUID> getSavedUUIDs() throws SQLException
Should be called from async thread.
SQLException
- If database error occurs.Copyright © 2017. All rights reserved.