Don't push vault version to metrics.

This commit is contained in:
KHobbits 2012-03-30 13:27:57 +01:00
parent f3345247ed
commit e795c6ed0b
10 changed files with 70 additions and 9 deletions

View file

@ -24,7 +24,7 @@ public class EssentialsPluginListener implements Listener, IConf
ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin());
if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(ess.getServer().getPluginManager()))
{
ess.getLogger().log(Level.INFO, "Payment method found (" + ess.getPaymentMethod().getMethod().getName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")");
ess.getLogger().log(Level.INFO, "Payment method found (" + ess.getPaymentMethod().getMethod().getLongName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")");
}
}

View file

@ -4,6 +4,7 @@ import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.metrics.Metrics.Graph;
import com.earth2me.essentials.metrics.Metrics.Plotter;
import com.earth2me.essentials.register.payment.Method;
import com.earth2me.essentials.register.payment.methods.VaultEco;
import java.util.Locale;
import java.util.logging.Level;
@ -150,11 +151,18 @@ public class MetricsStarter implements Runnable
final Method method = ess.getPaymentMethod().getMethod();
if (method != null)
{
String version = method.getVersion();
final int dashPosition = version.indexOf('-');
if (dashPosition > 0)
{
version = version.substring(0, dashPosition);
String version;
if (method instanceof VaultEco) {
version = ((VaultEco)method).getEconomy();
}
else {
version = method.getVersion();
final int dashPosition = version.indexOf('-');
if (dashPosition > 0)
{
version = version.substring(0, dashPosition);
}
}
depGraph.addPlotter(new SimplePlotter(method.getName() + " " + version));
}

View file

@ -33,6 +33,13 @@ public interface Method
* @return <code>String</code> Plugin name.
*/
public String getName();
/**
* Returns the reported name of this method.
*
* @return <code>String</code> Plugin name.
*/
public String getLongName();
/**
* Returns the actual version of this method.

View file

@ -28,6 +28,12 @@ public class BOSE6 implements Method
{
return "BOSEconomy";
}
@Override
public String getLongName()
{
return getName();
}
@Override
public String getVersion()

View file

@ -28,6 +28,12 @@ public class BOSE7 implements Method
{
return "BOSEconomy";
}
@Override
public String getLongName()
{
return getName();
}
@Override
public String getVersion()

View file

@ -28,6 +28,12 @@ public class MCUR implements Method
{
return "MultiCurrency";
}
@Override
public String getLongName()
{
return getName();
}
@Override
public String getVersion()

View file

@ -34,8 +34,18 @@ public class VaultEco implements Method
@Override
public String getName()
{
return this.vault.getDescription().getName().concat(" - Economy: ").concat(economy == null ? "NoEco" : economy.getName());
return this.vault.getDescription().getName();
}
public String getEconomy()
{
return economy == null ? "NoEco" : economy.getName();
}
@Override
public String getLongName()
{
return getName().concat(" - Economy: ").concat(getEconomy());
}
@Override

View file

@ -28,7 +28,13 @@ public class iCo4 implements Method
{
return "iConomy";
}
@Override
public String getLongName()
{
return getName();
}
@Override
public String getVersion()
{

View file

@ -31,6 +31,12 @@ public class iCo5 implements Method
{
return "iConomy";
}
@Override
public String getLongName()
{
return getName();
}
@Override
public String getVersion()

View file

@ -30,6 +30,12 @@ public class iCo6 implements Method
{
return "iConomy";
}
@Override
public String getLongName()
{
return getName();
}
@Override
public String getVersion()