org.jlot.client.executor.StatsPushCommandExecutor Maven / Gradle / Ivy
package org.jlot.client.executor;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.inject.Inject;
import org.jlot.client.configuration.ProjectConfiguration;
import org.jlot.client.executor.spi.AbstractCommandExecutor;
import org.jlot.client.remote.StatsPushRestCommand;
import org.jlot.client.remote.rest.RestException;
import org.jlot.core.form.StatsForm;
import org.jlot.core.utils.VersionResolver;
import org.springframework.stereotype.Component;
@Component
public class StatsPushCommandExecutor extends AbstractCommandExecutor
{
public static final String PROPERTY_KEY_LOCALE = "locale";
@Inject
private ProjectConfiguration projectConfiguration;
@Inject
private StatsPushRestCommand statsPushRestCommand;
@Inject
private VersionResolver versionResolver;
@Override
public boolean executeInternal ( Properties properties ) throws RestException
{
Map map = new HashMap<>();
StatsForm form = new StatsForm();
form.setJlotClientVersion(versionResolver.getJlotVersionName());
form.setProjectName(projectConfiguration.getProjectName());
form.setTokenStats(map);
statsPushRestCommand.execute(form);
return true;
}
}