use of org.osgi.service.upnp.UPnPLocalStateVariable in project felix by apache.
the class UPnPEventNotifier method getCurrentStatus.
private Properties getCurrentStatus() {
Properties status = new Properties();
UPnPStateVariable[] vars = service.getStateVariables();
if (vars != null) {
for (int i = 0; i < vars.length; i++) {
if (vars[i].sendsEvents()) {
if (vars[i] instanceof UPnPLocalStateVariable) {
UPnPLocalStateVariable localVar = (UPnPLocalStateVariable) vars[i];
String property = localVar.getName();
Object value = localVar.getCurrentValue();
status.put(property, value);
} else {
System.out.println("[Warning] The StateVariable (" + vars[i].getName() + ")" + " of device (ID:" + deviceId + ") " + "should implement the interface UPnPLocalStateVariable");
}
}
}
// end for
}
return status;
}
Aggregations