public static String getDeviceId(Envelope event) {
   device deviceExt = (device) event.getExt().get("device");
   return deviceExt.getLocalId();
 }
 public static void setDeviceId(Envelope event, String value) {
   device deviceExt = (device) event.getExt().get("device");
   deviceExt.setLocalId(value);
   event.getExt().put("device", deviceExt);
 }