Interface UPnPEventListener
-
public interface UPnPEventListener
UPnP Events are mapped and delivered to applications according to the OSGi whiteboard model. An application that wishes to be notified of events generated by a particular UPnP Device registers a service extending this interface.The notification call from the UPnP Service to any
UPnPEventListener
object must be done asynchronous with respect to the originator (in a separate thread).Upon registration of the UPnP Event Listener service with the Framework, the service is notified for each variable which it listens for with an initial event containing the current value of the variable. Subsequent notifications only happen on changes of the value of the variable.
A UPnP Event Listener service filter the events it receives. This event set is limited using a standard framework filter expression which is specified when the listener service is registered.
The filter is specified in a property named "upnp.filter" and has as a value an object of type
org.osgi.framework.Filter
.When the Filter is evaluated, the following keywords are recognized as defined as literal constants in the
UPnPDevice
class.The valid subset of properties for the registration of UPnP Event Listener services are:
UPnPDevice.TYPE
-- Which type of device to listen for events.UPnPDevice.ID
-- The ID of a specific device to listen for events.UPnPService.TYPE
-- The type of a specific service to listen for events.UPnPService.ID
-- The ID of a specific service to listen for events.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
UPNP_FILTER
Key for a service property having a value that is an object of typeorg.osgi.framework.Filter
and that is used to limit received events.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
notifyUPnPEvent(java.lang.String deviceId, java.lang.String serviceId, java.util.Dictionary<java.lang.String,?> events)
Callback method that is invoked for received events.
-
-
-
Field Detail
-
UPNP_FILTER
static final java.lang.String UPNP_FILTER
Key for a service property having a value that is an object of typeorg.osgi.framework.Filter
and that is used to limit received events.- See Also:
- Constant Field Values
-
-
Method Detail
-
notifyUPnPEvent
void notifyUPnPEvent(java.lang.String deviceId, java.lang.String serviceId, java.util.Dictionary<java.lang.String,?> events)
Callback method that is invoked for received events. The events are collected in aDictionary
object. Each entry has aString
key representing the event name (= state variable name) and the new value of the state variable. The class of the value object must match the class specified by the UPnP State Variable associated with the event. This method must be called asynchronously- Parameters:
deviceId
- ID of the device sending the eventsserviceId
- ID of the service sending the eventsevents
-Dictionary
object containing the new values for the state variables that have changed.
-
-