private void sendPushNotification(String deviceId,String message, Map<String,String> extras) throws Exception Device device = this.deviceController.read(deviceId);
DeviceController deviceController = DeviceController.getInstance(); Device device = deviceController.read(deviceId); this.deviceController.update(device);
DeviceController deviceController = DeviceController.getInstance(); Set<Device> devices = deviceController.readByIdentity(to); if(devices == null || devices.isEmpty())
public Device getDevice() { if(this.subscription == null || this.subscription.getClientId() == null) { return null; } return DeviceController.getInstance().read(this.subscription.getClientId()); }
DeviceController deviceController = DeviceController.getInstance(); log.debug("App: "+app); Device device = deviceController.read(deviceId); if(device == null) Set<Device> allDevices = deviceController.readByIdentity(registeredUser.getPrincipal()); if(allDevices == null || allDevices.isEmpty())
if(!this.deviceController.exists(deviceIdentifier)) this.deviceController.create(device); Device device = this.deviceController.read(deviceIdentifier); device.setIdentity(registeredIdentity); device.updateAttribute(new DeviceAttribute("nonce", registeredIdentity.getCredential())); this.deviceController.update(device);
log.debug("--------------------------------------------"); Device toBeUpdated = this.deviceController.read(deviceId); DeviceAttribute osAttribute = new DeviceAttribute("os",os); DeviceAttribute versionAttribute = new DeviceAttribute("version",version); toBeUpdated.updateAttribute(versionAttribute); this.deviceController.update(toBeUpdated);
List<Device> allDevices = this.deviceController.readAll(); if(allDevices != null)
this.deviceController.update(device);
try this.allDevices = this.deviceController.readAll();
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); }
DeviceController deviceController = DeviceController.getInstance(); Set<Device> devices = deviceController.readByIdentity(identity); if(devices == null || devices.isEmpty())
@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(); } } }
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();