Search in sources :

Example 1 with ExtensionDataBuilder

use of com.djrapitops.plan.extension.builder.ExtensionDataBuilder in project Plan by plan-player-analytics.

the class DataValueGatherer method updateValues.

public void updateValues(UUID playerUUID, String playerName) {
    Parameters parameters = Parameters.player(serverInfo.getServerUUID(), playerUUID, playerName);
    ExtensionDataBuilder dataBuilder = extension.getExtension().newExtensionDataBuilder();
    addValuesToBuilder(dataBuilder, extension.getMethods().get(ExtensionMethod.ParameterType.PLAYER_STRING), parameters);
    addValuesToBuilder(dataBuilder, extension.getMethods().get(ExtensionMethod.ParameterType.PLAYER_UUID), parameters);
    gatherPlayer(parameters, (ExtDataBuilder) dataBuilder);
    dbSystem.getDatabase().executeTransaction(new RemoveInvalidResultsTransaction(extension.getPluginName(), serverInfo.getServerUUID(), ((ExtDataBuilder) dataBuilder).getInvalidatedValues()));
}
Also used : Parameters(com.djrapitops.plan.extension.implementation.providers.Parameters) ExtensionDataBuilder(com.djrapitops.plan.extension.builder.ExtensionDataBuilder)

Example 2 with ExtensionDataBuilder

use of com.djrapitops.plan.extension.builder.ExtensionDataBuilder in project Plan by plan-player-analytics.

the class DataValueGatherer method updateValues.

public void updateValues() {
    Parameters parameters = Parameters.server(serverInfo.getServerUUID());
    ExtensionDataBuilder dataBuilder = extension.getExtension().newExtensionDataBuilder();
    addValuesToBuilder(dataBuilder, extension.getMethods().get(ExtensionMethod.ParameterType.SERVER_NONE), parameters);
    gather(parameters, (ExtDataBuilder) dataBuilder);
}
Also used : Parameters(com.djrapitops.plan.extension.implementation.providers.Parameters) ExtensionDataBuilder(com.djrapitops.plan.extension.builder.ExtensionDataBuilder)

Example 3 with ExtensionDataBuilder

use of com.djrapitops.plan.extension.builder.ExtensionDataBuilder in project Plan by plan-player-analytics.

the class DataValueGatherer method addDataFromAnotherBuilder.

private void addDataFromAnotherBuilder(ExtensionDataBuilder dataBuilder, Parameters parameters, ExtensionMethod provider) {
    try {
        ExtensionDataBuilder providedBuilder = callMethod(provider, parameters, ExtensionDataBuilder.class);
        dataBuilder.addAll(providedBuilder);
    } catch (DataExtensionMethodCallException methodError) {
        logFailure(methodError);
    } catch (Exception | NoClassDefFoundError | NoSuchFieldError | NoSuchMethodError unexpectedError) {
        logFailure(unexpectedError);
    }
}
Also used : ExtensionDataBuilder(com.djrapitops.plan.extension.builder.ExtensionDataBuilder) DataExtensionMethodCallException(com.djrapitops.plan.exceptions.DataExtensionMethodCallException) DataExtensionMethodCallException(com.djrapitops.plan.exceptions.DataExtensionMethodCallException)

Aggregations

ExtensionDataBuilder (com.djrapitops.plan.extension.builder.ExtensionDataBuilder)3 Parameters (com.djrapitops.plan.extension.implementation.providers.Parameters)2 DataExtensionMethodCallException (com.djrapitops.plan.exceptions.DataExtensionMethodCallException)1