class CloudComm {
+ String hostname;
String baseurl;
Cipher encryptCipher;
Cipher decryptCipher;
/**
* Constructor for actual use. Takes in the url and password.
*/
- CloudComm(Table _table, String _baseurl, String _password) {
+ CloudComm(Table _table, String _hostname, String _baseurl, String _password) {
this.table = _table;
+ this.hostname = _hostname;
this.baseurl = _baseurl;
this.password = _password;
this.random = new SecureRandom();
}
}
+ public boolean hasConnection() {
+ try {
+ InetAddress address = InetAddress.getByName(hostname);
+ return address.isReachable(TIMEOUT_MILLIS);
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
/**
* Method that actually handles building Slot objects from the
* server response. Shared by both putSlot and getSlots.
dis.close();
return slots;
}
+
+
+
+
}