Search in sources :

Example 1 with ProviderInformation

use of com.djrapitops.plan.extension.implementation.ProviderInformation in project Plan by plan-player-analytics.

the class DataValueGatherer method storeBoolean.

private void storeBoolean(Parameters parameters, Conditions conditions, BooleanDataValue data) {
    ProviderInformation information = data.getInformation();
    Boolean value = getValue(conditions, data, information);
    if (value == null)
        return;
    if (value) {
        conditions.conditionFulfilled(information.getProvidedCondition());
    } else {
        conditions.conditionFulfilled("not_" + information.getProvidedCondition());
    }
    Database db = dbSystem.getDatabase();
    db.executeTransaction(new StoreIconTransaction(information.getIcon()));
    db.executeTransaction(new StoreProviderTransaction(information, parameters));
    db.executeTransaction(new StoreServerBooleanResultTransaction(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 2 with ProviderInformation

use of com.djrapitops.plan.extension.implementation.ProviderInformation in project Plan by plan-player-analytics.

the class DataValueGatherer method storePlayerGroups.

private void storePlayerGroups(Parameters parameters, Conditions conditions, GroupsDataValue 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 StorePlayerGroupsResultTransaction(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 3 with ProviderInformation

use of com.djrapitops.plan.extension.implementation.ProviderInformation in project Plan by plan-player-analytics.

the class DataValueGatherer method storePlayerBoolean.

private void storePlayerBoolean(Parameters parameters, Conditions conditions, BooleanDataValue data) {
    ProviderInformation information = data.getInformation();
    Boolean value = getValue(conditions, data, information);
    if (value == null)
        return;
    if (value) {
        conditions.conditionFulfilled(information.getProvidedCondition());
    } else {
        conditions.conditionFulfilled("not_" + information.getProvidedCondition());
    }
    Database db = dbSystem.getDatabase();
    db.executeTransaction(new StoreIconTransaction(information.getIcon()));
    db.executeTransaction(new StoreProviderTransaction(information, parameters));
    db.executeTransaction(new StorePlayerBooleanResultTransaction(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 4 with ProviderInformation

use of com.djrapitops.plan.extension.implementation.ProviderInformation in project Plan by plan-player-analytics.

the class DataValueGatherer method storeNumber.

private void storeNumber(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 StoreServerNumberResultTransaction(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 5 with ProviderInformation

use of com.djrapitops.plan.extension.implementation.ProviderInformation in project Plan by plan-player-analytics.

the class DataValueGatherer method storePlayerTable.

private void storePlayerTable(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 StorePlayerTableResultTransaction(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)

Aggregations

ProviderInformation (com.djrapitops.plan.extension.implementation.ProviderInformation)11 StoreIconTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.StoreIconTransaction)11 Database (com.djrapitops.plan.storage.database.Database)11 StoreProviderTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction)9 Icon (com.djrapitops.plan.extension.icon.Icon)2 StoreTableProviderTransaction (com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreTableProviderTransaction)2 Table (com.djrapitops.plan.extension.table.Table)2