Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added ability to link a serial number to user
Here you go amiee!
  • Loading branch information
dep11007 committed May 1, 2015
1 parent 07b3d4d commit a3185f0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Binary file modified bin/thermostat/ThermostatDevice.class
Binary file not shown.
Binary file modified out/MAIN.jar
Binary file not shown.
5 changes: 4 additions & 1 deletion src/InputOutput/Database.java
Expand Up @@ -58,7 +58,10 @@ public class Database extends DataStructure implements Thermostatable, Serializa
public String getDevicesFromEmail(String email){
return this.getUserFromEmail(email).get("devices");
}


public void giveUserAccessToDeviceByEmailAndSerialNumber(String email, String serialNumber){
this.updateTable("UserTable", email, "devices", serialNumber);
}

@Override
public void datastructureLogEvent(String query) {
Expand Down
5 changes: 4 additions & 1 deletion src/server/server.java
Expand Up @@ -41,9 +41,12 @@ public class server extends ServerNetworking implements Thermostatable, Serializ
String adminPassword = "admin";
String ip = "127.0.0.1";
String email = "admin@uconn.edu";
String serialNumber = "1.1";
String serialNumber = "00000011TEST";

dataStorage = new Database(this);
dataStorage.createUser(email, adminPassword, ip, serialNumber);
dataStorage.giveUserAccessToDeviceByEmailAndSerialNumber(email, serialNumber);
System.out.println(dataStorage.getDevicesFromEmail("admin@uconn.edu"));
this.startServerListenerThreadCurrentTemp();
dataStorage.printStruct();
instance = this;
Expand Down

0 comments on commit a3185f0

Please sign in to comment.