|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sbbi.upnp.jmx.UPNPDiscovery
public class UPNPDiscovery
MBean to discover UPNP devices on the network and register the devices service as UPNPServiceMBean objects during the MBean registration. The registered UPNPServiceMBean will also be automatically unregistered when the device is leaving the network ( if notifySSDPEvents constructor param is set to true ) or when the UPNPDiscoveryMBean is unregistered from teh MBeans server.
| Field Summary |
|---|
| Fields inherited from interface net.sbbi.upnp.jmx.UPNPDiscoveryMBean |
|---|
SSDP_ALIVE_NOTIFICATION, SSDP_BYEBYE_NOTIFICATION |
| Constructor Summary | |
|---|---|
UPNPDiscovery(int discoveryTimeout,
boolean notifySSDPEvents,
boolean registerChildDevices)
Main constructor, will discover all devices types |
|
UPNPDiscovery(String[] searchTargets,
int discoveryTimeout,
boolean notifySSDPEvents,
boolean registerChildDevices)
Discover devices of a given type |
|
UPNPDiscovery(String searchTargets,
int discoveryTimeout,
boolean notifySSDPEvents,
boolean registerChildDevices)
Discover devices of a given type |
|
| Method Summary | |
|---|---|
void |
addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
Object callback)
|
void |
discoverDevices(int timeout)
|
void |
eventSSDPAlive(String usn,
String udn,
String nt,
String maxAge,
URL location)
Called when a device joins the network or advertise it is still alive |
void |
eventSSDPByeBye(String usn,
String udn,
String nt)
Called when a device is leaving the network |
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
|
javax.management.ObjectName[] |
getRegisteredUPNPServiceMBeans(String deviceUDN)
Computes an array of object names of registered UPNPServiceMBeans for a given UPNP device UDN |
String[] |
getRegisteredUPNPServiceMBeansUDNs()
The list of registered devices UDN, the returned UDN can be used with the getRegisteredUPNPServiceMBeans(String deviceUDN) method to retreive UDN bound UPNPServiceMBean object names |
Set |
getSearchTargets()
The registered devices search targets |
void |
postDeregister()
|
void |
postRegister(Boolean arg0)
|
void |
preDeregister()
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName objectname)
|
void |
removeNotificationListener(javax.management.NotificationListener listener)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UPNPDiscovery(int discoveryTimeout,
boolean notifySSDPEvents,
boolean registerChildDevices)
discoveryTimeout - devices discoverytimeout in MS, 0 for default timeout,
increase this value if devices are not respondingnotifySSDPEvents - boolean to indicate if the MBean should broadcast JMX UPNPDiscoveryNotifications when an matching
device is joining or leaving the network.registerChildDevices - when set to true, discovered device child devices services will also be exposed as
UPNPServiceMBean objects
public UPNPDiscovery(String searchTargets,
int discoveryTimeout,
boolean notifySSDPEvents,
boolean registerChildDevices)
searchTargets - a list of devices types URI (I.E : urn:schemas-upnp-org:device:WANDevice:1) that should be handled, list delimited by commasdiscoveryTimeout - devices discoverytimeout in MS, 0 for default timeout,
increase this value if devices are not respondingnotifySSDPEvents - boolean to indicate if the MBean should broadcast JMX UPNPDiscoveryNotifications when an matching
device is joining or leaving the networkregisterChildDevices - when set to true, discovered device child devices services will also be exposed as
UPNPServiceMBean objects
public UPNPDiscovery(String[] searchTargets,
int discoveryTimeout,
boolean notifySSDPEvents,
boolean registerChildDevices)
searchTargets - a list of devices types URI (I.E : urn:schemas-upnp-org:device:WANDevice:1) that should be handled.
All discovered device children services will also be automatically registered as UPNPServiceMBean.discoveryTimeout - devices discoverytimeout in MS, 0 for default timeout,
increase this value if devices are not respondingnotifySSDPEvents - boolean to indicate if the MBean should broadcast JMX UPNPDiscoveryNotifications when an matching
device is joining or leaving the networkregisterChildDevices - when set to true, discovered device child devices services will also be exposed as
UPNPServiceMBean objects| Method Detail |
|---|
public javax.management.ObjectName[] getRegisteredUPNPServiceMBeans(String deviceUDN)
throws javax.management.MalformedObjectNameException
getRegisteredUPNPServiceMBeans in interface UPNPDiscoveryMBeandeviceUDN - the UPNP device UDN ( unique id on the network )
javax.management.MalformedObjectNameException - if an object name cannot be computed for an UPNPServiceMBeanpublic String[] getRegisteredUPNPServiceMBeansUDNs()
getRegisteredUPNPServiceMBeansUDNs in interface UPNPDiscoveryMBeanpublic Set getSearchTargets()
getSearchTargets in interface UPNPDiscoveryMBean
public void addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
Object callback)
throws IllegalArgumentException
addNotificationListener in interface javax.management.NotificationBroadcasterIllegalArgumentExceptionpublic javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface javax.management.NotificationBroadcaster
public void removeNotificationListener(javax.management.NotificationListener listener)
throws javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.NotificationBroadcasterjavax.management.ListenerNotFoundExceptionpublic void postDeregister()
postDeregister in interface javax.management.MBeanRegistrationpublic void postRegister(Boolean arg0)
postRegister in interface javax.management.MBeanRegistration
public void preDeregister()
throws Exception
preDeregister in interface javax.management.MBeanRegistrationException
public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName objectname)
throws Exception
preRegister in interface javax.management.MBeanRegistrationException
public void eventSSDPAlive(String usn,
String udn,
String nt,
String maxAge,
URL location)
DiscoveryEventHandler
eventSSDPAlive in interface DiscoveryEventHandlerusn - the device USN (udn::nt)udn - the device UDNnt - the device NTmaxAge - the device maxAgelocation - the device location
public void eventSSDPByeBye(String usn,
String udn,
String nt)
DiscoveryEventHandler
eventSSDPByeBye in interface DiscoveryEventHandlerusn - the device USN (udn::nt)udn - the device UDNnt - the device NT
public void discoverDevices(int timeout)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||