Search in sources :

Example 66 with Database

use of com.djrapitops.plan.storage.database.Database in project Plan by plan-player-analytics.

the class DataValueGatherer method storeExtensionInformation.

public void storeExtensionInformation() {
    String pluginName = extension.getPluginName();
    Icon pluginIcon = extension.getPluginIcon();
    long time = System.currentTimeMillis();
    ServerUUID serverUUID = serverInfo.getServerUUID();
    Database database = dbSystem.getDatabase();
    database.executeTransaction(new StoreIconTransaction(pluginIcon));
    database.executeTransaction(new StorePluginTransaction(pluginName, time, serverUUID, pluginIcon));
    for (TabInformation tab : extension.getPluginTabs()) {
        database.executeTransaction(new StoreIconTransaction(tab.getTabIcon()));
        database.executeTransaction(new StoreTabInformationTransaction(pluginName, serverUUID, tab));
    }
    database.executeTransaction(new RemoveInvalidResultsTransaction(pluginName, serverUUID, extension.getInvalidatedMethods()));
}
Also used : StoreIconTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction) ServerUUID(com.djrapitops.plan.identification.ServerUUID) Database(com.djrapitops.plan.storage.database.Database) StoreTabInformationTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.StoreTabInformationTransaction) TabInformation(com.djrapitops.plan.extension.implementation.TabInformation) Icon(com.djrapitops.plan.extension.icon.Icon) StorePluginTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.StorePluginTransaction)

Example 67 with Database

use of com.djrapitops.plan.storage.database.Database in project Plan by plan-player-analytics.

the class DataValueGatherer method storeString.

private void storeString(Parameters parameters, Conditions conditions, StringDataValue data) {
    ProviderInformation information = data.getInformation();
    String value = getValue(conditions, data, information);
    if (value == null)
        return;
    Database db = dbSystem.getDatabase();
    db.executeTransaction(new StoreIconTransaction(information.getIcon()));
    db.executeTransaction(new StoreProviderTransaction(information, parameters));
    db.executeTransaction(new StoreServerStringResultTransaction(information, parameters, value));
}
Also used : StoreIconTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction) StoreProviderTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction) Database(com.djrapitops.plan.storage.database.Database) ProviderInformation(com.djrapitops.plan.extension.implementation.ProviderInformation)

Example 68 with Database

use of com.djrapitops.plan.storage.database.Database in project Plan by plan-player-analytics.

the class DataValueGatherer method storePlayerDouble.

private void storePlayerDouble(Parameters parameters, Conditions conditions, DoubleDataValue data) {
    ProviderInformation information = data.getInformation();
    Double value = getValue(conditions, data, information);
    if (value == null)
        return;
    Database db = dbSystem.getDatabase();
    db.executeTransaction(new StoreIconTransaction(information.getIcon()));
    db.executeTransaction(new StoreProviderTransaction(information, parameters));
    db.executeTransaction(new StorePlayerDoubleResultTransaction(information, parameters, value));
}
Also used : StoreIconTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction) StoreProviderTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction) Database(com.djrapitops.plan.storage.database.Database) ProviderInformation(com.djrapitops.plan.extension.implementation.ProviderInformation)

Example 69 with Database

use of com.djrapitops.plan.storage.database.Database in project Plan by plan-player-analytics.

the class DataValueGatherer method storePlayerNumber.

private void storePlayerNumber(Parameters parameters, Conditions conditions, NumberDataValue data) {
    ProviderInformation information = data.getInformation();
    Long value = getValue(conditions, data, information);
    if (value == null)
        return;
    Database db = dbSystem.getDatabase();
    db.executeTransaction(new StoreIconTransaction(information.getIcon()));
    db.executeTransaction(new StoreProviderTransaction(information, parameters));
    db.executeTransaction(new StorePlayerNumberResultTransaction(information, parameters, value));
}
Also used : StoreIconTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction) StoreProviderTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction) Database(com.djrapitops.plan.storage.database.Database) ProviderInformation(com.djrapitops.plan.extension.implementation.ProviderInformation)

Example 70 with Database

use of com.djrapitops.plan.storage.database.Database in project Plan by plan-player-analytics.

the class DataValueGatherer method storePlayerString.

private void storePlayerString(Parameters parameters, Conditions conditions, StringDataValue data) {
    ProviderInformation information = data.getInformation();
    String value = getValue(conditions, data, information);
    if (value == null)
        return;
    Database db = dbSystem.getDatabase();
    db.executeTransaction(new StoreIconTransaction(information.getIcon()));
    db.executeTransaction(new StoreProviderTransaction(information, parameters));
    db.executeTransaction(new StorePlayerStringResultTransaction(information, parameters, value));
}
Also used : StoreIconTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction) StoreProviderTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction) Database(com.djrapitops.plan.storage.database.Database) ProviderInformation(com.djrapitops.plan.extension.implementation.ProviderInformation)

Aggregations

Database (com.djrapitops.plan.storage.database.Database)90 ServerUUID (com.djrapitops.plan.identification.ServerUUID)18 HashMap (java.util.HashMap)18 StoreIconTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction)12 ProviderInformation (com.djrapitops.plan.extension.implementation.ProviderInformation)11 UUID (java.util.UUID)10 StoreProviderTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction)9 DBSystem (com.djrapitops.plan.storage.database.DBSystem)9 TPSMutator (com.djrapitops.plan.delivery.domain.mutators.TPSMutator)7 PlanConfig (com.djrapitops.plan.settings.config.PlanConfig)7 PlayerName (com.djrapitops.plan.delivery.domain.PlayerName)6 ServerName (com.djrapitops.plan.delivery.domain.ServerName)6 Point (com.djrapitops.plan.delivery.rendering.json.graphs.line.Point)6 ActiveSession (com.djrapitops.plan.gathering.domain.ActiveSession)6 ServerInfo (com.djrapitops.plan.identification.ServerInfo)6 InetAddress (java.net.InetAddress)6 Inject (javax.inject.Inject)6 DateObj (com.djrapitops.plan.delivery.domain.DateObj)5 LineGraphFactory (com.djrapitops.plan.delivery.rendering.json.graphs.line.LineGraphFactory)5 DBOpException (com.djrapitops.plan.exceptions.database.DBOpException)5