You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by do...@apache.org on 2007/05/01 01:15:18 UTC
svn commit: r533875 [29/30] - in
/incubator/felix/sandbox/donsez/upnp.devicegen: ./ doc/ generation/
generation/res/ generation/res/device/ generation/res/service/ manifest/
src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/
src...
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/securitycamera/service/DigitalSecurityCameraStillImage.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/securitycamera/service/DigitalSecurityCameraStillImage.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/securitycamera/service/DigitalSecurityCameraStillImage.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/securitycamera/service/DigitalSecurityCameraStillImage.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,1462 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.securitycamera.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.devicegen.securitycamera.model.*;
+import org.apache.felix.upnp.devicegen.securitycamera.impl.*;
+
+
+
+public class DigitalSecurityCameraStillImage extends AbstractUPnPService {
+
+
+ private DigitalSecurityCameraStillImageModel model;
+
+ /**
+ * constructor
+ */
+ public DigitalSecurityCameraStillImage(
+ UPnPDevice upnpDevice,
+ String serviceId,
+ String serviceType,
+ String version,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpDevice,
+ serviceId,
+ serviceType,
+ version
+ );
+ this.model=model;
+
+
+ stateVariables=new HashMap();
+
+
+
+ stateVariables.put(
+ "AvailableEncodings",
+ new AvailableEncodingsStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "DefaultEncoding",
+ new DefaultEncodingStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "AvailableCompressionLevels",
+ new AvailableCompressionLevelsStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "DefaultCompressionLevel",
+ new DefaultCompressionLevelStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "AvailableResolutions",
+ new AvailableResolutionsStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "DefaultResolution",
+ new DefaultResolutionStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "ImageURL",
+ new ImageURLStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "ImagePresentationURL",
+ new ImagePresentationURLStateVariable(this,model)
+ );
+
+ actions=new HashMap();
+
+
+
+ actions.put(
+ "GetAvailableEncodings",
+ new GetAvailableEncodingsAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetDefaultEncoding",
+ new GetDefaultEncodingAction(this,model)
+ );
+
+
+
+ actions.put(
+ "SetDefaultEncoding",
+ new SetDefaultEncodingAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetAvailableCompressionLevels",
+ new GetAvailableCompressionLevelsAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetDefaultCompressionLevel",
+ new GetDefaultCompressionLevelAction(this,model)
+ );
+
+
+
+ actions.put(
+ "SetDefaultCompressionLevel",
+ new SetDefaultCompressionLevelAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetAvailableResolutions",
+ new GetAvailableResolutionsAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetDefaultResolution",
+ new GetDefaultResolutionAction(this,model)
+ );
+
+
+
+ actions.put(
+ "SetDefaultResolution",
+ new SetDefaultResolutionAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetImageURL",
+ new GetImageURLAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetDefaultImageURL",
+ new GetDefaultImageURLAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetImagePresentationURL",
+ new GetImagePresentationURLAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetDefaultImagePresentationURL",
+ new GetDefaultImagePresentationURLAction(this,model)
+ );
+
+ }
+
+ // UPnPStateVariable classes
+
+
+
+// class AvailableEncodingsStateVariable
+public class AvailableEncodingsStateVariable
+ extends AbstractUPnPStateVariable
+
+ {
+
+ public final static String NAME="AvailableEncodings";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DigitalSecurityCameraStillImageModel model;
+
+ public AvailableEncodingsStateVariable(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel 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 DefaultEncodingStateVariable
+public class DefaultEncodingStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="DefaultEncoding";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DigitalSecurityCameraStillImageModel model;
+
+ public DefaultEncodingStateVariable(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel 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.getDefaultEncodingStateVariableValue();
+
+ }
+};
+
+
+// class AvailableCompressionLevelsStateVariable
+public class AvailableCompressionLevelsStateVariable
+ extends AbstractUPnPStateVariable
+
+ {
+
+ public final static String NAME="AvailableCompressionLevels";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DigitalSecurityCameraStillImageModel model;
+
+ public AvailableCompressionLevelsStateVariable(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel 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 DefaultCompressionLevelStateVariable
+public class DefaultCompressionLevelStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="DefaultCompressionLevel";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DigitalSecurityCameraStillImageModel model;
+
+ public DefaultCompressionLevelStateVariable(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel 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.getDefaultCompressionLevelStateVariableValue();
+
+ }
+};
+
+
+// class AvailableResolutionsStateVariable
+public class AvailableResolutionsStateVariable
+ extends AbstractUPnPStateVariable
+
+ {
+
+ public final static String NAME="AvailableResolutions";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DigitalSecurityCameraStillImageModel model;
+
+ public AvailableResolutionsStateVariable(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel 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 DefaultResolutionStateVariable
+public class DefaultResolutionStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="DefaultResolution";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DigitalSecurityCameraStillImageModel model;
+
+ public DefaultResolutionStateVariable(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel 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.getDefaultResolutionStateVariableValue();
+
+ }
+};
+
+
+// class ImageURLStateVariable
+public class ImageURLStateVariable
+ extends AbstractUPnPStateVariable
+
+ {
+
+ public final static String NAME="ImageURL";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DigitalSecurityCameraStillImageModel model;
+
+ public ImageURLStateVariable(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel 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 ImagePresentationURLStateVariable
+public class ImagePresentationURLStateVariable
+ extends AbstractUPnPStateVariable
+
+ {
+
+ public final static String NAME="ImagePresentationURL";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DigitalSecurityCameraStillImageModel model;
+
+ public ImagePresentationURLStateVariable(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel 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;
+ }
+};
+
+
+ // UPnPAction classes
+
+
+
+public class GetAvailableEncodingsAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetAvailableEncodingsAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetAvailableEncodings",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetAvailableEncodings",
+ upnpService.getStateVariable("AvailableEncodings")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder retAvailableEncodings = new StringHolder();
+
+
+ // invoke model
+
+ model.getAvailableEncodings(
+ retAvailableEncodings
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetAvailableEncodings",retAvailableEncodings.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class GetDefaultEncodingAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetDefaultEncodingAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetDefaultEncoding",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetEncoding",
+ upnpService.getStateVariable("DefaultEncoding")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder retEncoding = new StringHolder();
+
+
+ // invoke model
+
+ model.getDefaultEncoding(
+ retEncoding
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetEncoding",retEncoding.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class SetDefaultEncodingAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public SetDefaultEncodingAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "SetDefaultEncoding",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "ReqEncoding",
+ upnpService.getStateVariable("DefaultEncoding")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String reqEncoding = (java.lang.String) _args.get("ReqEncoding");
+
+
+ // invoke model
+
+ model.setDefaultEncoding(
+ StringHolder.toValue(
+ reqEncoding)
+
+ );
+
+ // 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
+ }
+};
+
+
+public class GetAvailableCompressionLevelsAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetAvailableCompressionLevelsAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetAvailableCompressionLevels",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetAvailableCompressionLevels",
+ upnpService.getStateVariable("AvailableCompressionLevels")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder retAvailableCompressionLevels = new StringHolder();
+
+
+ // invoke model
+
+ model.getAvailableCompressionLevels(
+ retAvailableCompressionLevels
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetAvailableCompressionLevels",retAvailableCompressionLevels.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class GetDefaultCompressionLevelAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetDefaultCompressionLevelAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetDefaultCompressionLevel",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetCompressionLevel",
+ upnpService.getStateVariable("DefaultCompressionLevel")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder retCompressionLevel = new StringHolder();
+
+
+ // invoke model
+
+ model.getDefaultCompressionLevel(
+ retCompressionLevel
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetCompressionLevel",retCompressionLevel.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class SetDefaultCompressionLevelAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public SetDefaultCompressionLevelAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "SetDefaultCompressionLevel",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "ReqCompressionLevel",
+ upnpService.getStateVariable("DefaultCompressionLevel")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String reqCompressionLevel = (java.lang.String) _args.get("ReqCompressionLevel");
+
+
+ // invoke model
+
+ model.setDefaultCompressionLevel(
+ StringHolder.toValue(
+ reqCompressionLevel)
+
+ );
+
+ // 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
+ }
+};
+
+
+public class GetAvailableResolutionsAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetAvailableResolutionsAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetAvailableResolutions",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetAvailableResolutions",
+ upnpService.getStateVariable("AvailableResolutions")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder retAvailableResolutions = new StringHolder();
+
+
+ // invoke model
+
+ model.getAvailableResolutions(
+ retAvailableResolutions
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetAvailableResolutions",retAvailableResolutions.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class GetDefaultResolutionAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetDefaultResolutionAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetDefaultResolution",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetResolution",
+ upnpService.getStateVariable("DefaultResolution")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder retResolution = new StringHolder();
+
+
+ // invoke model
+
+ model.getDefaultResolution(
+ retResolution
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetResolution",retResolution.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class SetDefaultResolutionAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public SetDefaultResolutionAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "SetDefaultResolution",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "ReqResolution",
+ upnpService.getStateVariable("DefaultResolution")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String reqResolution = (java.lang.String) _args.get("ReqResolution");
+
+
+ // invoke model
+
+ model.setDefaultResolution(
+ StringHolder.toValue(
+ reqResolution)
+
+ );
+
+ // 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
+ }
+};
+
+
+public class GetImageURLAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetImageURLAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetImageURL",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "ReqEncoding",
+ upnpService.getStateVariable("DefaultEncoding")
+ );
+
+ addInArg(
+ "ReqCompression",
+ upnpService.getStateVariable("DefaultCompressionLevel")
+ );
+
+ addInArg(
+ "ReqResolution",
+ upnpService.getStateVariable("DefaultResolution")
+ );
+
+ addOutArg(
+ "RetImageURL",
+ upnpService.getStateVariable("ImageURL")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String reqEncoding = (java.lang.String) _args.get("ReqEncoding");
+ java.lang.String reqCompression = (java.lang.String) _args.get("ReqCompression");
+ java.lang.String reqResolution = (java.lang.String) _args.get("ReqResolution");
+ StringHolder retImageURL = new StringHolder();
+
+
+ // invoke model
+
+ model.getImageURL(
+ StringHolder.toValue(
+ reqEncoding)
+ ,
+
+StringHolder.toValue(
+ reqCompression)
+ ,
+
+StringHolder.toValue(
+ reqResolution)
+ ,
+
+retImageURL
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetImageURL",retImageURL.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class GetDefaultImageURLAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetDefaultImageURLAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetDefaultImageURL",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetImageURL",
+ upnpService.getStateVariable("ImageURL")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder retImageURL = new StringHolder();
+
+
+ // invoke model
+
+ model.getDefaultImageURL(
+ retImageURL
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetImageURL",retImageURL.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class GetImagePresentationURLAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetImagePresentationURLAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetImagePresentationURL",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "ReqEncoding",
+ upnpService.getStateVariable("DefaultEncoding")
+ );
+
+ addInArg(
+ "ReqCompression",
+ upnpService.getStateVariable("DefaultCompressionLevel")
+ );
+
+ addInArg(
+ "ReqResolution",
+ upnpService.getStateVariable("DefaultResolution")
+ );
+
+ addOutArg(
+ "RetImagePresentationURL",
+ upnpService.getStateVariable("ImagePresentationURL")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String reqEncoding = (java.lang.String) _args.get("ReqEncoding");
+ java.lang.String reqCompression = (java.lang.String) _args.get("ReqCompression");
+ java.lang.String reqResolution = (java.lang.String) _args.get("ReqResolution");
+ StringHolder retImagePresentationURL = new StringHolder();
+
+
+ // invoke model
+
+ model.getImagePresentationURL(
+ StringHolder.toValue(
+ reqEncoding)
+ ,
+
+StringHolder.toValue(
+ reqCompression)
+ ,
+
+StringHolder.toValue(
+ reqResolution)
+ ,
+
+retImagePresentationURL
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetImagePresentationURL",retImagePresentationURL.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class GetDefaultImagePresentationURLAction extends AbstractUPnPAction {
+
+ DigitalSecurityCameraStillImageModel model;
+
+ // HERE specific action members
+
+ public GetDefaultImagePresentationURLAction(
+ UPnPService upnpService,
+ DigitalSecurityCameraStillImageModel model
+ ){
+ super(
+ upnpService,
+ "GetDefaultImagePresentationURL",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetImagePresentationURL",
+ upnpService.getStateVariable("ImagePresentationURL")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder retImagePresentationURL = new StringHolder();
+
+
+ // invoke model
+
+ model.getDefaultImagePresentationURL(
+ retImagePresentationURL
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetImagePresentationURL",retImagePresentationURL.getObject());
+ // java.lang.String
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/securitycamera/service/DigitalSecurityCameraStillImage.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/device/SimpleTV.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/device/SimpleTV.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/device/SimpleTV.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/device/SimpleTV.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,150 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.device;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.upnp.UPnPDevice;
+import org.osgi.service.upnp.UPnPIcon;
+import org.osgi.service.upnp.UPnPService;
+
+import org.apache.felix.upnp.devicegen.util.AbstractUPnPDevice;
+import org.apache.felix.upnp.devicegen.util.DeviceIcon;
+
+import org.apache.felix.upnp.devicegen.tv.model.*;
+import org.apache.felix.upnp.devicegen.tv.service.*;
+import org.apache.felix.upnp.devicegen.tv.impl.*;
+
+
+
+
+public class SimpleTV extends AbstractUPnPDevice {
+
+ public SimpleTV(BundleContext context, AbstractUPnPDevice parent) {
+ super(context,parent);
+
+ DEVICE_ID="uuid:adele-simple-tv";
+
+ // ServiceModel Declaration List
+ SwitchPowerModel mySwitchPowerModel=null; // TODO initialise it
+ChannelSelectorModel myChannelSelectorModel=null; // TODO initialise it
+VolumeSelectorModel myVolumeSelectorModel=null; // TODO initialise it
+
+
+ // Icon Lists
+
+ List iconsList=new LinkedList();
+
+ iconsList.add(
+ new DeviceIcon(
+ "image/png", // MimeType
+ 48, //Width
+ 48, // Height
+ 0, // ??
+ 16, // Depth
+ "/icon/tv.png", // URL
+ SimpleTV.class.getClassLoader()
+ )
+ );
+
+ icons=(UPnPIcon[])iconsList.toArray(new UPnPIcon[]{});
+
+
+ // Service List
+
+ List servicesList=new LinkedList();
+
+
+ /*
+ SCPDURL=URL to service description
+ controlURL=URL for control
+ eventSubURL=URL for eventing
+ */
+ servicesList.add(
+ new SwitchPower(
+ this,
+ "urn:upnp-org:serviceId:SwitchPower:1",
+ "urn:schemas-upnp-org:service:SwitchPower:1",
+ "1",
+ mySwitchPowerModel
+ )
+ );
+
+
+ /*
+ SCPDURL=URL to service description
+ controlURL=URL for control
+ eventSubURL=URL for eventing
+ */
+ servicesList.add(
+ new ChannelSelector(
+ this,
+ "urn:felix-apache.org:serviceId:ChannelSelector:1",
+ "urn:schemas-felix-apache.org:service:ChannelSelector:1",
+ "1",
+ myChannelSelectorModel
+ )
+ );
+
+
+ /*
+ SCPDURL=URL to service description
+ controlURL=URL for control
+ eventSubURL=URL for eventing
+ */
+ servicesList.add(
+ new VolumeSelector(
+ this,
+ "urn:felix-apache.org:serviceId:VolumeSelector:1",
+ "urn:schemas-felix-apache.org:service:VolumeSelector:1",
+ "1",
+ myVolumeSelectorModel
+ )
+ );
+
+ services=(UPnPService[])servicesList.toArray(new UPnPService[]{});
+
+
+ // Embedded Device List
+
+ //children=new LinkedList();
+
+
+ }
+
+ protected void setupDeviceProperties(){
+ dictionary.put(UPnPDevice.TYPE,"urn:schemas-felix-apache.org:device:SimpleTV:1");
+ dictionary.put(UPnPDevice.FRIENDLY_NAME,"Generated Simple TV UPnP Device");
+ dictionary.put(UPnPDevice.MANUFACTURER,"Didier Donsez (Felix team)");
+ dictionary.put(UPnPDevice.MANUFACTURER_URL,"http://www.apache.org/~donsez");
+ dictionary.put(UPnPDevice.MODEL_DESCRIPTION,"Generated Simple TV UPnP Device");
+ dictionary.put(UPnPDevice.MODEL_NAME,"Simple TV");
+ dictionary.put(UPnPDevice.MODEL_NUMBER,"123");
+ dictionary.put(UPnPDevice.MODEL_URL,"http://www.apache.org/~donsez/dev/osgi/upnp.devicegen/readme.html");
+ dictionary.put(UPnPDevice.SERIAL_NUMBER,"123456789");
+ dictionary.put(UPnPDevice.UDN,getUDN());
+ dictionary.put(UPnPDevice.ID,dictionary.get(UPnPDevice.UDN));
+ dictionary.put(UPnPDevice.UPC,"upc:adele-simple-tv");
+ dictionary.put(UPnPDevice.PRESENTATION_URL,"http://www.apache.org/~donsez/dev/osgi/upnp.devicegen/readme.html");
+
+ 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);
+ }
+
+ }
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/device/SimpleTV.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/ChannelSelectorModelImpl.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/ChannelSelectorModelImpl.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/ChannelSelectorModelImpl.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/ChannelSelectorModelImpl.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,50 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.impl;
+
+import org.apache.felix.upnp.devicegen.holder.*;
+import org.apache.felix.upnp.devicegen.tv.model.*;
+
+
+public class ChannelSelectorModelImpl implements ChannelSelectorModel {
+
+ /**
+ * This method is "add description here"
+ * newChannelValue in parameter
+
+
+ */
+ public void setChannel(
+ int newChannelValue
+ ) {
+ // TODO
+
+ }
+
+
+ /**
+ * This method is "add description here"
+ * retChannelValue out parameter
+
+
+ */
+ public void getChannel(
+ IntegerHolder retChannelValue
+ ) {
+ // TODO
+
+ }
+
+
+
+ // Those getters are used for the first notification just after a subscription
+
+ public java.lang.Integer getChannelStateVariableValue(){
+ // TODO
+ return null;
+ }
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/ChannelSelectorModelImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/SwitchPowerModelImpl.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/SwitchPowerModelImpl.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/SwitchPowerModelImpl.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/SwitchPowerModelImpl.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,64 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.impl;
+
+import org.apache.felix.upnp.devicegen.holder.*;
+import org.apache.felix.upnp.devicegen.tv.model.*;
+
+
+public class SwitchPowerModelImpl implements SwitchPowerModel {
+
+ /**
+ * This method is "add description here"
+ * newTargetValue in parameter
+
+
+ */
+ public void setTarget(
+ boolean newTargetValue
+ ) {
+ // TODO
+
+ }
+
+
+ /**
+ * This method is "add description here"
+ * retTargetValue out parameter
+
+
+ */
+ public void getTarget(
+ BooleanHolder retTargetValue
+ ) {
+ // TODO
+
+ }
+
+
+ /**
+ * This method is "add description here"
+ * resultStatus out parameter
+
+
+ */
+ public void getStatus(
+ BooleanHolder resultStatus
+ ) {
+ // TODO
+
+ }
+
+
+
+ // Those getters are used for the first notification just after a subscription
+
+ public java.lang.Boolean getStatusStateVariableValue(){
+ // TODO
+ return null;
+ }
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/SwitchPowerModelImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/VolumeSelectorModelImpl.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/VolumeSelectorModelImpl.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/VolumeSelectorModelImpl.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/VolumeSelectorModelImpl.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,111 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.impl;
+
+import org.apache.felix.upnp.devicegen.holder.*;
+import org.apache.felix.upnp.devicegen.tv.model.*;
+
+
+public class VolumeSelectorModelImpl implements VolumeSelectorModel {
+
+ /**
+ * This method is "add description here"
+ * newVolumeDBValue in parameter
+
+
+ */
+ public void setVolumeDB(
+ int newVolumeDBValue
+ ) {
+ // TODO
+
+ }
+
+
+ /**
+ * This method is "add description here"
+ * newMute in parameter
+
+
+ */
+ public void setMute(
+ boolean newMute
+ ) {
+ // TODO
+
+ }
+
+
+ /**
+ * This method is "add description here"
+ * retVolumeDBValue out parameter
+
+
+ */
+ public void getVolumeDB(
+ IntegerHolder retVolumeDBValue
+ ) {
+ // TODO
+
+ }
+
+
+ /**
+ * This method is "add description here"
+ * currentMute out parameter
+
+
+ */
+ public void getMute(
+ BooleanHolder currentMute
+ ) {
+ // TODO
+
+ }
+
+
+ /**
+ * This method is "add description here"
+ * retVolumeDBValue out parameter
+
+
+ */
+ public void incrementVolumeDB(
+ IntegerHolder retVolumeDBValue
+ ) {
+ // TODO
+
+ }
+
+
+ /**
+ * This method is "add description here"
+ * retVolumeDBValue out parameter
+
+
+ */
+ public void decrementVolumeDB(
+ IntegerHolder retVolumeDBValue
+ ) {
+ // TODO
+
+ }
+
+
+
+ // Those getters are used for the first notification just after a subscription
+
+ public java.lang.Integer getVolumeDBStateVariableValue(){
+ // TODO
+ return null;
+ }
+
+ public java.lang.Boolean getMuteStateVariableValue(){
+ // TODO
+ return null;
+ }
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/impl/VolumeSelectorModelImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/ChannelSelectorModel.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/ChannelSelectorModel.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/ChannelSelectorModel.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/ChannelSelectorModel.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,42 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.model;
+
+import org.apache.felix.upnp.devicegen.holder.*;
+
+
+public interface ChannelSelectorModel {
+
+ /**
+ * This method is "add description here"
+ * newChannelValue in parameter
+
+
+ */
+ public void setChannel(
+ int newChannelValue
+ );
+ // TODO return the type of the return argument when specified
+
+
+ /**
+ * This method is "add description here"
+ * retChannelValue out parameter
+
+
+ */
+ public void getChannel(
+ IntegerHolder retChannelValue
+ );
+ // 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 getChannelStateVariableValue();
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/ChannelSelectorModel.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/SwitchPowerModel.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/SwitchPowerModel.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/SwitchPowerModel.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/SwitchPowerModel.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,54 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.model;
+
+import org.apache.felix.upnp.devicegen.holder.*;
+
+
+public interface SwitchPowerModel {
+
+ /**
+ * This method is "add description here"
+ * newTargetValue in parameter
+
+
+ */
+ public void setTarget(
+ boolean newTargetValue
+ );
+ // TODO return the type of the return argument when specified
+
+
+ /**
+ * This method is "add description here"
+ * retTargetValue out parameter
+
+
+ */
+ public void getTarget(
+ BooleanHolder retTargetValue
+ );
+ // TODO return the type of the return argument when specified
+
+
+ /**
+ * This method is "add description here"
+ * resultStatus out parameter
+
+
+ */
+ public void getStatus(
+ BooleanHolder resultStatus
+ );
+ // 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.Boolean getStatusStateVariableValue();
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/SwitchPowerModel.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/VolumeSelectorModel.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/VolumeSelectorModel.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/VolumeSelectorModel.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/VolumeSelectorModel.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,92 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.model;
+
+import org.apache.felix.upnp.devicegen.holder.*;
+
+
+public interface VolumeSelectorModel {
+
+ /**
+ * This method is "add description here"
+ * newVolumeDBValue in parameter
+
+
+ */
+ public void setVolumeDB(
+ int newVolumeDBValue
+ );
+ // TODO return the type of the return argument when specified
+
+
+ /**
+ * This method is "add description here"
+ * newMute in parameter
+
+
+ */
+ public void setMute(
+ boolean newMute
+ );
+ // TODO return the type of the return argument when specified
+
+
+ /**
+ * This method is "add description here"
+ * retVolumeDBValue out parameter
+
+
+ */
+ public void getVolumeDB(
+ IntegerHolder retVolumeDBValue
+ );
+ // TODO return the type of the return argument when specified
+
+
+ /**
+ * This method is "add description here"
+ * currentMute out parameter
+
+
+ */
+ public void getMute(
+ BooleanHolder currentMute
+ );
+ // TODO return the type of the return argument when specified
+
+
+ /**
+ * This method is "add description here"
+ * retVolumeDBValue out parameter
+
+
+ */
+ public void incrementVolumeDB(
+ IntegerHolder retVolumeDBValue
+ );
+ // TODO return the type of the return argument when specified
+
+
+ /**
+ * This method is "add description here"
+ * retVolumeDBValue out parameter
+
+
+ */
+ public void decrementVolumeDB(
+ IntegerHolder retVolumeDBValue
+ );
+ // 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 getVolumeDBStateVariableValue();
+
+ public java.lang.Boolean getMuteStateVariableValue();
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/model/VolumeSelectorModel.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/ChannelSelector.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/ChannelSelector.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/ChannelSelector.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/ChannelSelector.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,253 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.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.devicegen.tv.model.*;
+import org.apache.felix.upnp.devicegen.tv.impl.*;
+
+
+
+public class ChannelSelector extends AbstractUPnPService {
+
+
+ private ChannelSelectorModel model;
+
+ /**
+ * constructor
+ */
+ public ChannelSelector(
+ UPnPDevice upnpDevice,
+ String serviceId,
+ String serviceType,
+ String version,
+ ChannelSelectorModel model
+ ){
+ super(
+ upnpDevice,
+ serviceId,
+ serviceType,
+ version
+ );
+ this.model=model;
+
+
+ stateVariables=new HashMap();
+
+
+
+ stateVariables.put(
+ "Channel",
+ new ChannelStateVariable(this,model)
+ );
+
+ actions=new HashMap();
+
+
+
+ actions.put(
+ "SetChannel",
+ new SetChannelAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetChannel",
+ new GetChannelAction(this,model)
+ );
+
+ }
+
+ // UPnPStateVariable classes
+
+
+
+// class ChannelStateVariable
+public class ChannelStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="Channel";
+ public final static String DATATYPE="int";
+
+ // HERE specific state variable members
+ private ChannelSelectorModel model;
+
+ public ChannelStateVariable(
+ UPnPService upnpService,
+ ChannelSelectorModel model
+ ){
+ super(
+ upnpService,
+ NAME,
+ DATATYPE,
+ null, // TODO defaultValue changed for 1
+ 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.getChannelStateVariableValue();
+
+ }
+};
+
+
+ // UPnPAction classes
+
+
+
+public class SetChannelAction extends AbstractUPnPAction {
+
+ ChannelSelectorModel model;
+
+ // HERE specific action members
+
+ public SetChannelAction(
+ UPnPService upnpService,
+ ChannelSelectorModel model
+ ){
+ super(
+ upnpService,
+ "SetChannel",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "newChannelValue",
+ upnpService.getStateVariable("Channel")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.Integer newChannelValue = (java.lang.Integer) _args.get("newChannelValue");
+
+
+ // invoke model
+
+ model.setChannel(
+ IntegerHolder.toValue(
+ newChannelValue)
+
+ );
+
+ // 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
+ }
+};
+
+
+public class GetChannelAction extends AbstractUPnPAction {
+
+ ChannelSelectorModel model;
+
+ // HERE specific action members
+
+ public GetChannelAction(
+ UPnPService upnpService,
+ ChannelSelectorModel model
+ ){
+ super(
+ upnpService,
+ "GetChannel",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetChannelValue",
+ upnpService.getStateVariable("Channel")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ IntegerHolder retChannelValue = new IntegerHolder();
+
+
+ // invoke model
+
+ model.getChannel(
+ retChannelValue
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetChannelValue",retChannelValue.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
+ }
+};
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/ChannelSelector.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/SwitchPower.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/SwitchPower.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/SwitchPower.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/SwitchPower.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,380 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.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.devicegen.tv.model.*;
+import org.apache.felix.upnp.devicegen.tv.impl.*;
+
+
+
+public class SwitchPower extends AbstractUPnPService {
+
+
+ private SwitchPowerModel model;
+
+ /**
+ * constructor
+ */
+ public SwitchPower(
+ UPnPDevice upnpDevice,
+ String serviceId,
+ String serviceType,
+ String version,
+ SwitchPowerModel model
+ ){
+ super(
+ upnpDevice,
+ serviceId,
+ serviceType,
+ version
+ );
+ this.model=model;
+
+
+ stateVariables=new HashMap();
+
+
+
+ stateVariables.put(
+ "Target",
+ new TargetStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "Status",
+ new StatusStateVariable(this,model)
+ );
+
+ actions=new HashMap();
+
+
+
+ actions.put(
+ "SetTarget",
+ new SetTargetAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetTarget",
+ new GetTargetAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetStatus",
+ new GetStatusAction(this,model)
+ );
+
+ }
+
+ // UPnPStateVariable classes
+
+
+
+// class TargetStateVariable
+public class TargetStateVariable
+ extends AbstractUPnPStateVariable
+
+ {
+
+ public final static String NAME="Target";
+ public final static String DATATYPE="boolean";
+
+ // HERE specific state variable members
+ private SwitchPowerModel model;
+
+ public TargetStateVariable(
+ UPnPService upnpService,
+ SwitchPowerModel model
+ ){
+ super(
+ upnpService,
+ NAME,
+ DATATYPE,
+ null, // TODO defaultValue changed for 0
+ 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 StatusStateVariable
+public class StatusStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="Status";
+ public final static String DATATYPE="boolean";
+
+ // HERE specific state variable members
+ private SwitchPowerModel model;
+
+ public StatusStateVariable(
+ UPnPService upnpService,
+ SwitchPowerModel model
+ ){
+ super(
+ upnpService,
+ NAME,
+ DATATYPE,
+ null, // TODO defaultValue changed for 0
+ 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.getStatusStateVariableValue();
+
+ }
+};
+
+
+ // UPnPAction classes
+
+
+
+public class SetTargetAction extends AbstractUPnPAction {
+
+ SwitchPowerModel model;
+
+ // HERE specific action members
+
+ public SetTargetAction(
+ UPnPService upnpService,
+ SwitchPowerModel model
+ ){
+ super(
+ upnpService,
+ "SetTarget",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "newTargetValue",
+ upnpService.getStateVariable("Target")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.Boolean newTargetValue = (java.lang.Boolean) _args.get("newTargetValue");
+
+
+ // invoke model
+
+ model.setTarget(
+ BooleanHolder.toValue(
+ newTargetValue)
+
+ );
+
+ // 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
+ }
+};
+
+
+public class GetTargetAction extends AbstractUPnPAction {
+
+ SwitchPowerModel model;
+
+ // HERE specific action members
+
+ public GetTargetAction(
+ UPnPService upnpService,
+ SwitchPowerModel model
+ ){
+ super(
+ upnpService,
+ "GetTarget",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetTargetValue",
+ upnpService.getStateVariable("Target")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ BooleanHolder retTargetValue = new BooleanHolder();
+
+
+ // invoke model
+
+ model.getTarget(
+ retTargetValue
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetTargetValue",retTargetValue.getObject());
+ // java.lang.Boolean
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class GetStatusAction extends AbstractUPnPAction {
+
+ SwitchPowerModel model;
+
+ // HERE specific action members
+
+ public GetStatusAction(
+ UPnPService upnpService,
+ SwitchPowerModel model
+ ){
+ super(
+ upnpService,
+ "GetStatus",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "ResultStatus",
+ upnpService.getStateVariable("Status")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ BooleanHolder resultStatus = new BooleanHolder();
+
+
+ // invoke model
+
+ model.getStatus(
+ resultStatus
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("ResultStatus",resultStatus.getObject());
+ // java.lang.Boolean
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/SwitchPower.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/VolumeSelector.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/VolumeSelector.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/VolumeSelector.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/VolumeSelector.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,574 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.tv.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.devicegen.tv.model.*;
+import org.apache.felix.upnp.devicegen.tv.impl.*;
+
+
+
+public class VolumeSelector extends AbstractUPnPService {
+
+
+ private VolumeSelectorModel model;
+
+ /**
+ * constructor
+ */
+ public VolumeSelector(
+ UPnPDevice upnpDevice,
+ String serviceId,
+ String serviceType,
+ String version,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpDevice,
+ serviceId,
+ serviceType,
+ version
+ );
+ this.model=model;
+
+
+ stateVariables=new HashMap();
+
+
+
+ stateVariables.put(
+ "VolumeDB",
+ new VolumeDBStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "Mute",
+ new MuteStateVariable(this,model)
+ );
+
+ actions=new HashMap();
+
+
+
+ actions.put(
+ "SetVolumeDB",
+ new SetVolumeDBAction(this,model)
+ );
+
+
+
+ actions.put(
+ "SetMute",
+ new SetMuteAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetVolumeDB",
+ new GetVolumeDBAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetMute",
+ new GetMuteAction(this,model)
+ );
+
+
+
+ actions.put(
+ "IncrementVolumeDB",
+ new IncrementVolumeDBAction(this,model)
+ );
+
+
+
+ actions.put(
+ "DecrementVolumeDB",
+ new DecrementVolumeDBAction(this,model)
+ );
+
+ }
+
+ // UPnPStateVariable classes
+
+
+
+// class VolumeDBStateVariable
+public class VolumeDBStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="VolumeDB";
+ public final static String DATATYPE="int";
+
+ // HERE specific state variable members
+ private VolumeSelectorModel model;
+
+ public VolumeDBStateVariable(
+ UPnPService upnpService,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpService,
+ NAME,
+ DATATYPE,
+ null, // TODO defaultValue changed for 0
+ 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.getVolumeDBStateVariableValue();
+
+ }
+};
+
+
+// class MuteStateVariable
+public class MuteStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="Mute";
+ public final static String DATATYPE="boolean";
+
+ // HERE specific state variable members
+ private VolumeSelectorModel model;
+
+ public MuteStateVariable(
+ UPnPService upnpService,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpService,
+ NAME,
+ DATATYPE,
+ null, // TODO defaultValue changed for false
+ 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.getMuteStateVariableValue();
+
+ }
+};
+
+
+ // UPnPAction classes
+
+
+
+public class SetVolumeDBAction extends AbstractUPnPAction {
+
+ VolumeSelectorModel model;
+
+ // HERE specific action members
+
+ public SetVolumeDBAction(
+ UPnPService upnpService,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpService,
+ "SetVolumeDB",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "newVolumeDBValue",
+ upnpService.getStateVariable("VolumeDB")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.Integer newVolumeDBValue = (java.lang.Integer) _args.get("newVolumeDBValue");
+
+
+ // invoke model
+
+ model.setVolumeDB(
+ IntegerHolder.toValue(
+ newVolumeDBValue)
+
+ );
+
+ // 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
+ }
+};
+
+
+public class SetMuteAction extends AbstractUPnPAction {
+
+ VolumeSelectorModel model;
+
+ // HERE specific action members
+
+ public SetMuteAction(
+ UPnPService upnpService,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpService,
+ "SetMute",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "NewMute",
+ upnpService.getStateVariable("Mute")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.Boolean newMute = (java.lang.Boolean) _args.get("NewMute");
+
+
+ // invoke model
+
+ model.setMute(
+ BooleanHolder.toValue(
+ newMute)
+
+ );
+
+ // 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
+ }
+};
+
+
+public class GetVolumeDBAction extends AbstractUPnPAction {
+
+ VolumeSelectorModel model;
+
+ // HERE specific action members
+
+ public GetVolumeDBAction(
+ UPnPService upnpService,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpService,
+ "GetVolumeDB",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetVolumeDBValue",
+ upnpService.getStateVariable("VolumeDB")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ IntegerHolder retVolumeDBValue = new IntegerHolder();
+
+
+ // invoke model
+
+ model.getVolumeDB(
+ retVolumeDBValue
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetVolumeDBValue",retVolumeDBValue.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 GetMuteAction extends AbstractUPnPAction {
+
+ VolumeSelectorModel model;
+
+ // HERE specific action members
+
+ public GetMuteAction(
+ UPnPService upnpService,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpService,
+ "GetMute",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "CurrentMute",
+ upnpService.getStateVariable("Mute")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ BooleanHolder currentMute = new BooleanHolder();
+
+
+ // invoke model
+
+ model.getMute(
+ currentMute
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("CurrentMute",currentMute.getObject());
+ // java.lang.Boolean
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class IncrementVolumeDBAction extends AbstractUPnPAction {
+
+ VolumeSelectorModel model;
+
+ // HERE specific action members
+
+ public IncrementVolumeDBAction(
+ UPnPService upnpService,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpService,
+ "IncrementVolumeDB",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetVolumeDBValue",
+ upnpService.getStateVariable("VolumeDB")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ IntegerHolder retVolumeDBValue = new IntegerHolder();
+
+
+ // invoke model
+
+ model.incrementVolumeDB(
+ retVolumeDBValue
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetVolumeDBValue",retVolumeDBValue.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 DecrementVolumeDBAction extends AbstractUPnPAction {
+
+ VolumeSelectorModel model;
+
+ // HERE specific action members
+
+ public DecrementVolumeDBAction(
+ UPnPService upnpService,
+ VolumeSelectorModel model
+ ){
+ super(
+ upnpService,
+ "DecrementVolumeDB",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "RetVolumeDBValue",
+ upnpService.getStateVariable("VolumeDB")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ IntegerHolder retVolumeDBValue = new IntegerHolder();
+
+
+ // invoke model
+
+ model.decrementVolumeDB(
+ retVolumeDBValue
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("RetVolumeDBValue",retVolumeDBValue.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
+ }
+};
+
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/tv/service/VolumeSelector.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPAction.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPAction.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPAction.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPAction.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,98 @@
+/*
+ * @author donsez
+ */
+
+package org.apache.felix.upnp.devicegen.util;
+
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPService;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+/*
+ * @author donsez
+ */
+
+public abstract class AbstractUPnPAction
+ implements UPnPAction, BundleActivator {
+ final private UPnPService upnpService;
+ final private String NAME;
+ final private String RESULT_STATUS;
+ private String[] IN_ARG_NAMES;
+ private String[] OUT_ARG_NAMES;
+ private Map inArgNames=new HashMap();
+ private Map outArgNames=new HashMap();
+
+ // HERE specific action members
+
+ public AbstractUPnPAction(
+ UPnPService upnpService,
+ String NAME,
+ String RESULT_STATUS
+ ){
+ this.upnpService=upnpService;
+ this.NAME=NAME;
+ this.RESULT_STATUS=RESULT_STATUS;
+ }
+
+ protected void addInArg(String argName,UPnPStateVariable upnpStateVariable){
+ inArgNames.put(argName,upnpStateVariable);
+ }
+
+ protected void addOutArg(String argName,UPnPStateVariable upnpStateVariable){
+ outArgNames.put(argName,upnpStateVariable);
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#getName()
+ */
+ public String getName() {
+ return NAME;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
+ */
+ public String getReturnArgumentName() {
+ return RESULT_STATUS;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
+ */
+ public String[] getInputArgumentNames() {
+ if(IN_ARG_NAMES==null)
+ IN_ARG_NAMES=(String[]) inArgNames.keySet().toArray(new String[]{});
+ return IN_ARG_NAMES;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
+ */
+ public String[] getOutputArgumentNames() {
+ if(OUT_ARG_NAMES==null)
+ OUT_ARG_NAMES=(String[]) outArgNames.keySet().toArray(new String[]{});
+ return OUT_ARG_NAMES;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
+ */
+ public UPnPStateVariable getStateVariable(String argumentName) {
+ UPnPStateVariable sv=(UPnPStateVariable)inArgNames.get(argumentName);
+ if(sv!=null) return sv;
+ return (UPnPStateVariable)outArgNames.get(argumentName);
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public abstract Dictionary invoke(Dictionary args) throws Exception;
+ public abstract void start(BundleContext bundleContext) throws Exception;
+ public abstract void stop(BundleContext bundleContext) throws Exception;
+}
\ No newline at end of file
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPDevice.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPDevice.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPDevice.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPDevice.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,181 @@
+/*
+ */
+package org.apache.felix.upnp.devicegen.util;
+
+
+import java.beans.PropertyChangeEvent;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.upnp.UPnPDevice;
+import org.osgi.service.upnp.UPnPIcon;
+import org.osgi.service.upnp.UPnPService;
+
+/**
+ * @author donsez
+ */
+public abstract class AbstractUPnPDevice implements BundleActivator, UPnPDevice {
+
+ protected BundleContext bundleContext;
+
+ protected UPnPService[] services;
+
+ protected UPnPIcon[] icons;
+
+ protected String DEVICE_ID;
+
+ protected Dictionary dictionary;
+
+ protected UPnPEventNotifier[] notifiers;
+
+ private ServiceRegistration serviceRegistration;
+
+ protected List/*<AbstractUPnPDevice>*/ children;
+ protected AbstractUPnPDevice parent;
+
+ public AbstractUPnPDevice(BundleContext bundleContext,AbstractUPnPDevice parent) {
+ this.bundleContext = bundleContext;
+ this.parent = parent;
+
+ dictionary = new Properties();
+ dictionary.put(UPnPDevice.UPNP_EXPORT,"");
+ dictionary.put(org.osgi.service.device.Constants.DEVICE_CATEGORY,new String[]{UPnPDevice.DEVICE_CATEGORY});
+ if(parent!=null) dictionary.put(UPnPDevice.PARENT_UDN,parent.getUDN());
+
+ List servicesList = new ArrayList();
+ List iconList = new ArrayList();
+ }
+
+ /**
+ *
+ */
+ private String myUDN;
+
+ public String getUDN() {
+ if (myUDN == null) {
+ try {
+ myUDN = DEVICE_ID + '@'
+ + InetAddress.getLocalHost().getHostAddress();
+ } catch (UnknownHostException e) {
+ myUDN = DEVICE_ID;
+ }
+ }
+ return myUDN;
+ }
+
+ protected abstract void setupDeviceProperties();
+
+ /**
+ * @see org.osgi.service.upnp.UPnPDevice#getService(java.lang.String)
+ */
+ public UPnPService getService(String serviceId) {
+ for (int s = 0; s < services.length; s++)
+ if (serviceId.equals(services[s].getId()))
+ return services[s];
+ return null;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPDevice#getServices()
+ */
+ public UPnPService[] getServices() {
+ return services;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
+ */
+ public UPnPIcon[] getIcons(String locale) {
+ return icons;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPDevice#getDescriptions(java.lang.String)
+ */
+ public Dictionary getDescriptions(String locale) {
+ return dictionary;
+ }
+
+ protected void addChild(AbstractUPnPDevice childDevice){
+ if(children==null) children=new LinkedList();
+ children.add(childDevice);
+ }
+
+ /**
+ *
+ */
+ private void buildEventNotifier() {
+ notifiers = new UPnPEventNotifier[services.length];
+ for (int n = 0; n < notifiers.length; n++)
+ notifiers[n] = new UPnPEventNotifier(bundleContext, this, services[n],
+ null);
+ }
+
+ /**
+ * @throws Exception
+ *
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ this.bundleContext=bundleContext;
+
+ setupDeviceProperties();
+
+ if(children!=null){
+ Iterator iterator=children.iterator();
+ while(iterator.hasNext()){
+ try{
+ AbstractUPnPDevice embeddedDevice=((AbstractUPnPDevice)iterator.next());
+ System.out.println("start "+embeddedDevice.getUDN()+" ...");
+ embeddedDevice.start(bundleContext);
+ } catch(Exception e) {
+ // TODO compensate previous starting ???
+ e.printStackTrace(System.err);
+ }
+ }
+ }
+ System.out.println(this.toString());
+ serviceRegistration = bundleContext.registerService(
+ UPnPDevice.class.getName(),
+ this,
+ dictionary
+ );
+ buildEventNotifier();
+ }
+
+ /**
+ *
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ for (int n = 0; n < notifiers.length; n++)
+ notifiers[n].destroy();
+ serviceRegistration.unregister();
+ if(children!=null){
+ Iterator iterator=children.iterator();
+ while(iterator.hasNext()){
+ try{
+ ((BundleActivator)iterator.next()).stop(bundleContext);
+ } catch(Exception e) {
+ // TODO compensate previous starting ???
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ final public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
+ for (int n = 0; n < notifiers.length; n++) {
+ notifiers[n].propertyChange(propertyChangeEvent);
+ }
+ }
+}
\ No newline at end of file
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPDevice.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPService.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPService.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPService.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPService.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,120 @@
+package org.apache.felix.upnp.devicegen.util;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPDevice;
+import org.osgi.service.upnp.UPnPService;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+
+public abstract class AbstractUPnPService implements UPnPService, BundleActivator {
+
+ final private String serviceId;
+ final private String serviceType;
+ final private String version;
+ final protected UPnPDevice upnpDevice;
+
+ protected Map stateVariables;
+ protected Map actions;
+
+ /** constructor
+ */
+ public AbstractUPnPService(
+ UPnPDevice upnpDevice,
+ String serviceId,
+ String serviceType,
+ String version
+ ){
+ this.upnpDevice=upnpDevice;
+ this.serviceId=serviceId;
+ this.serviceType=serviceType;
+ this.version=version;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPService#getId()
+ */
+ public String getId() {
+ return serviceId;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPService#getType()
+ */
+ public String getType() {
+ return serviceType;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPService#getVersion()
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPService#getActions()
+ */
+ public UPnPAction[] getActions() {
+ if(actions==null) return null;
+ return (UPnPAction[])(actions.values()).toArray(new UPnPAction[]{});
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPService#getAction(java.lang.String)
+ */
+ public UPnPAction getAction(String name) {
+ if(actions==null) return null;
+ return (UPnPAction)actions.get(name);
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPService#getStateVariables()
+ */
+ public UPnPStateVariable[] getStateVariables() {
+ if(stateVariables==null) return null;
+ return (UPnPStateVariable[])(stateVariables.values()).toArray(new UPnPStateVariable[]{});
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPService#getStateVariable(java.lang.String)
+ */
+ public UPnPStateVariable getStateVariable(String name) {
+ if(stateVariables==null) return null;
+ return (UPnPStateVariable)stateVariables.get(name);
+ }
+
+ public void start(BundleContext bundleContext) throws Exception {
+ if(stateVariables!=null) {
+ Iterator iter=stateVariables.values().iterator();
+ while(iter.hasNext()){
+ ((BundleActivator)iter.next()).start(bundleContext);
+ }
+ }
+ if(actions!=null) {
+ Iterator iter=actions.values().iterator();
+ while(iter.hasNext()){
+ ((BundleActivator)iter.next()).start(bundleContext);
+ }
+ }
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ if(actions!=null) {
+ Iterator iter=actions.values().iterator();
+ while(iter.hasNext()){
+ ((BundleActivator)iter.next()).stop(bundleContext);
+ }
+ }
+ if(stateVariables!=null) {
+ Iterator iter=stateVariables.values().iterator();
+ while(iter.hasNext()){
+ ((BundleActivator)iter.next()).stop(bundleContext);
+ }
+ }
+ }
+}
Propchange: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/util/AbstractUPnPService.java
------------------------------------------------------------------------------
svn:eol-style = native