|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sbbi.upnp.jmx.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(java.lang.String[] searchTargets,
int discoveryTimeout,
boolean notifySSDPEvents,
boolean registerChildDevices)
Discover devices of a given type |
|
UPNPDiscovery(java.lang.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,
java.lang.Object callback)
|
void |
discoverDevices(int timeout)
|
void |
eventSSDPAlive(java.lang.String usn,
java.lang.String udn,
java.lang.String nt,
java.lang.String maxAge,
java.net.URL location)
Called when a device joins the network or advertise it is still alive |
void |
eventSSDPByeBye(java.lang.String usn,
java.lang.String udn,
java.lang.String nt)
Called when a device is leaving the network |
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
|
javax.management.ObjectName[] |
getRegisteredUPNPServiceMBeans(java.lang.String deviceUDN)
Computes an array of object names of registered UPNPServiceMBeans for a given UPNP device UDN |
java.lang.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 |
java.util.Set |
getSearchTargets()
The registered devices search targets |
void |
postDeregister()
|
void |
postRegister(java.lang.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 |
equals, 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 objectspublic UPNPDiscovery(java.lang.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 objectspublic UPNPDiscovery(java.lang.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 objectsMethod Detail |
public javax.management.ObjectName[] getRegisteredUPNPServiceMBeans(java.lang.String deviceUDN) throws javax.management.MalformedObjectNameException
getRegisteredUPNPServiceMBeans
in interface UPNPDiscoveryMBean
deviceUDN
- the UPNP device UDN ( unique id on the network )
javax.management.MalformedObjectNameException
- if an object name cannot be computed for an UPNPServiceMBeanpublic java.lang.String[] getRegisteredUPNPServiceMBeansUDNs()
getRegisteredUPNPServiceMBeansUDNs
in interface UPNPDiscoveryMBean
public java.util.Set getSearchTargets()
getSearchTargets
in interface UPNPDiscoveryMBean
public void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object callback) throws java.lang.IllegalArgumentException
addNotificationListener
in interface javax.management.NotificationBroadcaster
java.lang.IllegalArgumentException
public 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.NotificationBroadcaster
javax.management.ListenerNotFoundException
public void postDeregister()
postDeregister
in interface javax.management.MBeanRegistration
public void postRegister(java.lang.Boolean arg0)
postRegister
in interface javax.management.MBeanRegistration
public void preDeregister() throws java.lang.Exception
preDeregister
in interface javax.management.MBeanRegistration
java.lang.Exception
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName objectname) throws java.lang.Exception
preRegister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void eventSSDPAlive(java.lang.String usn, java.lang.String udn, java.lang.String nt, java.lang.String maxAge, java.net.URL location)
DiscoveryEventHandler
eventSSDPAlive
in interface DiscoveryEventHandler
usn
- the device USN (udn::nt)udn
- the device UDNnt
- the device NTmaxAge
- the device maxAgelocation
- the device locationpublic void eventSSDPByeBye(java.lang.String usn, java.lang.String udn, java.lang.String nt)
DiscoveryEventHandler
eventSSDPByeBye
in interface DiscoveryEventHandler
usn
- the device USN (udn::nt)udn
- the device UDNnt
- the device NTpublic void discoverDevices(int timeout) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |