public StringBuffer register(String device) {
Device d = Device.findByDevice(device);
if(d == null) {
d = new Device(device);
} else {
d.refreshKey();
}
JConfig.log().logMessage("Registered device: " + device);
MQFactory.getConcrete("Swing").enqueue("SECURITY " + d.getString("security_key"));