summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-01-06 10:11:50 +0100
committerParménides GV <parmegv@sdf.org>2015-01-19 15:57:44 +0100
commita74d09929575e44f86d09283ae4633b0dcfcb566 (patch)
tree1181c9d4ed9963823354643a8dd22bf07b921130 /app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
parentdd6e5a29f40f38481dec5545ff4fe1cabd5d6384 (diff)
Extracted GatewaysManager + coded its tests
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
index daf7d4a7..0d8a2f7b 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java
@@ -20,6 +20,8 @@ import android.app.Activity;
import android.content.SharedPreferences;
import android.util.Log;
+import com.google.gson.Gson;
+
import org.json.JSONException;
import org.json.JSONObject;
@@ -40,7 +42,7 @@ import se.leap.bitmaskclient.Dashboard;
*/
public class Gateway {
- public static String TAG = Gateway.class.getSimpleName();
+ public final static String TAG = Gateway.class.getSimpleName();
private JSONObject general_configuration;
private JSONObject secrets;
@@ -53,7 +55,7 @@ public class Gateway {
* Build a gateway object from a JSON OpenVPN gateway definition in eip-service.json
* and create a VpnProfile belonging to it.
*/
- protected Gateway(JSONObject eip_definition, JSONObject secrets, JSONObject gateway){
+ public Gateway(JSONObject eip_definition, JSONObject secrets, JSONObject gateway){
this.gateway = gateway;
this.secrets = secrets;
@@ -130,4 +132,9 @@ public class Gateway {
public int getTimezone() {
return timezone;
}
+
+ @Override
+ public String toString() {
+ return new Gson().toJson(this, Gateway.class);
+ }
}