if (newValue.getStateVariable().isModeratedNumericType()) { lastSentNumericValue.put(name, Long.valueOf(newValue.toString()));
public LocalGENASubscription(LocalService service, Integer requestedDurationSeconds, List<URL> callbackURLs) throws Exception { super(service); setSubscriptionDuration(requestedDurationSeconds); log.fine("Reading initial state of local service at subscription time"); long currentTime = new Date().getTime(); this.currentValues.clear(); Collection<StateVariableValue> values = getService().getManager().getCurrentState(); log.finer("Got evented state variable values: " + values.size()); for (StateVariableValue value : values) { this.currentValues.put(value.getStateVariable().getName(), value); if (log.isLoggable(Level.FINEST)) { log.finer("Read state variable value '" + value.getStateVariable().getName() + "': " + value.toString()); } // Preserve "last sent" state for future moderation lastSentTimestamp.put(value.getStateVariable().getName(), currentTime); if (value.getStateVariable().isModeratedNumericType()) { lastSentNumericValue.put(value.getStateVariable().getName(), Long.valueOf(value.toString())); } } this.subscriptionId = SubscriptionIdHeader.PREFIX + UUID.randomUUID(); this.currentSequence = new UnsignedIntegerFourBytes(0); this.callbackURLs = callbackURLs; }
if (stateVariable.isModeratedNumericType() && lastSentNumericValue.get(stateVariableName) != null) {
if (newValue.getStateVariable().isModeratedNumericType()) { lastSentNumericValue.put(name, Long.valueOf(newValue.toString()));
public LocalGENASubscription(LocalService service, Integer requestedDurationSeconds, List<URL> callbackURLs) throws Exception { super(service); setSubscriptionDuration(requestedDurationSeconds); log.fine("Reading initial state of local service at subscription time"); long currentTime = new Date().getTime(); this.currentValues.clear(); Collection<StateVariableValue> values = getService().getManager().getCurrentState(); log.finer("Got evented state variable values: " + values.size()); for (StateVariableValue value : values) { this.currentValues.put(value.getStateVariable().getName(), value); if (log.isLoggable(Level.FINEST)) { log.finer("Read state variable value '" + value.getStateVariable().getName() + "': " + value.toString()); } // Preserve "last sent" state for future moderation lastSentTimestamp.put(value.getStateVariable().getName(), currentTime); if (value.getStateVariable().isModeratedNumericType()) { lastSentNumericValue.put(value.getStateVariable().getName(), Long.valueOf(value.toString())); } } this.subscriptionId = SubscriptionIdHeader.PREFIX + UUID.randomUUID(); this.currentSequence = new UnsignedIntegerFourBytes(0); this.callbackURLs = callbackURLs; }
if (stateVariable.isModeratedNumericType() && lastSentNumericValue.get(stateVariableName) != null) {
if (newValue.getStateVariable().isModeratedNumericType()) { lastSentNumericValue.put(name, Long.valueOf(newValue.toString()));
public LocalGENASubscription(LocalService service, Integer requestedDurationSeconds, List<URL> callbackURLs) throws Exception { super(service); setSubscriptionDuration(requestedDurationSeconds); log.fine("Reading initial state of local service at subscription time"); long currentTime = new Date().getTime(); this.currentValues.clear(); Collection<StateVariableValue> values = getService().getManager().getCurrentState(); log.finer("Got evented state variable values: " + values.size()); for (StateVariableValue value : values) { this.currentValues.put(value.getStateVariable().getName(), value); if (log.isLoggable(Level.FINEST)) { log.finer("Read state variable value '" + value.getStateVariable().getName() + "': " + value.toString()); } // Preserve "last sent" state for future moderation lastSentTimestamp.put(value.getStateVariable().getName(), currentTime); if (value.getStateVariable().isModeratedNumericType()) { lastSentNumericValue.put(value.getStateVariable().getName(), Long.valueOf(value.toString())); } } this.subscriptionId = SubscriptionIdHeader.PREFIX + UUID.randomUUID(); this.currentSequence = new UnsignedIntegerFourBytes(0); this.callbackURLs = callbackURLs; }
if (stateVariable.isModeratedNumericType() && lastSentNumericValue.get(stateVariableName) != null) {