Config operations

This commit is contained in:
Rsl1122 2018-12-23 22:10:54 +02:00
parent 60b771e005
commit cfc7f25a07
4 changed files with 18 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import com.djrapitops.plan.data.store.containers.NetworkContainer;
import com.djrapitops.plan.data.store.containers.PlayerContainer;
import com.djrapitops.plan.data.store.containers.ServerContainer;
import com.djrapitops.plan.system.info.server.Server;
import com.djrapitops.plan.system.settings.config.Config;
import java.util.*;
@ -135,4 +136,6 @@ public interface FetchOperations {
Map<Integer, List<TPS>> getPlayersOnlineForServers(Collection<Server> servers);
Map<UUID, Integer> getPlayersRegisteredForServers(Collection<Server> servers);
Optional<Config> getNewConfig(long updatedAfter, UUID serverUUID);
}

View File

@ -20,6 +20,7 @@ import com.djrapitops.plan.data.WebUser;
import com.djrapitops.plan.data.container.*;
import com.djrapitops.plan.data.store.objects.Nickname;
import com.djrapitops.plan.system.info.server.Server;
import com.djrapitops.plan.system.settings.config.Config;
import java.util.List;
import java.util.Map;
@ -83,4 +84,6 @@ public interface SaveOperations {
void ping(UUID uuid, Ping ping);
void setAsUninstalled(UUID serverUUID);
void saveConfig(UUID serverUUID, Config config);
}

View File

@ -30,6 +30,7 @@ import com.djrapitops.plan.system.cache.SessionCache;
import com.djrapitops.plan.system.database.databases.operation.FetchOperations;
import com.djrapitops.plan.system.database.databases.sql.SQLDB;
import com.djrapitops.plan.system.info.server.Server;
import com.djrapitops.plan.system.settings.config.Config;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -496,4 +497,9 @@ public class SQLFetchOps extends SQLOps implements FetchOperations {
public Map<UUID, Integer> getPlayersRegisteredForServers(Collection<Server> servers) {
return userInfoTable.getPlayersRegisteredForServers(servers);
}
@Override
public Optional<Config> getNewConfig(long updatedAfter, UUID serverUUID) {
return settingsTable.fetchNewerConfig(updatedAfter, serverUUID);
}
}

View File

@ -22,6 +22,7 @@ import com.djrapitops.plan.data.store.objects.Nickname;
import com.djrapitops.plan.system.database.databases.operation.SaveOperations;
import com.djrapitops.plan.system.database.databases.sql.SQLDB;
import com.djrapitops.plan.system.info.server.Server;
import com.djrapitops.plan.system.settings.config.Config;
import java.util.List;
import java.util.Map;
@ -152,4 +153,9 @@ public class SQLSaveOps extends SQLOps implements SaveOperations {
public void setAsUninstalled(UUID serverUUID) {
serverTable.setAsUninstalled(serverUUID);
}
@Override
public void saveConfig(UUID serverUUID, Config config) {
settingsTable.storeConfig(serverUUID, config);
}
}