Updated bundles version in the UPnP script
Added random generation of devices ID in the examples
Review of driver interface documentation

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@647286 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/DevicesInfo.java b/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/DevicesInfo.java
index b11d133..2585d02 100644
--- a/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/DevicesInfo.java
+++ b/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/DevicesInfo.java
@@ -25,32 +25,34 @@
 public interface DevicesInfo{
     /**
      * 
-     * Allow you to get the URL that poinr to the XML description of
+     * Allow you to get the URL of the XML description of
      * a device specified by UUID. 
      * 
      * @param udn the UUID that identify a device
-     * @return The String that rappresent the URL that point to the description of the Device
+     * @return a String representing the URL pointing to the description of the Device
      */
     public String getLocationURL(String udn);
     
     /**
      * 
-     * Allow you to get the URL that poinr to the XML description of
-     * a service specified by ServiceId and UUID of the device that 
-     * contain the service 
+     * Allow you to get the URL of the XML description of
+     * a service specified by the ServiceId and the UUID of the device that 
+     * contains the service 
      * 
      * @param udn the UUID of the device that contain the service
      * @param serviceId the ServiceId of the service
-     * @return The String that rappresent the URL that point to the description of the Service
+     * @return a String representing the URL pointing to the description of the Device
      */
     public String getSCPDURL(String udn,String serviceId);  
     
     /**
-     * Allow you to get the absolue URL of a link that is conatin in a device
+     * Allow you to get the absolute URL of a link that is contained in a device. 
+     * For example the presentation page of a device might be relative to the BASE URL 
+     * declared in the device description.
      * 
      * @param udn the UUID of the UPnP Device 
      * @param link the relative link that you want to resolve
-     * @return The String that rappresent the absolute URL to the resourse specified by link
+     * @return a String representing the absolute URL of the resource specified by the link
      */
     public String resolveRelativeUrl(String udn, String link);
     
diff --git a/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/DriverController.java b/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/DriverController.java
index 176e6e5..35073f1 100644
--- a/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/DriverController.java
+++ b/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/DriverController.java
@@ -26,12 +26,12 @@
 */
 public interface DriverController {
 	/**
-	 * String for searching all the device on UPnP Network
+	 * String for searching all the device on UPnP Networks
 	 */
     public final static String ALL_DEVICE = "ssdp:all";
     
     /**
-     * String for searching only root device on UPnP Network
+     * String for searching only root device on UPnP Networks
      */
     public final static String ROOT_DEVICE = "upnp:rootdevice";
     /*
@@ -44,7 +44,7 @@
      * Set how much messages should be sent by UPnP Base Driver
      * for debugging purpose
      * 
-     * @param n the level of log that you want to set
+     * @param n the level of log that you want to set (0-4)
      */
     public void setLogLevel(int n);
     
@@ -68,8 +68,8 @@
     public boolean getCyberDebug();
     
     /**
-     * Sent a search message on the UPnP Network, and refresh the device 
-     * founded by UPnP Base Driver 
+     * forces the UPnP base driver to send an M-SEARCH message on the UPnP Networks, and refresh the device 
+     * found by UPnP Base Driver 
      * 
      * @param target The SSDP string used for the search
      */
diff --git a/upnp/doc/config.properties.upnp b/upnp/doc/config.properties.upnp
index f58caf1..6da7806 100644
--- a/upnp/doc/config.properties.upnp
+++ b/upnp/doc/config.properties.upnp
@@ -34,8 +34,8 @@
  file:bundle/org.apache.felix.shell.tui-1.1.0-SNAPSHOT.jar \

  file:bundle/org.apache.felix.bundlerepository-1.1.0-SNAPSHOT.jar \

  file:../org.osgi.core/target/org.osgi.core-1.1.0-SNAPSHOT.jar \

- file:../javax.servlet/target/javax.servlet-0.9.0-SNAPSHOT.jar \

- file:../org.osgi.compendium/target/org.osgi.compendium-0.9.0-SNAPSHOT.jar \

+ file:../javax.servlet/target/javax.servlet-1.0.1-SNAPSHOT.jar \

+ file:../org.osgi.compendium/target/org.osgi.compendium-1.1.0-SNAPSHOT.jar \

  file:../http.jetty/target/org.apache.felix.http.jetty-0.9.0-SNAPSHOT.jar \

  file:../upnp/basedriver/target/org.apache.felix.upnp.basedriver-0.3.0-SNAPSHOT.jar \

  file:../upnp/extra/target/org.apache.felix.upnp.extra-0.3.0-SNAPSHOT.jar \

diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/devices/LightDevice.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/devices/LightDevice.java
index 7b244be..56d3908 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/devices/LightDevice.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/devices/LightDevice.java
@@ -23,6 +23,7 @@
 import java.net.UnknownHostException;

 import java.util.Dictionary;

 import java.util.Properties;

+import java.util.Random;

 

 import org.osgi.framework.BundleContext;

 import org.osgi.service.upnp.UPnPDevice;

@@ -41,7 +42,7 @@
 

 public class LightDevice implements UPnPDevice {

 

-	final private String DEVICE_ID = "uuid:Felix-BinaryLight";

+	final private String DEVICE_ID = "uuid:Felix-BinaryLight+" +Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());

 	private BundleContext context;

 	private LightModel model;

 	private LightUI ui;

diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockDevice.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockDevice.java
index 44772c0..c7b44ff 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockDevice.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockDevice.java
@@ -24,6 +24,7 @@
 import java.util.Calendar;

 import java.util.Dictionary;

 import java.util.Properties;

+import java.util.Random;

 

 import org.osgi.framework.BundleContext;

 import org.osgi.service.upnp.UPnPDevice;

@@ -35,7 +36,7 @@
 

 public class ClockDevice implements UPnPDevice {

 

-	final private String DEVICE_ID = "uuid:Felix-Clock";

+	final private String DEVICE_ID = "uuid:Felix-Clock+"+Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());

 	private BundleContext context;

 	private TimerService timerService;

 	private UPnPService[] services;

@@ -54,7 +55,7 @@
 	 * 

 	 */

 	private void buildEventNotifyer() {

-		 notifier = new UPnPEventNotifier(context,this,timerService,null);

+		 notifier = new UPnPEventNotifier(context,this,timerService);

 	}

 

 	private void setupDeviceProperties(){

diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvDevice.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvDevice.java
index 8abb1b5..106150e 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvDevice.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvDevice.java
@@ -24,6 +24,7 @@
 import java.util.Date;

 import java.util.Dictionary;

 import java.util.Properties;

+import java.util.Random;

 

 import org.osgi.framework.BundleContext;

 import org.osgi.framework.Constants;

@@ -37,21 +38,22 @@
 import org.osgi.service.upnp.UPnPService;

 

 import org.apache.felix.upnp.extra.util.UPnPEventNotifier;

+import org.apache.felix.upnp.extra.util.UPnPSubscriber;

 

 public class TvDevice implements UPnPDevice,UPnPEventListener,ServiceListener  {

 	

-	final private String DEVICE_ID = "uuid:Felix-TV";

+	final private String DEVICE_ID = "uuid:Felix-TV+" +Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());

 	private final static String CLOCK_DEVICE_TYPE = "urn:schemas-upnp-org:device:clock:1";

-	private final static String CLOCK_SERVICE_TYPE = "urn:schemas-upnp-org:service:timer:1";

+	private final static String TIME_SERVICE_TYPE = "urn:schemas-upnp-org:service:timer:1";

 	

 	private final static String LIGHT_DEVICE_TYPE = "urn:schemas-upnp-org:device:light:1";

-	private final static String LIGHT_SERVICE_TYPE = "urn:schemas-upnp-org:service:power:1";

+	private final static String POWER_SERVICE_TYPE = "urn:schemas-upnp-org:service:power:1";

 

 	private final static String AIRCON_DEVICE_TYPE = "urn:schemas-upnp-org:device:aircon:1";

-	private final static String AIRCON_SERVICE_TYPE = "urn:schemas-upnp-org:service:temp:1";

+	private final static String TEMP_SERVICE_TYPE = "urn:schemas-upnp-org:service:temp:1";

 	

 	private final static String WASHER_DEVICE_TYPE = "urn:schemas-upnp-org:device:washer:1";

-	private final static String WASHER_SERVICE_TYPE = "urn:schemas-upnp-org:service:state:1";

+	private final static String STATUS_SERVICE_TYPE = "urn:schemas-upnp-org:service:state:1";

 

 	private final String devicesFilter = 

 		"(&"+

@@ -85,7 +87,7 @@
 	 * 

 	 */

 	private void buildEventNotifyer() {

-		notifier = new UPnPEventNotifier(Activator.context,this,powerService,null);

+		notifier = new UPnPEventNotifier(Activator.context,this,powerService);

 		powerState.setNotifier(notifier);

 	}

 

@@ -234,14 +236,14 @@
 	public void doSubscribe()

 	{

 		subscriber = new UPnPSubscriber(Activator.context,this);

-		subscriber.subscribe(CLOCK_DEVICE_TYPE, CLOCK_SERVICE_TYPE);

-		subscriber.subscribe(AIRCON_DEVICE_TYPE, AIRCON_SERVICE_TYPE);

-		subscriber.subscribe(LIGHT_DEVICE_TYPE, LIGHT_SERVICE_TYPE);

-		subscriber.subscribe(WASHER_DEVICE_TYPE, WASHER_SERVICE_TYPE);

+		subscriber.subscribeEveryServiceType(CLOCK_DEVICE_TYPE, TIME_SERVICE_TYPE);

+		subscriber.subscribeEveryServiceType(AIRCON_DEVICE_TYPE, TEMP_SERVICE_TYPE);

+		subscriber.subscribeEveryServiceType(LIGHT_DEVICE_TYPE, POWER_SERVICE_TYPE);

+		subscriber.subscribeEveryServiceType(WASHER_DEVICE_TYPE, STATUS_SERVICE_TYPE);

 	}

 	

 	public void undoSubscribe(){

-		subscriber.unsubscribe();

+		subscriber.unsubscribeAll();

 	}

 	

 	ArrayList LinkedDevices = new ArrayList();