Search in sources :

Example 1 with UPnPLocalStateVariable

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;
}
Also used : UPnPLocalStateVariable(org.osgi.service.upnp.UPnPLocalStateVariable) UPnPStateVariable(org.osgi.service.upnp.UPnPStateVariable) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)1 UPnPLocalStateVariable (org.osgi.service.upnp.UPnPLocalStateVariable)1 UPnPStateVariable (org.osgi.service.upnp.UPnPStateVariable)1