From 1bceb433d3e5713fa2493d65d2dc7d7bdf29e6e0 Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 13 Jul 2011 06:29:14 +0000 Subject: [PATCH] Renamed JSONInterface to the more correct JSONRPC2Interface. --- .../jsonrpc2/client/JSONRPC2Session.java | 2 +- src/net/i2p/itoopie/Main.java | 2 +- src/net/i2p/itoopie/gui/Settings.java | 4 ++-- .../{JSONInterface.java => JSONRPC2Interface.java} | 4 ++-- src/net/i2p/itoopie/i2pcontrol/methods/Authenticate.java | 6 +++--- src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java | 6 +++--- .../i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java | 6 +++--- src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java | 6 +++--- .../i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) rename src/net/i2p/itoopie/i2pcontrol/{JSONInterface.java => JSONRPC2Interface.java} (97%) diff --git a/src/com/thetransactioncompany/jsonrpc2/client/JSONRPC2Session.java b/src/com/thetransactioncompany/jsonrpc2/client/JSONRPC2Session.java index 0e2bebe93..3d4c132e8 100644 --- a/src/com/thetransactioncompany/jsonrpc2/client/JSONRPC2Session.java +++ b/src/com/thetransactioncompany/jsonrpc2/client/JSONRPC2Session.java @@ -16,7 +16,7 @@ import javax.net.ssl.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import net.i2p.itoopie.i2pcontrol.JSONInterface; +import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface; import net.i2p.itoopie.security.CertificateHelper; import net.i2p.itoopie.security.CertificateManager; diff --git a/src/net/i2p/itoopie/Main.java b/src/net/i2p/itoopie/Main.java index d4481efff..83a949815 100644 --- a/src/net/i2p/itoopie/Main.java +++ b/src/net/i2p/itoopie/Main.java @@ -24,7 +24,7 @@ import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; import net.i2p.itoopie.configuration.ConfigurationManager; import net.i2p.itoopie.i2pcontrol.InvalidParametersException; import net.i2p.itoopie.i2pcontrol.InvalidPasswordException; -import net.i2p.itoopie.i2pcontrol.JSONInterface; +import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface; import net.i2p.itoopie.i2pcontrol.methods.GetEcho; import net.i2p.itoopie.i2pcontrol.methods.GetNetworkSetting; import net.i2p.itoopie.i2pcontrol.methods.GetRateStat; diff --git a/src/net/i2p/itoopie/gui/Settings.java b/src/net/i2p/itoopie/gui/Settings.java index df7f6b5c7..a6ea5e5f7 100644 --- a/src/net/i2p/itoopie/gui/Settings.java +++ b/src/net/i2p/itoopie/gui/Settings.java @@ -32,7 +32,7 @@ import net.i2p.itoopie.configuration.ConfigurationManager; import net.i2p.itoopie.gui.component.ProgressiveDisclosurePanel; import net.i2p.itoopie.i18n.Transl; import net.i2p.itoopie.i2pcontrol.InvalidPasswordException; -import net.i2p.itoopie.i2pcontrol.JSONInterface; +import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface; import javax.swing.BoxLayout; import java.awt.Component; @@ -220,7 +220,7 @@ public class Settings extends RegisteredFrame{ try { System.out.println("Password changed: \""+oldPW+"\"->\"" + pwText + "\""); _conf.setConf("server.password", pwText); - JSONInterface.testSettings(); + JSONRPC2Interface.testSettings(); newSettings = true; } catch (InvalidPasswordException e) { _conf.setConf("server.password", oldPW); diff --git a/src/net/i2p/itoopie/i2pcontrol/JSONInterface.java b/src/net/i2p/itoopie/i2pcontrol/JSONRPC2Interface.java similarity index 97% rename from src/net/i2p/itoopie/i2pcontrol/JSONInterface.java rename to src/net/i2p/itoopie/i2pcontrol/JSONRPC2Interface.java index 6060215f5..6dbde37f1 100644 --- a/src/net/i2p/itoopie/i2pcontrol/JSONInterface.java +++ b/src/net/i2p/itoopie/i2pcontrol/JSONRPC2Interface.java @@ -20,7 +20,7 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2Session; import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; -public class JSONInterface { +public class JSONRPC2Interface { private static Log _log; private static ConfigurationManager _conf; private static String DEFAULT_PASSWORD = "itoopie"; @@ -30,7 +30,7 @@ public class JSONInterface { private static String token; static { - _log = LogFactory.getLog(JSONInterface.class); + _log = LogFactory.getLog(JSONRPC2Interface.class); _conf = ConfigurationManager.getInstance(); Random rnd = new Random(); nonce = rnd.nextInt(); diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/Authenticate.java b/src/net/i2p/itoopie/i2pcontrol/methods/Authenticate.java index 89cdcab65..5259c07cb 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/Authenticate.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/Authenticate.java @@ -9,7 +9,7 @@ import org.apache.commons.logging.LogFactory; import net.i2p.itoopie.configuration.ConfigurationManager; import net.i2p.itoopie.i2pcontrol.InvalidParametersException; import net.i2p.itoopie.i2pcontrol.InvalidPasswordException; -import net.i2p.itoopie.i2pcontrol.JSONInterface; +import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface; import net.i2p.itoopie.i2pcontrol.UnrecoverableFailedRequestException; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; @@ -23,7 +23,7 @@ public class Authenticate { public static String execute() throws InvalidPasswordException, JSONRPC2SessionException { - JSONRPC2Request req = new JSONRPC2Request("Authenticate", JSONInterface.incrNonce()); + JSONRPC2Request req = new JSONRPC2Request("Authenticate", JSONRPC2Interface.incrNonce()); Map outParams = new HashMap(); outParams.put("Password", @@ -32,7 +32,7 @@ public class Authenticate { JSONRPC2Response resp = null; try { - resp = JSONInterface.sendReq(req); + resp = JSONRPC2Interface.sendReq(req); Map inParams = (HashMap) resp.getResult(); return (String) inParams.get("Token"); }catch (UnrecoverableFailedRequestException e) { diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java b/src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java index 55ebd018d..f24506fe6 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java @@ -8,7 +8,7 @@ import org.apache.commons.logging.LogFactory; import net.i2p.itoopie.i2pcontrol.InvalidParametersException; import net.i2p.itoopie.i2pcontrol.InvalidPasswordException; -import net.i2p.itoopie.i2pcontrol.JSONInterface; +import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface; import net.i2p.itoopie.i2pcontrol.UnrecoverableFailedRequestException; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; @@ -22,7 +22,7 @@ public class GetEcho { public static String execute(String str) throws InvalidPasswordException, JSONRPC2SessionException { - JSONRPC2Request req = new JSONRPC2Request("Echo", JSONInterface.incrNonce()); + JSONRPC2Request req = new JSONRPC2Request("Echo", JSONRPC2Interface.incrNonce()); @SuppressWarnings("rawtypes") Map params = new HashMap(); params.put("Echo", str); @@ -30,7 +30,7 @@ public class GetEcho { JSONRPC2Response resp = null; try { - resp = JSONInterface.sendReq(req); + resp = JSONRPC2Interface.sendReq(req); Map inParams = (HashMap) resp.getResult(); return (String) inParams.get("Result"); } catch (UnrecoverableFailedRequestException e) { diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java b/src/net/i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java index 460b330bc..61ad88ef9 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/GetNetworkSetting.java @@ -12,7 +12,7 @@ import org.apache.commons.logging.LogFactory; import net.i2p.itoopie.i2pcontrol.InvalidParametersException; import net.i2p.itoopie.i2pcontrol.InvalidPasswordException; -import net.i2p.itoopie.i2pcontrol.JSONInterface; +import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface; import net.i2p.itoopie.i2pcontrol.UnrecoverableFailedRequestException; import net.i2p.itoopie.i2pcontrol.methods.NetworkInfo.NETWORK_INFO; @@ -26,7 +26,7 @@ public class GetNetworkSetting { public static HashMap execute(NETWORK_INFO ... options) throws InvalidPasswordException, JSONRPC2SessionException{ - JSONRPC2Request req = new JSONRPC2Request("NetworkSetting", JSONInterface.incrNonce()); + JSONRPC2Request req = new JSONRPC2Request("NetworkSetting", JSONRPC2Interface.incrNonce()); @SuppressWarnings("rawtypes") Map outParams = new HashMap(); List list = Arrays.asList(options); @@ -39,7 +39,7 @@ public class GetNetworkSetting { JSONRPC2Response resp = null; try { - resp = JSONInterface.sendReq(req); + resp = JSONRPC2Interface.sendReq(req); HashMap map = (HashMap) resp.getResult(); if (map != null){ Set set = map.entrySet(); diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java b/src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java index 17ac33672..f03536ff8 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/GetRateStat.java @@ -8,7 +8,7 @@ import org.apache.commons.logging.LogFactory; import net.i2p.itoopie.i2pcontrol.InvalidParametersException; import net.i2p.itoopie.i2pcontrol.InvalidPasswordException; -import net.i2p.itoopie.i2pcontrol.JSONInterface; +import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface; import net.i2p.itoopie.i2pcontrol.UnrecoverableFailedRequestException; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; @@ -22,7 +22,7 @@ public class GetRateStat{ public static Double execute(String stat, long period) throws InvalidPasswordException, JSONRPC2SessionException, InvalidParametersException { - JSONRPC2Request req = new JSONRPC2Request("GetRate", JSONInterface.incrNonce()); + JSONRPC2Request req = new JSONRPC2Request("GetRate", JSONRPC2Interface.incrNonce()); @SuppressWarnings("rawtypes") Map params = new HashMap(); params.put("Stat", stat); @@ -31,7 +31,7 @@ public class GetRateStat{ JSONRPC2Response resp = null; try { - resp = JSONInterface.sendReq(req); + resp = JSONRPC2Interface.sendReq(req); HashMap inParams = (HashMap) resp.getResult(); Double dbl = (Double) inParams.get("Result"); return dbl; diff --git a/src/net/i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java b/src/net/i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java index 5e969d087..cf87b0c38 100644 --- a/src/net/i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java +++ b/src/net/i2p/itoopie/i2pcontrol/methods/SetNetworkSetting.java @@ -10,7 +10,7 @@ import org.apache.commons.logging.LogFactory; import net.i2p.itoopie.i2pcontrol.InvalidParametersException; import net.i2p.itoopie.i2pcontrol.InvalidPasswordException; -import net.i2p.itoopie.i2pcontrol.JSONInterface; +import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface; import net.i2p.itoopie.i2pcontrol.UnrecoverableFailedRequestException; import net.i2p.itoopie.i2pcontrol.methods.NetworkInfo.NETWORK_INFO; @@ -25,7 +25,7 @@ public class SetNetworkSetting { public static HashMap execute(Map settings) throws InvalidPasswordException, JSONRPC2SessionException, InvalidParametersException{ - JSONRPC2Request req = new JSONRPC2Request("NetworkSetting", JSONInterface.incrNonce()); + JSONRPC2Request req = new JSONRPC2Request("NetworkSetting", JSONRPC2Interface.incrNonce()); Map outParams = new HashMap(); @@ -39,7 +39,7 @@ public class SetNetworkSetting { JSONRPC2Response resp = null; try { - resp = JSONInterface.sendReq(req); + resp = JSONRPC2Interface.sendReq(req); HashMap map = (HashMap) resp.getResult(); return map; } catch (UnrecoverableFailedRequestException e) {