Search in sources :

Example 6 with StoreIconTransaction

use of com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction in project Plan by plan-player-analytics.

the class DataValueGatherer method storeDouble.

private void storeDouble(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 StoreServerDoubleResultTransaction(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 7 with StoreIconTransaction

use of com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction 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 8 with StoreIconTransaction

use of com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction in project Plan by plan-player-analytics.

the class DataValueGatherer method storeTable.

private void storeTable(Parameters parameters, Conditions conditions, TableDataValue data) {
    ProviderInformation information = data.getInformation();
    Table value = getValue(conditions, data, information);
    if (value == null)
        return;
    Database db = dbSystem.getDatabase();
    for (Icon icon : value.getIcons()) {
        if (icon != null)
            db.executeTransaction(new StoreIconTransaction(icon));
    }
    db.executeTransaction(new StoreTableProviderTransaction(information, parameters, value));
    db.executeTransaction(new StoreServerTableResultTransaction(information, parameters, value));
}
Also used : StoreIconTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction) Table(com.djrapitops.plan.extension.table.Table) Database(com.djrapitops.plan.storage.database.Database) Icon(com.djrapitops.plan.extension.icon.Icon) ProviderInformation(com.djrapitops.plan.extension.implementation.ProviderInformation) StoreTableProviderTransaction(com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreTableProviderTransaction)

Example 9 with StoreIconTransaction

use of com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction 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 10 with StoreIconTransaction

use of com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction 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)

Aggregations

StoreIconTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction)12 Database (com.djrapitops.plan.storage.database.Database)12 ProviderInformation (com.djrapitops.plan.extension.implementation.ProviderInformation)11 StoreProviderTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction)9 Icon (com.djrapitops.plan.extension.icon.Icon)3 StoreTableProviderTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreTableProviderTransaction)2 Table (com.djrapitops.plan.extension.table.Table)2 TabInformation (com.djrapitops.plan.extension.implementation.TabInformation)1 StorePluginTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.StorePluginTransaction)1 StoreTabInformationTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.StoreTabInformationTransaction)1 ServerUUID (com.djrapitops.plan.identification.ServerUUID)1