felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject svn commit: r789770 - in /felix/sandbox/donsez/upnp.heartbeat: ./ generation/ generation/res/ generation/res/device/ generation/res/service/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/felix/ src/...
Date Tue, 30 Jun 2009 14:49:59 GMT
Author: donsez
Date: Tue Jun 30 14:49:58 2009
New Revision: 789770

URL: http://svn.apache.org/viewvc?rev=789770&view=rev
Log:
creation of project for UPnP device with a HeartBeat service to check device availability.

Added:
    felix/sandbox/donsez/upnp.heartbeat/
    felix/sandbox/donsez/upnp.heartbeat/generation/
    felix/sandbox/donsez/upnp.heartbeat/generation/build.xml   (with props)
    felix/sandbox/donsez/upnp.heartbeat/generation/res/
    felix/sandbox/donsez/upnp.heartbeat/generation/res/device/
    felix/sandbox/donsez/upnp.heartbeat/generation/res/device/DummyMonitoredDevice1.xml   (with props)
    felix/sandbox/donsez/upnp.heartbeat/generation/res/project.DummyMonitoredDevice1.properties   (with props)
    felix/sandbox/donsez/upnp.heartbeat/generation/res/service/
    felix/sandbox/donsez/upnp.heartbeat/generation/res/service/HeartBeat1.xml   (with props)
    felix/sandbox/donsez/upnp.heartbeat/pom.xml   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/
    felix/sandbox/donsez/upnp.heartbeat/src/main/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/activator/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/activator/Activator.java   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/controlpoint/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/controlpoint/HeartBeatProxyImpl.java   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/device/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/device/DummyMonitoredDevice.java   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/impl/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/impl/HeartBeatModelImpl.java   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/model/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/model/HeartBeatModel.java   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/service/
    felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/service/HeartBeat.java   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/resources/
    felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/
    felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart128.png   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart16.png   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart32.png   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart48.png   (with props)
    felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart64.png   (with props)

Added: felix/sandbox/donsez/upnp.heartbeat/generation/build.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/generation/build.xml?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/generation/build.xml (added)
+++ felix/sandbox/donsez/upnp.heartbeat/generation/build.xml Tue Jun 30 14:49:58 2009
@@ -0,0 +1,23 @@
+<project name="OSGi UPnP Device Driver Source Generation" default="main" basedir=".">
+
+	<target name="main" depends="init, generate.class">
+	</target>
+
+	<target name="init">
+		<mkdir dir="generated"/>
+	</target>
+
+	<target name="generate.class">
+		
+		<!-- DummyMonitoredDevice1 Device -->
+		<ant antfile="build.device.xml" target="generate.class" inheritall="true">
+			<property name="properties" value="res/project.DummyMonitoredDevice1.properties" />
+		</ant>		
+
+	</target>
+
+	<target name="clean">
+		<delete dir="generated"/>
+	</target>
+
+</project>

Propchange: felix/sandbox/donsez/upnp.heartbeat/generation/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/generation/res/device/DummyMonitoredDevice1.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/generation/res/device/DummyMonitoredDevice1.xml?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/generation/res/device/DummyMonitoredDevice1.xml (added)
+++ felix/sandbox/donsez/upnp.heartbeat/generation/res/device/DummyMonitoredDevice1.xml Tue Jun 30 14:49:58 2009
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<root>
+	<specVersion>
+		<major>1</major>
+		<minor>0</minor>
+	</specVersion>
+	<URLBase>http://felix.apache.org/upnp/heartbeat</URLBase>
+	<device>
+		<deviceType>urn:schemas-felix-apache-org:device:DummyMonitoredDevice:1</deviceType>
+		<friendlyName>Dummy Monitored UPnP Device</friendlyName>
+		<manufacturer>Apache Felix project</manufacturer>
+		<manufacturerURL>http://felix.apache.org</manufacturerURL>
+		<modelDescription>Dummy Monitored UPnP Device</modelDescription>
+		<modelName>DummyMonitored</modelName>
+		<modelNumber>123</modelNumber>
+		<modelURL>http://felix.apache.org/upnp/heartbeat</modelURL>
+		<serialNumber>123456789</serialNumber>
+		<UDN>uuid:felix-upnp-heartbeat</UDN>
+		<UPC>upc:felix-upnp-heartbeat</UPC>
+		<iconList>
+			<icon>
+				<mimetype>image/png</mimetype>
+				<width>16</width>
+				<height>16</height>
+				<depth>16</depth>
+				<url>/icon/heart16.png</url>
+			</icon>
+			<icon>
+				<mimetype>image/png</mimetype>
+				<width>32</width>
+				<height>32</height>
+				<depth>16</depth>
+				<url>/icon/heart32.png</url>
+			</icon>
+			<icon>
+				<mimetype>image/png</mimetype>
+				<width>48</width>
+				<height>48</height>
+				<depth>16</depth>
+				<url>/icon/heart48.png</url>
+			</icon>
+			<icon>
+				<mimetype>image/png</mimetype>
+				<width>64</width>
+				<height>64</height>
+				<depth>16</depth>
+				<url>/icon/heart64.png</url>
+			</icon>
+			<icon>
+				<mimetype>image/png</mimetype>
+				<width>128</width>
+				<height>128</height>
+				<depth>16</depth>
+				<url>/icon/heart128.png</url>
+			</icon>
+		</iconList>
+		
+   <serviceList>
+      <service>
+         <serviceType>urn:felix-apache-org:service:HeartBeat:1</serviceType>
+         <serviceId>HeartBeat</serviceId>
+      </service>
+   </serviceList>
+</device>
+</root>
\ No newline at end of file

