[3.4.2] 2 api methods

This commit is contained in:
Rsl1122 2017-06-07 10:15:39 +03:00
parent 2feb291f11
commit bbbe47982c
2 changed files with 33 additions and 1 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId>
<artifactId>Plan</artifactId>
<version>3.2.1</version>
<version>3.4.2</version>
<packaging>jar</packaging>
<repositories>
<!-- <repository>

View File

@ -1,5 +1,8 @@
package main.java.com.djrapitops.plan.api;
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.AnalysisData;
@ -242,4 +245,33 @@ public class API {
public UUID playerNameToUUID(String playerName) throws Exception {
return UUIDFetcher.getUUIDOf(playerName);
}
/**
* Get the saved UUIDs in the database.
*
* Should be called from async thread.
*
* @return Collection of UUIDs that can be found in the database.
* @throws SQLException If database error occurs.
* @since 3.4.2
*/
public Collection<UUID> getSavedUUIDs() throws SQLException {
return plugin.getDB().getSavedUUIDs();
}
/**
* Get the saved UserData in the database for a collection of UUIDs.
*
* Will not contain data for UUIDs not found in the database.
*
* Should be called from async thread.
*
* @param uuids Collection of UUIDs that can be found in the database.
* @return List of all Data in the database.
* @throws SQLException If database error occurs.
* @since 3.4.2
*/
public List<UserData> getUserDataOfUsers(Collection<UUID> uuids) throws SQLException {
return plugin.getDB().getUserDataForUUIDS(uuids);
}
}