public DeviceAttribute readAttribute(String name) { return this.find(new DeviceAttribute(name, null)); }
public String getOs() { DeviceAttribute osAttr = this.readAttribute("os"); if(osAttr != null) { return osAttr.getValue(); } return null; }
public String getDeviceToken() { DeviceAttribute attr = this.readAttribute("device-token"); if(attr != null) { return attr.getValue(); } return null; } //-------------------------------------------------------------------------------------------------------
if(device != null && device.getIdentity().isActive()) String storedNonce = device.readAttribute("nonce").getValue();
DeviceAttribute osAttribute = new DeviceAttribute("os",os); DeviceAttribute versionAttribute = new DeviceAttribute("version",version); toBeUpdated.updateAttribute(osAttribute); toBeUpdated.updateAttribute(versionAttribute);
String storedNonce = device.readAttribute("nonce").getValue();
this.identityController.update(identity); device.updateAttribute(new DeviceAttribute("nonce", authenticationHash)); this.deviceController.update(device);
String storedNonce = device.readAttribute("nonce").getValue();
DeviceAttribute tokenAttr = new DeviceAttribute("device-token",deviceToken); device.updateAttribute(tokenAttr); this.deviceController.update(device);
device.addAttribute(new DeviceAttribute("nonce", registeredIdentity.getCredential())); device.updateAttribute(new DeviceAttribute("nonce", registeredIdentity.getCredential())); this.deviceController.update(device);