Propchange: felix/sandbox/donsez/upnp.heartbeat/generation/res/device/DummyMonitoredDevice1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/generation/res/project.DummyMonitoredDevice1.properties
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/generation/res/project.DummyMonitoredDevice1.properties?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/generation/res/project.DummyMonitoredDevice1.properties (added)
+++ felix/sandbox/donsez/upnp.heartbeat/generation/res/project.DummyMonitoredDevice1.properties Tue Jun 30 14:49:58 2009
@@ -0,0 +1,8 @@
+# properties for the generation of
+# DummyMonitoredDevice1 v1 device and associated services classes
+#
+# ant -f build.device.xml -Dproperties=project.DummyMonitoredDevice1.properties
+
+device.description.xml.file=res/device/DummyMonitoredDevice1.xml
+package=org.apache.felix.upnp.heartbeat
+device.name=DummyMonitoredDevice

Propchange: felix/sandbox/donsez/upnp.heartbeat/generation/res/project.DummyMonitoredDevice1.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/generation/res/service/HeartBeat1.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/generation/res/service/HeartBeat1.xml?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/generation/res/service/HeartBeat1.xml (added)
+++ felix/sandbox/donsez/upnp.heartbeat/generation/res/service/HeartBeat1.xml Tue Jun 30 14:49:58 2009
@@ -0,0 +1,91 @@
+<scpd>
+    <!-- Service to monitor the avaibility of an UPnP device -->
+    <!-- The variables are not persistent to the device reinits.  -->
+
+   <serviceStateTable>
+   
+      <stateVariable>
+          <!-- random number renewed each time the device reboots/reinits or left a network -->
+         <name>LiveID</name>  <!-- TODO changes LiveID into LifeID -->
+         <sendEventsAttribute>yes</sendEventsAttribute>
+         <dataType>i4</dataType> <!-- A 32bit random number seems enough -->
+      </stateVariable>
+      
+      <stateVariable>
+           <!-- the dateTime is informational since the device internal clock could be not setted -->
+         <name>StartTime</name>
+         <sendEventsAttribute>no</sendEventsAttribute>
+         <dataType>dateTime.tz</dataType> 
+      </stateVariable>
+      
+      <stateVariable>
+          <!-- number of seconds since the last startup --> 
+         <name>UpTime</name>
+         <sendEventsAttribute>yes</sendEventsAttribute>
+         <dataType>i4</dataType> 
+      </stateVariable>
+      
+      <stateVariable>
+          <!-- period in seconds between each beat --> 
+         <name>BeatPeriod</name>
+         <sendEventsAttribute>yes</sendEventsAttribute>
+         <dataType>i4</dataType>
+         <defaultValue>300</defaultValue>  <!-- 5 minutes -->
+      </stateVariable>
+      
+   </serviceStateTable>
+   
+   <actionList>
+      <action>
+         <name>GetUpTime</name>
+         <argumentList>
+            <argument>
+               <name>CurrentUpTime</name>
+               <direction>out</direction>
+               <relatedStateVariable>UpTime</relatedStateVariable>
+               <retval/>
+            </argument>
+            <argument>
+               <name>LiveID</name>
+               <direction>out</direction>
+               <relatedStateVariable>LiveID</relatedStateVariable>
+            </argument>
+            <argument>
+               <name>StartTime</name>
+               <direction>out</direction>
+               <relatedStateVariable>StartTime</relatedStateVariable>
+            </argument>
+            <argument>
+               <name>CurrentBeatPeriod</name>
+               <direction>out</direction>
+               <relatedStateVariable>BeatPeriod</relatedStateVariable>
+            </argument>
+         </argumentList>
+      </action>
+      
+      <action>
+         <name>GetBeatPeriod</name>
+         <argumentList>
+            <argument>
+               <name>CurrentBeatPeriod</name>
+               <direction>out</direction>
+               <relatedStateVariable>BeatPeriod</relatedStateVariable>
+               <retval/>
+            </argument>
+         </argumentList>
+      </action>
+      
+      <action>
+         <Optional/>
+         <name>SetBeatPeriod</name>
+         <argumentList>
+            <argument>
+               <name>NewBeatPeriod</name>
+               <direction>in</direction>
+               <relatedStateVariable>BeatPeriod</relatedStateVariable>
+            </argument>
+         </argumentList>
+      </action>
+
+   </actionList>
+</scpd>

