private void sendPushNotification(String deviceId,String message, Map<String,String> extras) throws Exception Device device = this.deviceController.read(deviceId);
log.debug("App: "+app); Device device = deviceController.read(deviceId); if(device == null)
private void sendSyncNotification(String deviceId, String channel) throws Exception { //Get the Device Token of the device that should receive the push notification Device device = this.deviceController.read(deviceId); //Find PushApps on this device List<PushApp> pushApps = this.findDevicePushApps(deviceId); //Remove Apps that are not interested in this channel/notification this.disqualifyApps(pushApps, channel); //actually send the push this.push(device, pushApps, "You have new information", null); }
public Device getDevice() { if(this.subscription == null || this.subscription.getClientId() == null) { return null; } return DeviceController.getInstance().read(this.subscription.getClientId()); }
@Override public void onEvent(Event event) { Device device = (Device)event.getAttribute("new-device"); if(device != null) { log.debug("***************************************************************"); log.debug("Updating the device cache with a new device: "+this.channelRegistration.getUri()); log.debug("***************************************************************"); //add this device to the cache device = this.deviceController.read(device.getIdentifier()); this.allDevices.add(device); } else { //Check for a device-cache-invalidation event Boolean invalidateDeviceCache = (Boolean)event.getAttribute("invalidate-device-cache"); if(invalidateDeviceCache != null) { //A device cache invalidation event received log.debug("***************************************************************"); log.debug("Invalidating the device cache: "+this.channelRegistration.getUri()); log.debug("***************************************************************"); this.loadDevices(); } } }
Device device = deviceController.read(deviceId);
log.debug("--------------------------------------------"); Device toBeUpdated = this.deviceController.read(deviceId); DeviceAttribute osAttribute = new DeviceAttribute("os",os); DeviceAttribute versionAttribute = new DeviceAttribute("version",version);
log.debug("Incoming Nonce: "+nonce); Device device = deviceController.read(deviceId); if(device != null && device.getIdentity().isActive())
Device device = deviceController.read(deviceId);
Device device = this.deviceController.read(deviceToNotify); String os = device.getOs(); Device device = this.deviceController.read(deviceToNotify); String os = device.getOs(); Device device = this.deviceController.read(deviceToNotify); String os = device.getOs(); Device device = this.deviceController.read(deviceToNotify); String os = device.getOs();
Device device = deviceController.read(deviceId); String storedNonce = device.readAttribute("nonce").getValue();
Device device = this.deviceController.read(deviceIdentifier); device.setIdentity(registeredIdentity); device.updateAttribute(new DeviceAttribute("nonce", registeredIdentity.getCredential()));