Propchange: felix/sandbox/donsez/upnp.heartbeat/generation/res/service/HeartBeat1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/pom.xml?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/pom.xml (added)
+++ felix/sandbox/donsez/upnp.heartbeat/pom.xml Tue Jun 30 14:49:58 2009
@@ -0,0 +1,74 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project>
+
+	<properties>
+		<description>provides a monitored UPnP Device.</description>
+	</properties>  
+
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>bundle</packaging>
+  <name>Apache Felix UPnP Monitored Device</name>
+  <artifactId>org.apache.felix.upnp.heartbeat</artifactId>
+  <groupId>org.apache.felix.sandbox</groupId>
+  <version>0.1.0</version>
+  <description>${description}</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix.sandbox</groupId>
+      <artifactId>org.apache.felix.upnp.devicegen.util</artifactId>
+      <version>0.1.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+          	
+            <Export-Service>org.osgi.service.upnp.UPnPDevice</Export-Service>
+
+            <Private-Package>org.apache.felix.upnp.heartbeat.*</Private-Package>
+            <Import-Package>*</Import-Package>
+            <Bundle-Activator>${pom.artifactId}.activator.Activator</Bundle-Activator>
+
+            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+            <Bundle-Description>${description}</Bundle-Description>
+            <Bundle-Vendor>Apache Software Foundation</Bundle-Vendor>
+
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: felix/sandbox/donsez/upnp.heartbeat/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/activator/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/activator/Activator.java?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/activator/Activator.java (added)
+++ felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/activator/Activator.java Tue Jun 30 14:49:58 2009
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.upnp.heartbeat.activator;
+
+import org.apache.felix.upnp.heartbeat.device.DummyMonitoredDevice;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * This class controls the lifecycle of UPnP device provisionned in this bundle
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+
+public class Activator implements BundleActivator {
+
+	DummyMonitoredDevice device;
+	
+	public void start(BundleContext bundleContext) throws Exception {
+		device=new DummyMonitoredDevice(bundleContext,null);
+		device.start(bundleContext);
+	}
+	
+	public void stop(BundleContext bundleContext) throws Exception {
+		device.stop(bundleContext);
+	}
+}

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/activator/Activator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/controlpoint/HeartBeatProxyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/controlpoint/HeartBeatProxyImpl.java?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/controlpoint/HeartBeatProxyImpl.java (added)
+++ felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/controlpoint/HeartBeatProxyImpl.java Tue Jun 30 14:49:58 2009
@@ -0,0 +1,190 @@
+/*
+ __BANNER__
+ */
+// this file was generated at 30-June-2009 12:18 PM by ${author}
+package org.apache.felix.upnp.heartbeat.controlpoint;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.felix.upnp.devicegen.holder.DateHolder;
+import org.apache.felix.upnp.devicegen.holder.IntegerHolder;
+import org.apache.felix.upnp.heartbeat.model.HeartBeatModel;
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPException;
+import org.osgi.service.upnp.UPnPService;
+
+public class HeartBeatProxyImpl implements HeartBeatModel {
+
+	private UPnPService upnpService;
+
+	HeartBeatProxyImpl(UPnPService upnpService) {
+		super();
+		this.upnpService = upnpService;
+	}
+
+	/**
+	 * This method is "add description here" currentUpTime out parameter
+	 * 
+	 * liveID out parameter
+	 * 
+	 * startTime out parameter
+	 * 
+	 * currentBeatPeriod out parameter
+	 * 
+	 * 
+	 */
+	public void getUpTime(IntegerHolder currentUpTime,
+
+	IntegerHolder liveID,
+
+	DateHolder startTime,
+
+	IntegerHolder currentBeatPeriod) throws UPnPException {
+
+		UPnPAction upnpAction = upnpService.getAction("getUpTime");
+
+		Dictionary _parameters = new Hashtable();
+
+		// TODO _parameters.put("InParam", inparam);
+
+		Dictionary _result;
+		try {
+			_result = upnpAction.invoke(_parameters);
+		} catch (UPnPException e) {
+			throw e;
+		} catch (Exception e) {
+			throw new UPnPException(UPnPException.DEVICE_INTERNAL_ERROR, e
+					.getMessage());
+		}
+
+		// TODO outparam.setType((Type) _result.get("OutParam"));
+	}
+
+	/**
+	 * This method is "add description here" currentBeatPeriod out parameter
+	 * 
+	 * 
+	 */
+	public void getBeatPeriod(IntegerHolder currentBeatPeriod)
+			throws UPnPException {
+
+		UPnPAction upnpAction = upnpService.getAction("getBeatPeriod");
+
+		Dictionary _parameters = new Hashtable();
+
+		// TODO _parameters.put("InParam", inparam);
+
+		Dictionary _result;
+		try {
+			_result = upnpAction.invoke(_parameters);
+		} catch (UPnPException e) {
+			throw e;
+		} catch (Exception e) {
+			throw new UPnPException(UPnPException.DEVICE_INTERNAL_ERROR, e
+					.getMessage());
+		}
+
+		// TODO outparam.setType((Type) _result.get("OutParam"));
+	}
+
+	/**
+	 * This method is "add description here" newBeatPeriod in parameter
+	 * 
+	 * 
+	 */
+	public void setBeatPeriod(int newBeatPeriod) throws UPnPException {
+
+		UPnPAction upnpAction = upnpService.getAction("setBeatPeriod");
+
+		Dictionary _parameters = new Hashtable();
+
+		// TODO _parameters.put("InParam", inparam);
+
+		Dictionary _result;
+		try {
+			_result = upnpAction.invoke(_parameters);
+		} catch (UPnPException e) {
+			throw e;
+		} catch (Exception e) {
+			throw new UPnPException(UPnPException.DEVICE_INTERNAL_ERROR, e
+					.getMessage());
+		}
+
+		// TODO outparam.setType((Type) _result.get("OutParam"));
+	}
+
+	// Those listeners are used for the subscription to state variable change
+
+	// TODO current listeners list
+
+	public void addListenerOnLiveIDStateVariableValue(/*
+														 * TODO Listener
+														 * listener
+														 */) {
+		// TODO java.lang.Integer
+		return;
+	}
+
+	public void removeListenerOnLiveIDStateVariableValue(/*
+															 * TODO Listener
+															 * listener
+															 */) {
+		// TODO
+		return;
+	}
+
+	// TODO current listeners list
+
+	public void addListenerOnUpTimeStateVariableValue(/*
+														 * TODO Listener
+														 * listener
+														 */) {
+		// TODO java.lang.Integer
+		return;
+	}
+
+	public void removeListenerOnUpTimeStateVariableValue(/*
+															 * TODO Listener
+															 * listener
+															 */) {
+		// TODO
+		return;
+	}
+
+	// TODO current listeners list
+
+	public void addListenerOnBeatPeriodStateVariableValue(/*
+															 * TODO Listener
+															 * listener
+															 */) {
+		// TODO java.lang.Integer
+		return;
+	}
+
+	public void removeListenerOnBeatPeriodStateVariableValue(/*
+																 * TODO Listener
+																 * listener
+																 */) {
+		// TODO
+		return;
+	}
+
+	// Those getters are used for ??? may be not useful !!!
+
+	public java.lang.Integer getLiveIDStateVariableValue() {
+		// TODO
+		return null;
+	}
+
+	public java.lang.Integer getUpTimeStateVariableValue() {
+		// TODO
+		return null;
+	}
+
+	public java.lang.Integer getBeatPeriodStateVariableValue() {
+		// TODO
+		return null;
+	}
+
+}

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/controlpoint/HeartBeatProxyImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/device/DummyMonitoredDevice.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/device/DummyMonitoredDevice.java?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/device/DummyMonitoredDevice.java (added)
+++ felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/device/DummyMonitoredDevice.java Tue Jun 30 14:49:58 2009
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.upnp.heartbeat.device;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.felix.upnp.devicegen.util.AbstractUPnPDevice;
+import org.apache.felix.upnp.devicegen.util.DeviceIcon;
+import org.apache.felix.upnp.devicegen.util.UPnPEventNotifier;
+import org.apache.felix.upnp.heartbeat.impl.HeartBeatModelImpl;
+import org.apache.felix.upnp.heartbeat.service.HeartBeat;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.upnp.UPnPDevice;
+import org.osgi.service.upnp.UPnPIcon;
+import org.osgi.service.upnp.UPnPService;
+	
+/**
+ * This class provides the implementation of a UPnP DummyMoniteredDevice device
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class DummyMonitoredDevice extends AbstractUPnPDevice
+{
+	
+	HeartBeatModelImpl myHeartBeatModel;
+	
+	public DummyMonitoredDevice(BundleContext context, AbstractUPnPDevice parent) {
+		super(context,parent);
+
+		DEVICE_ID="uuid:felix-upnp-heartbeat";
+
+		// ServiceModel Declaration List
+		myHeartBeatModel=new HeartBeatModelImpl();
+		
+		// Icon Lists
+		
+		List iconsList=new LinkedList();
+	
+		iconsList.add(
+				new DeviceIcon(
+					"image/png", // MimeType
+					16, //Width
+					16, // Height
+					0, // ??
+					16, // Depth
+					"/icon/heart16.png", // URL
+					DummyMonitoredDevice.class.getClassLoader()
+				)
+		);
+
+		iconsList.add(
+				new DeviceIcon(
+					"image/png", // MimeType
+					32, //Width
+					32, // Height
+					0, // ??
+					16, // Depth
+					"/icon/heart32.png", // URL
+					DummyMonitoredDevice.class.getClassLoader()
+				)
+		);
+
+		iconsList.add(
+				new DeviceIcon(
+					"image/png", // MimeType
+					48, //Width
+					48, // Height
+					0, // ??
+					16, // Depth
+					"/icon/heart48.png", // URL
+					DummyMonitoredDevice.class.getClassLoader()
+				)
+		);
+
+		iconsList.add(
+				new DeviceIcon(
+					"image/png", // MimeType
+					64, //Width
+					64, // Height
+					0, // ??
+					16, // Depth
+					"/icon/heart64.png", // URL
+					DummyMonitoredDevice.class.getClassLoader()
+				)
+		);
+
+		iconsList.add(
+				new DeviceIcon(
+					"image/png", // MimeType
+					128, //Width
+					128, // Height
+					0, // ??
+					16, // Depth
+					"/icon/heart128.png", // URL
+					DummyMonitoredDevice.class.getClassLoader()
+				)
+		);
+
+		icons=(UPnPIcon[])iconsList.toArray(new UPnPIcon[]{});
+
+
+		// Service List
+		
+		List servicesList=new LinkedList();
+	
+	
+		/*
+				SCPDURL=
+				controlURL=
+				eventSubURL=
+		*/
+		servicesList.add(
+				new HeartBeat(
+						this,
+						"HeartBeat",
+						"urn:felix-apache-org:service:HeartBeat:1",
+						"1",
+						myHeartBeatModel									
+				)
+			);				
+
+		services=(UPnPService[])servicesList.toArray(new UPnPService[]{});
+
+	}
+	
+	protected void setupDeviceProperties(){	
+		dictionary.put(UPnPDevice.TYPE,"urn:schemas-felix-apache-org:device:DummyMonitoredDevice:1");
+		dictionary.put(UPnPDevice.FRIENDLY_NAME,"Dummy Monitored UPnP Device");
+		dictionary.put(UPnPDevice.MANUFACTURER,"Apache Felix project");
+		dictionary.put(UPnPDevice.MANUFACTURER_URL,"http://felix.apache.org");
+		dictionary.put(UPnPDevice.MODEL_DESCRIPTION,"Dummy Monitored UPnP Device");
+		dictionary.put(UPnPDevice.MODEL_NAME,"DummyMonitored");
+		dictionary.put(UPnPDevice.MODEL_NUMBER,"123");
+		dictionary.put(UPnPDevice.MODEL_URL,"http://felix.apache.org/upnp/heartbeat");
+		dictionary.put(UPnPDevice.SERIAL_NUMBER,"123456789");
+		dictionary.put(UPnPDevice.UDN,getUDN());
+		dictionary.put(UPnPDevice.ID,dictionary.get(UPnPDevice.UDN));
+		dictionary.put(UPnPDevice.UPC,"upc:felix-upnp-heartbeat");
+		dictionary.put(UPnPDevice.PRESENTATION_URL,"");		
+
+		if(parent!=null) {
+			dictionary.put(UPnPDevice.PARENT_UDN,parent.getUDN());
+		}
+		
+		if(children!=null && children.size()!=0){
+			String[] childrenUDN=new String[children.size()];
+			Iterator iter=children.iterator();
+			for(int i=0;iter.hasNext();i++){
+				childrenUDN[i]=((AbstractUPnPDevice)iter.next()).getUDN();
+			}
+			dictionary.put(UPnPDevice.CHILDREN_UDN,childrenUDN);
+		}
+	}
+
+	public void start(BundleContext bundleContext) throws Exception {
+		super.start(bundleContext);	
+		// start services impl
+		UPnPEventNotifier notifier=notifiers[0];
+		myHeartBeatModel.setNotifier(notifier);
+		myHeartBeatModel.start(bundleContext);
+	}
+
+	public void stop(BundleContext bundleContext) throws Exception {
+		// stop services impl
+		myHeartBeatModel.setNotifier(null);
+		myHeartBeatModel.stop(bundleContext);	
+		super.stop(bundleContext);
+	}
+}

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/device/DummyMonitoredDevice.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/impl/HeartBeatModelImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/impl/HeartBeatModelImpl.java?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/impl/HeartBeatModelImpl.java (added)
+++ felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/impl/HeartBeatModelImpl.java Tue Jun 30 14:49:58 2009
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.upnp.heartbeat.impl;
+
+import java.beans.PropertyChangeEvent;
+import java.security.SecureRandom;
+import java.util.Date;
+
+import org.apache.felix.upnp.devicegen.holder.DateHolder;
+import org.apache.felix.upnp.devicegen.holder.IntegerHolder;
+import org.apache.felix.upnp.devicegen.util.UPnPEventNotifier;
+import org.apache.felix.upnp.heartbeat.model.HeartBeatModel;
+import org.apache.felix.upnp.heartbeat.service.HeartBeat;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.upnp.UPnPException;
+
+
+/**
+ * This class implements the model of the UPnP HeartBeat service
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class HeartBeatModelImpl implements HeartBeatModel, Runnable, BundleActivator {
+
+	/**
+	 * starttime in millisecond since 1970/1/1
+	 */
+	private long startTime;
+
+	/**
+	 * last beat time in millisecond since 1970/1/1
+	 */
+	private int lastUpTime;
+	
+	/**
+	 * starttime in Date
+	 */
+	private Date startTimeInDate;
+
+	/**
+	 * randomly generated life id
+	 */
+	private int liveID;
+
+	/**
+	 * beat period in seconds
+	 */
+	private int beatPeriod=300;
+
+	private Thread beatThread;
+
+	private boolean end = false;
+
+	/**
+	 * get the uptime + other related infos
+	 * 
+	 * @param liveID out parameter 
+	 * @param startTime out parameter
+	 * @param currentBeatPeriod out parameter
+	 * 
+	 * 
+	 */
+	public void getUpTime(IntegerHolder currentUpTime, IntegerHolder liveID,
+			DateHolder startTime, IntegerHolder currentBeatPeriod)
+			throws UPnPException {
+		currentUpTime.setValue(upTime());
+		liveID.setValue(this.liveID);
+		startTime.setValue(this.startTimeInDate);
+		currentBeatPeriod.setValue(beatPeriod);
+	}
+
+	/**
+	 * get the beat period in seconds
+	 */
+	public void getBeatPeriod(IntegerHolder currentBeatPeriod)
+			throws UPnPException {
+		currentBeatPeriod.setValue(beatPeriod);
+	}
+
+	/**
+	 * set the beat period in seconds
+	 * @param newBeatPeriod the new beat period
+	 */
+	public void setBeatPeriod(int newBeatPeriod) throws UPnPException {
+		if(newBeatPeriod>=0){
+			int oldBeatPeriod=beatPeriod;
+			beatPeriod=newBeatPeriod;
+			notifyBeatPeriodChange(oldBeatPeriod,newBeatPeriod);
+		} else {	
+			throw new UPnPException(UPnPException.INVALID_ARGS,
+				"BeatPeriod must strictly possitive");
+		}
+	}
+
+	// Those getters are used for the first notification just after a subscription
+
+	public java.lang.Integer getLiveIDStateVariableValue() {
+		return new Integer(liveID);
+	}
+
+	public java.lang.Integer getUpTimeStateVariableValue() {
+		return new Integer(upTime());
+	}
+
+	public java.lang.Integer getBeatPeriodStateVariableValue() {
+		return new Integer(beatPeriod);
+	}
+
+	private int upTime() {
+		 return (int)(System.currentTimeMillis()-this.startTime)/1000;
+	}
+	
+	public void run() {
+		while (!end) {
+			// notify the beat to all subscribers
+			notifyHeartBeat();
+			try { // TODO interupt if new beat period is before the next beat 
+				Thread.sleep(beatPeriod * 1000);
+			} catch (InterruptedException e) {
+			}
+		}
+	}
+
+	/**
+	 * 
+	 */
+	public void start(BundleContext bundleContext) throws Exception {
+		end = false;
+		
+		SecureRandom rng = SecureRandom.getInstance("SHA1PRNG");
+	    rng.setSeed(711);
+	    liveID=rng.nextInt();
+
+		startTimeInDate=new Date();
+		
+		beatThread = new Thread(this);
+		beatThread.setName(bundleContext.getBundle().getSymbolicName()
+				+ "#" + "heartbeat");
+		beatThread.start();
+	}
+
+	/**
+	 * 
+	 */
+	public void stop(BundleContext bundleContext) throws Exception {
+		end = true;
+		beatThread.interrupt();
+	}
+	
+	private UPnPEventNotifier notifier;
+	
+	public void setNotifier(UPnPEventNotifier notifier) {
+		this.notifier=notifier;
+	}
+
+	protected final void notifyHeartBeat() {
+		if(notifier!=null){
+			int old=lastUpTime;
+			lastUpTime=upTime();
+			PropertyChangeEvent propertyChangeEvent;
+			propertyChangeEvent=new PropertyChangeEvent(this,HeartBeat.UpTimeStateVariable.NAME,new Integer(old),new Integer(lastUpTime));
+			notifier.propertyChange(propertyChangeEvent);
+		}
+	}
+
+	protected final void notifyBeatPeriodChange(int oldBeatPeriod, int newBeatPeriod) {	
+		if(notifier!=null){
+			PropertyChangeEvent propertyChangeEvent;
+			propertyChangeEvent=new PropertyChangeEvent(this,HeartBeat.BeatPeriodStateVariable.NAME,new Integer(oldBeatPeriod),new Integer(newBeatPeriod));
+			notifier.propertyChange(propertyChangeEvent);
+		}
+	}
+}

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/impl/HeartBeatModelImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/model/HeartBeatModel.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/model/HeartBeatModel.java?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/model/HeartBeatModel.java (added)
+++ felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/model/HeartBeatModel.java Tue Jun 30 14:49:58 2009
@@ -0,0 +1,71 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 30-June-2009 12:18 PM by ${author}
+package org.apache.felix.upnp.heartbeat.model;
+
+import org.apache.felix.upnp.devicegen.holder.*;
+import org.osgi.service.upnp.UPnPException;
+
+	
+public interface HeartBeatModel {		
+	
+	/**
+	 * This method is "add description here"	
+ * currentUpTime out  parameter
+
+ * liveID out  parameter
+
+ * startTime out  parameter
+
+ * currentBeatPeriod out  parameter
+
+
+	 */
+	public void getUpTime(
+		IntegerHolder currentUpTime,
+
+IntegerHolder liveID,
+
+DateHolder startTime,
+
+IntegerHolder currentBeatPeriod
+	) throws UPnPException;
+	// TODO return the type of the return argument when specified
+
+
+	/**
+	 * This method is "add description here"	
+ * currentBeatPeriod out  parameter
+
+
+	 */
+	public void getBeatPeriod(
+		IntegerHolder currentBeatPeriod
+	) throws UPnPException;
+	// TODO return the type of the return argument when specified
+
+
+	/**
+	 * This method is "add description here"	
+ * newBeatPeriod in  parameter
+
+
+	 */
+	public void setBeatPeriod(
+		int newBeatPeriod
+	) throws UPnPException;
+	// TODO return the type of the return argument when specified
+
+	
+
+	// Those getters are used for the first notification just after a subscription
+	
+		public java.lang.Integer getLiveIDStateVariableValue();		
+		
+		public java.lang.Integer getUpTimeStateVariableValue();		
+		
+		public java.lang.Integer getBeatPeriodStateVariableValue();		
+			
+}

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/model/HeartBeatModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/service/HeartBeat.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/service/HeartBeat.java?rev=789770&view=auto
==============================================================================
--- felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/service/HeartBeat.java (added)
+++ felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/service/HeartBeat.java Tue Jun 30 14:49:58 2009
@@ -0,0 +1,540 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 30-June-2009 12:18 PM by ${author}
+package org.apache.felix.upnp.heartbeat.service;
+
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.osgi.framework.*;
+import org.osgi.service.upnp.*;
+import org.apache.felix.upnp.devicegen.util.*;
+import org.apache.felix.upnp.devicegen.holder.*;
+
+import org.apache.felix.upnp.heartbeat.model.*;
+import org.apache.felix.upnp.heartbeat.impl.*;
+
+	
+
+public class HeartBeat extends AbstractUPnPService {
+	
+		
+	private HeartBeatModel model;	
+		
+	/**
+	 * constructor
+	 */
+	public HeartBeat(
+		UPnPDevice upnpDevice,
+		String serviceId,
+		String serviceType,
+		String version,
+		HeartBeatModel model
+	){
+		super(	
+			upnpDevice,
+			serviceId,
+			serviceType,
+			version
+		);
+		this.model=model;
+	
+		
+	stateVariables=new HashMap();
+	
+
+	
+	stateVariables.put(
+		"LiveID",
+		new LiveIDStateVariable(this,model)
+	);
+
+
+	
+	stateVariables.put(
+		"StartTime",
+		new StartTimeStateVariable(this,model)
+	);
+
+
+	
+	stateVariables.put(
+		"UpTime",
+		new UpTimeStateVariable(this,model)
+	);
+
+
+	
+	stateVariables.put(
+		"BeatPeriod",
+		new BeatPeriodStateVariable(this,model)
+	);
+
+	actions=new HashMap();
+	
+
+
+	actions.put(
+		"GetUpTime",
+		new GetUpTimeAction(this,model)
+	);
+
+
+
+	actions.put(
+		"GetBeatPeriod",
+		new GetBeatPeriodAction(this,model)
+	);
+
+
+
+	actions.put(
+		"SetBeatPeriod",
+		new SetBeatPeriodAction(this,model)
+	);
+	
+	}
+
+	// UPnPStateVariable classes
+	
+	
+
+// class LiveIDStateVariable
+public class LiveIDStateVariable
+  extends AbstractUPnPStateVariable
+			
+	  implements UPnPStateVariableDescriptor{
+
+	public final static String NAME="LiveID";
+	public final static String DATATYPE="i4";
+	
+	// HERE specific state variable members
+	private HeartBeatModel model;
+	
+	public LiveIDStateVariable(
+		UPnPService upnpService,
+		HeartBeatModel model
+	){	
+		super(
+					upnpService,
+					NAME,
+					DATATYPE,
+					null, // TODO defaultValue changed for 
+					null, // TODO step changed for 
+					null, // TODO step changed for 
+					null, // TODO minimum changed for 
+					null, // TODO maximum changed for 
+					// sendEventsAttribute
+	true,
+					true  // TODO required changed for  OR 
+		);
+		
+		this.model=model;
+
+		
+	}
+	
+	// TODO
+	
+	public void start(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+	public void stop(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+			
+	/**
+	 * invoked for the first notification just after a subscription
+	 * @see it.cnr.isti.niche.osgi.upnp.util.UPnPStateVariableDescriptor#getValue()
+	 */
+	public Object getValue(){
+	
+		return model.getLiveIDStateVariableValue();
+		
+	}
+};
+
+
+// class StartTimeStateVariable
+public class StartTimeStateVariable
+  extends AbstractUPnPStateVariable
+			
+	{
+
+	public final static String NAME="StartTime";
+	public final static String DATATYPE="dateTime.tz";
+	
+	// HERE specific state variable members
+	private HeartBeatModel model;
+	
+	public StartTimeStateVariable(
+		UPnPService upnpService,
+		HeartBeatModel model
+	){	
+		super(
+					upnpService,
+					NAME,
+					DATATYPE,
+					null, // TODO defaultValue changed for 
+					null, // TODO step changed for 
+					null, // TODO step changed for 
+					null, // TODO minimum changed for 
+					null, // TODO maximum changed for 
+					// sendEventsAttribute
+	false,
+					true  // TODO required changed for  OR 
+		);
+		
+		this.model=model;
+
+		
+	}
+	
+	// TODO
+	
+	public void start(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+	public void stop(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+			
+	/**
+	 * invoked for the first notification just after a subscription
+	 * @see it.cnr.isti.niche.osgi.upnp.util.UPnPStateVariableDescriptor#getValue()
+	 */
+	public Object getValue(){
+	return null;
+	}
+};
+
+
+// class UpTimeStateVariable
+public class UpTimeStateVariable
+  extends AbstractUPnPStateVariable
+			
+	  implements UPnPStateVariableDescriptor{
+
+	public final static String NAME="UpTime";
+	public final static String DATATYPE="i4";
+	
+	// HERE specific state variable members
+	private HeartBeatModel model;
+	
+	public UpTimeStateVariable(
+		UPnPService upnpService,
+		HeartBeatModel model
+	){	
+		super(
+					upnpService,
+					NAME,
+					DATATYPE,
+					null, // TODO defaultValue changed for 
+					null, // TODO step changed for 
+					null, // TODO step changed for 
+					null, // TODO minimum changed for 
+					null, // TODO maximum changed for 
+					// sendEventsAttribute
+	true,
+					true  // TODO required changed for  OR 
+		);
+		
+		this.model=model;
+
+		
+	}
+	
+	// TODO
+	
+	public void start(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+	public void stop(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+			
+	/**
+	 * invoked for the first notification just after a subscription
+	 * @see it.cnr.isti.niche.osgi.upnp.util.UPnPStateVariableDescriptor#getValue()
+	 */
+	public Object getValue(){
+	
+		return model.getUpTimeStateVariableValue();
+		
+	}
+};
+
+
+// class BeatPeriodStateVariable
+public class BeatPeriodStateVariable
+  extends AbstractUPnPStateVariable
+			
+	  implements UPnPStateVariableDescriptor{
+
+	public final static String NAME="BeatPeriod";
+	public final static String DATATYPE="i4";
+	
+	// HERE specific state variable members
+	private HeartBeatModel model;
+	
+	public BeatPeriodStateVariable(
+		UPnPService upnpService,
+		HeartBeatModel model
+	){	
+		super(
+					upnpService,
+					NAME,
+					DATATYPE,
+					null, // TODO defaultValue changed for 300
+					null, // TODO step changed for 
+					null, // TODO step changed for 
+					null, // TODO minimum changed for 
+					null, // TODO maximum changed for 
+					// sendEventsAttribute
+	true,
+					true  // TODO required changed for  OR 
+		);
+		
+		this.model=model;
+
+		
+	}
+	
+	// TODO
+	
+	public void start(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+	public void stop(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+			
+	/**
+	 * invoked for the first notification just after a subscription
+	 * @see it.cnr.isti.niche.osgi.upnp.util.UPnPStateVariableDescriptor#getValue()
+	 */
+	public Object getValue(){
+	
+		return model.getBeatPeriodStateVariableValue();
+		
+	}
+};
+	
+
+	// UPnPAction classes
+	
+	
+
+public class GetUpTimeAction extends AbstractUPnPAction {
+
+	HeartBeatModel model;
+	
+	// HERE specific action members
+	
+	public GetUpTimeAction(
+	    UPnPService upnpService,
+		HeartBeatModel model
+	){
+		super(
+			upnpService,
+			"GetUpTime",
+			""
+		);
+		this.model=model;
+		
+			addOutArg(
+				"CurrentUpTime",
+				upnpService.getStateVariable("UpTime")
+			);
+		
+			addOutArg(
+				"LiveID",
+				upnpService.getStateVariable("LiveID")
+			);
+		
+			addOutArg(
+				"StartTime",
+				upnpService.getStateVariable("StartTime")
+			);
+		
+			addOutArg(
+				"CurrentBeatPeriod",
+				upnpService.getStateVariable("BeatPeriod")
+			);
+		
+	}
+
+	/**
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary _args) throws Exception {
+
+	IntegerHolder currentUpTime = new IntegerHolder();
+		IntegerHolder liveID = new IntegerHolder();
+		DateHolder startTime = new DateHolder();
+		IntegerHolder currentBeatPeriod = new IntegerHolder();
+		
+
+		// invoke model
+		
+		 model.getUpTime(
+			currentUpTime,
+
+liveID,
+
+startTime,
+
+currentBeatPeriod
+		 );
+		
+		// build returned Dictionary		
+		Dictionary _result = new Hashtable();
+		
+			_result.put("CurrentUpTime",currentUpTime.getObject());
+			// java.lang.Integer
+			_result.put("LiveID",liveID.getObject());
+			// java.lang.Integer
+			_result.put("StartTime",startTime.getObject());
+			// java.util.Date
+			_result.put("CurrentBeatPeriod",currentBeatPeriod.getObject());
+			// java.lang.Integer
+		return _result.isEmpty()?null:_result;
+	}
+
+
+	public void start(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+	public void stop(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+};
+
+
+public class GetBeatPeriodAction extends AbstractUPnPAction {
+
+	HeartBeatModel model;
+	
+	// HERE specific action members
+	
+	public GetBeatPeriodAction(
+	    UPnPService upnpService,
+		HeartBeatModel model
+	){
+		super(
+			upnpService,
+			"GetBeatPeriod",
+			""
+		);
+		this.model=model;
+		
+			addOutArg(
+				"CurrentBeatPeriod",
+				upnpService.getStateVariable("BeatPeriod")
+			);
+		
+	}
+
+	/**
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary _args) throws Exception {
+
+	IntegerHolder currentBeatPeriod = new IntegerHolder();
+		
+
+		// invoke model
+		
+		 model.getBeatPeriod(
+			currentBeatPeriod
+		 );
+		
+		// build returned Dictionary		
+		Dictionary _result = new Hashtable();
+		
+			_result.put("CurrentBeatPeriod",currentBeatPeriod.getObject());
+			// java.lang.Integer
+		return _result.isEmpty()?null:_result;
+	}
+
+
+	public void start(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+	public void stop(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+};
+
+
+public class SetBeatPeriodAction extends AbstractUPnPAction {
+
+	HeartBeatModel model;
+	
+	// HERE specific action members
+	
+	public SetBeatPeriodAction(
+	    UPnPService upnpService,
+		HeartBeatModel model
+	){
+		super(
+			upnpService,
+			"SetBeatPeriod",
+			""
+		);
+		this.model=model;
+		
+			addInArg(
+				"NewBeatPeriod",
+				upnpService.getStateVariable("BeatPeriod")
+			);
+		
+	}
+
+	/**
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary _args) throws Exception {
+
+	java.lang.Integer newBeatPeriod = (java.lang.Integer) _args.get("NewBeatPeriod");
+		
+
+		// invoke model
+		
+		 model.setBeatPeriod(
+			IntegerHolder.toValue(
+			newBeatPeriod)
+		
+		 );
+		
+		// build returned Dictionary		
+		Dictionary _result = new Hashtable();
+		
+		return _result.isEmpty()?null:_result;
+	}
+
+
+	public void start(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+	
+	public void stop(BundleContext bundleContext) throws Exception {
+		// TODO
+	}
+};
+	
+}

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/java/org/apache/felix/upnp/heartbeat/service/HeartBeat.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart128.png
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart128.png?rev=789770&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart128.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart16.png
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart16.png?rev=789770&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart16.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart32.png
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart32.png?rev=789770&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart32.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart48.png
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart48.png?rev=789770&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart48.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart64.png
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart64.png?rev=789770&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/donsez/upnp.heartbeat/src/main/resources/icon/heart64.png
------------------------------------------------------------------------------
    svn:mime-type = image/png



Mime
View raw message