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 [10/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/hvac/service/DeviceSecurity.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/DeviceSecurity.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/DeviceSecurity.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/DeviceSecurity.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,2493 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.hvac.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.hvac.model.*;
+import org.apache.felix.upnp.devicegen.hvac.impl.*;
+
+
+
+public class DeviceSecurity extends AbstractUPnPService {
+
+
+ private DeviceSecurityModel model;
+
+ /**
+ * constructor
+ */
+ public DeviceSecurity(
+ UPnPDevice upnpDevice,
+ String serviceId,
+ String serviceType,
+ String version,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpDevice,
+ serviceId,
+ serviceType,
+ version
+ );
+ this.model=model;
+
+
+ stateVariables=new HashMap();
+
+
+
+ stateVariables.put(
+ "NumberOfOwners",
+ new NumberOfOwnersStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "LifetimeSequenceBase",
+ new LifetimeSequenceBaseStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "TimeHint",
+ new TimeHintStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "TotalACLSize",
+ new TotalACLSizeStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "FreeACLSize",
+ new FreeACLSizeStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "TotalOwnerListSize",
+ new TotalOwnerListSizeStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "FreeOwnerListSize",
+ new FreeOwnerListSizeStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "TotalCertCacheSize",
+ new TotalCertCacheSizeStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "FreeCertCacheSize",
+ new FreeCertCacheSizeStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "A_ARG_TYPE_string",
+ new A_ARG_TYPE_stringStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "A_ARG_TYPE_base64",
+ new A_ARG_TYPE_base64StateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "A_ARG_TYPE_int",
+ new A_ARG_TYPE_intStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "A_ARG_TYPE_boolean",
+ new A_ARG_TYPE_booleanStateVariable(this,model)
+ );
+
+ actions=new HashMap();
+
+
+
+ actions.put(
+ "GetPublicKeys",
+ new GetPublicKeysAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetAlgorithmsAndProtocols",
+ new GetAlgorithmsAndProtocolsAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetACLSizes",
+ new GetACLSizesAction(this,model)
+ );
+
+
+
+ actions.put(
+ "CacheCertificate",
+ new CacheCertificateAction(this,model)
+ );
+
+
+
+ actions.put(
+ "SetTimeHint",
+ new SetTimeHintAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetLifetimeSequenceBase",
+ new GetLifetimeSequenceBaseAction(this,model)
+ );
+
+
+
+ actions.put(
+ "SetSessionKeys",
+ new SetSessionKeysAction(this,model)
+ );
+
+
+
+ actions.put(
+ "ExpireSessionKeys",
+ new ExpireSessionKeysAction(this,model)
+ );
+
+
+
+ actions.put(
+ "DecryptAndExecute",
+ new DecryptAndExecuteAction(this,model)
+ );
+
+
+
+ actions.put(
+ "TakeOwnership",
+ new TakeOwnershipAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetDefinedPermissions",
+ new GetDefinedPermissionsAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetDefinedProfiles",
+ new GetDefinedProfilesAction(this,model)
+ );
+
+
+
+ actions.put(
+ "ReadACL",
+ new ReadACLAction(this,model)
+ );
+
+
+
+ actions.put(
+ "WriteACL",
+ new WriteACLAction(this,model)
+ );
+
+
+
+ actions.put(
+ "AddACLEntry",
+ new AddACLEntryAction(this,model)
+ );
+
+
+
+ actions.put(
+ "DeleteACLEntry",
+ new DeleteACLEntryAction(this,model)
+ );
+
+
+
+ actions.put(
+ "ReplaceACLEntry",
+ new ReplaceACLEntryAction(this,model)
+ );
+
+
+
+ actions.put(
+ "FactorySecurityReset",
+ new FactorySecurityResetAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GrantOwnership",
+ new GrantOwnershipAction(this,model)
+ );
+
+
+
+ actions.put(
+ "RevokeOwnership",
+ new RevokeOwnershipAction(this,model)
+ );
+
+
+
+ actions.put(
+ "ListOwners",
+ new ListOwnersAction(this,model)
+ );
+
+ }
+
+ // UPnPStateVariable classes
+
+
+
+// class NumberOfOwnersStateVariable
+public class NumberOfOwnersStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="NumberOfOwners";
+ public final static String DATATYPE="i4";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public NumberOfOwnersStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getNumberOfOwnersStateVariableValue();
+
+ }
+};
+
+
+// class LifetimeSequenceBaseStateVariable
+public class LifetimeSequenceBaseStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="LifetimeSequenceBase";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public LifetimeSequenceBaseStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getLifetimeSequenceBaseStateVariableValue();
+
+ }
+};
+
+
+// class TimeHintStateVariable
+public class TimeHintStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="TimeHint";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public TimeHintStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getTimeHintStateVariableValue();
+
+ }
+};
+
+
+// class TotalACLSizeStateVariable
+public class TotalACLSizeStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="TotalACLSize";
+ public final static String DATATYPE="i4";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public TotalACLSizeStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getTotalACLSizeStateVariableValue();
+
+ }
+};
+
+
+// class FreeACLSizeStateVariable
+public class FreeACLSizeStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="FreeACLSize";
+ public final static String DATATYPE="i4";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public FreeACLSizeStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getFreeACLSizeStateVariableValue();
+
+ }
+};
+
+
+// class TotalOwnerListSizeStateVariable
+public class TotalOwnerListSizeStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="TotalOwnerListSize";
+ public final static String DATATYPE="i4";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public TotalOwnerListSizeStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getTotalOwnerListSizeStateVariableValue();
+
+ }
+};
+
+
+// class FreeOwnerListSizeStateVariable
+public class FreeOwnerListSizeStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="FreeOwnerListSize";
+ public final static String DATATYPE="i4";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public FreeOwnerListSizeStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getFreeOwnerListSizeStateVariableValue();
+
+ }
+};
+
+
+// class TotalCertCacheSizeStateVariable
+public class TotalCertCacheSizeStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="TotalCertCacheSize";
+ public final static String DATATYPE="i4";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public TotalCertCacheSizeStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getTotalCertCacheSizeStateVariableValue();
+
+ }
+};
+
+
+// class FreeCertCacheSizeStateVariable
+public class FreeCertCacheSizeStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="FreeCertCacheSize";
+ public final static String DATATYPE="i4";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public FreeCertCacheSizeStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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.getFreeCertCacheSizeStateVariableValue();
+
+ }
+};
+
+
+// class A_ARG_TYPE_stringStateVariable
+public class A_ARG_TYPE_stringStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="A_ARG_TYPE_string";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public A_ARG_TYPE_stringStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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 A_ARG_TYPE_base64StateVariable
+public class A_ARG_TYPE_base64StateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="A_ARG_TYPE_base64";
+ public final static String DATATYPE="bin.base64";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public A_ARG_TYPE_base64StateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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 A_ARG_TYPE_intStateVariable
+public class A_ARG_TYPE_intStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="A_ARG_TYPE_int";
+ public final static String DATATYPE="i4";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public A_ARG_TYPE_intStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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 A_ARG_TYPE_booleanStateVariable
+public class A_ARG_TYPE_booleanStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="A_ARG_TYPE_boolean";
+ public final static String DATATYPE="boolean";
+
+ // HERE specific state variable members
+ private DeviceSecurityModel model;
+
+ public A_ARG_TYPE_booleanStateVariable(
+ UPnPService upnpService,
+ DeviceSecurityModel 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 GetPublicKeysAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public GetPublicKeysAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "GetPublicKeys",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "KeyArg",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder keyArg = new StringHolder();
+
+
+ // invoke model
+
+ model.getPublicKeys(
+ keyArg
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("KeyArg",keyArg.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 GetAlgorithmsAndProtocolsAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public GetAlgorithmsAndProtocolsAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "GetAlgorithmsAndProtocols",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "Supported",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder supported = new StringHolder();
+
+
+ // invoke model
+
+ model.getAlgorithmsAndProtocols(
+ supported
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("Supported",supported.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 GetACLSizesAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public GetACLSizesAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "GetACLSizes",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "ArgTotalACLSize",
+ upnpService.getStateVariable("TotalACLSize")
+ );
+
+ addOutArg(
+ "ArgFreeACLSize",
+ upnpService.getStateVariable("FreeACLSize")
+ );
+
+ addOutArg(
+ "ArgTotalOwnerListSize",
+ upnpService.getStateVariable("TotalOwnerListSize")
+ );
+
+ addOutArg(
+ "ArgFreeOwnerListSize",
+ upnpService.getStateVariable("FreeOwnerListSize")
+ );
+
+ addOutArg(
+ "ArgTotalCertCacheSize",
+ upnpService.getStateVariable("TotalCertCacheSize")
+ );
+
+ addOutArg(
+ "ArgFreeCertCacheSize",
+ upnpService.getStateVariable("FreeCertCacheSize")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ IntegerHolder argTotalACLSize = new IntegerHolder();
+ IntegerHolder argFreeACLSize = new IntegerHolder();
+ IntegerHolder argTotalOwnerListSize = new IntegerHolder();
+ IntegerHolder argFreeOwnerListSize = new IntegerHolder();
+ IntegerHolder argTotalCertCacheSize = new IntegerHolder();
+ IntegerHolder argFreeCertCacheSize = new IntegerHolder();
+
+
+ // invoke model
+
+ model.getACLSizes(
+ argTotalACLSize,
+
+argFreeACLSize,
+
+argTotalOwnerListSize,
+
+argFreeOwnerListSize,
+
+argTotalCertCacheSize,
+
+argFreeCertCacheSize
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("ArgTotalACLSize",argTotalACLSize.getObject());
+ // java.lang.Integer
+ _result.put("ArgFreeACLSize",argFreeACLSize.getObject());
+ // java.lang.Integer
+ _result.put("ArgTotalOwnerListSize",argTotalOwnerListSize.getObject());
+ // java.lang.Integer
+ _result.put("ArgFreeOwnerListSize",argFreeOwnerListSize.getObject());
+ // java.lang.Integer
+ _result.put("ArgTotalCertCacheSize",argTotalCertCacheSize.getObject());
+ // java.lang.Integer
+ _result.put("ArgFreeCertCacheSize",argFreeCertCacheSize.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 CacheCertificateAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public CacheCertificateAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "CacheCertificate",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "Certificates",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String certificates = (java.lang.String) _args.get("Certificates");
+
+
+ // invoke model
+
+ model.cacheCertificate(
+ StringHolder.toValue(
+ certificates)
+
+ );
+
+ // 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 SetTimeHintAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public SetTimeHintAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "SetTimeHint",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "ArgTimeHint",
+ upnpService.getStateVariable("TimeHint")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String argTimeHint = (java.lang.String) _args.get("ArgTimeHint");
+
+
+ // invoke model
+
+ model.setTimeHint(
+ StringHolder.toValue(
+ argTimeHint)
+
+ );
+
+ // 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 GetLifetimeSequenceBaseAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public GetLifetimeSequenceBaseAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "GetLifetimeSequenceBase",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "ArgLifetimeSequenceBase",
+ upnpService.getStateVariable("LifetimeSequenceBase")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder argLifetimeSequenceBase = new StringHolder();
+
+
+ // invoke model
+
+ model.getLifetimeSequenceBase(
+ argLifetimeSequenceBase
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("ArgLifetimeSequenceBase",argLifetimeSequenceBase.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 SetSessionKeysAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public SetSessionKeysAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "SetSessionKeys",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "EncipheredBulkKey",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ addInArg(
+ "BulkAlgorithm",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addInArg(
+ "Ciphertext",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ addInArg(
+ "CPKeyID",
+ upnpService.getStateVariable("A_ARG_TYPE_int")
+ );
+
+ addOutArg(
+ "DeviceKeyID",
+ upnpService.getStateVariable("A_ARG_TYPE_int")
+ );
+
+ addOutArg(
+ "SequenceBase",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ byte[] encipheredBulkKey = (byte[]) _args.get("EncipheredBulkKey");
+ java.lang.String bulkAlgorithm = (java.lang.String) _args.get("BulkAlgorithm");
+ byte[] ciphertext = (byte[]) _args.get("Ciphertext");
+ java.lang.Integer cPKeyID = (java.lang.Integer) _args.get("CPKeyID");
+ IntegerHolder deviceKeyID = new IntegerHolder();
+ StringHolder sequenceBase = new StringHolder();
+
+
+ // invoke model
+
+ model.setSessionKeys(
+ ByteArrayHolder.toValue(
+ encipheredBulkKey)
+ ,
+
+StringHolder.toValue(
+ bulkAlgorithm)
+ ,
+
+ByteArrayHolder.toValue(
+ ciphertext)
+ ,
+
+IntegerHolder.toValue(
+ cPKeyID)
+ ,
+
+deviceKeyID,
+
+sequenceBase
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("DeviceKeyID",deviceKeyID.getObject());
+ // java.lang.Integer
+ _result.put("SequenceBase",sequenceBase.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 ExpireSessionKeysAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public ExpireSessionKeysAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "ExpireSessionKeys",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "DeviceKeyID",
+ upnpService.getStateVariable("A_ARG_TYPE_int")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.Integer deviceKeyID = (java.lang.Integer) _args.get("DeviceKeyID");
+
+
+ // invoke model
+
+ model.expireSessionKeys(
+ IntegerHolder.toValue(
+ deviceKeyID)
+
+ );
+
+ // 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 DecryptAndExecuteAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public DecryptAndExecuteAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "DecryptAndExecute",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "DeviceKeyID",
+ upnpService.getStateVariable("A_ARG_TYPE_int")
+ );
+
+ addInArg(
+ "Request",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ addInArg(
+ "InIV",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ addOutArg(
+ "Reply",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ addOutArg(
+ "OutIV",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.Integer deviceKeyID = (java.lang.Integer) _args.get("DeviceKeyID");
+ byte[] request = (byte[]) _args.get("Request");
+ byte[] inIV = (byte[]) _args.get("InIV");
+ ByteArrayHolder reply = new ByteArrayHolder();
+ ByteArrayHolder outIV = new ByteArrayHolder();
+
+
+ // invoke model
+
+ model.decryptAndExecute(
+ IntegerHolder.toValue(
+ deviceKeyID)
+ ,
+
+ByteArrayHolder.toValue(
+ request)
+ ,
+
+ByteArrayHolder.toValue(
+ inIV)
+ ,
+
+reply,
+
+outIV
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("Reply",reply.getObject());
+ // byte[]
+ _result.put("OutIV",outIV.getObject());
+ // byte[]
+ return _result.isEmpty()?null:_result;
+ }
+
+
+ public void start(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ // TODO
+ }
+};
+
+
+public class TakeOwnershipAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public TakeOwnershipAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "TakeOwnership",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "HMACAlgorithm",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addInArg(
+ "EncryptedHMACValue",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String hMACAlgorithm = (java.lang.String) _args.get("HMACAlgorithm");
+ byte[] encryptedHMACValue = (byte[]) _args.get("EncryptedHMACValue");
+
+
+ // invoke model
+
+ model.takeOwnership(
+ StringHolder.toValue(
+ hMACAlgorithm)
+ ,
+
+ByteArrayHolder.toValue(
+ encryptedHMACValue)
+
+ );
+
+ // 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 GetDefinedPermissionsAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public GetDefinedPermissionsAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "GetDefinedPermissions",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "Permissions",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder permissions = new StringHolder();
+
+
+ // invoke model
+
+ model.getDefinedPermissions(
+ permissions
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("Permissions",permissions.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 GetDefinedProfilesAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public GetDefinedProfilesAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "GetDefinedProfiles",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "Profiles",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder profiles = new StringHolder();
+
+
+ // invoke model
+
+ model.getDefinedProfiles(
+ profiles
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("Profiles",profiles.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 ReadACLAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public ReadACLAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "ReadACL",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "Version",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addOutArg(
+ "ACL",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder version = new StringHolder();
+ StringHolder aCL = new StringHolder();
+
+
+ // invoke model
+
+ model.readACL(
+ version,
+
+aCL
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("Version",version.getObject());
+ // java.lang.String
+ _result.put("ACL",aCL.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 WriteACLAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public WriteACLAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "WriteACL",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "Version",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addInArg(
+ "ACL",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addOutArg(
+ "NewVersion",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String version = (java.lang.String) _args.get("Version");
+ java.lang.String aCL = (java.lang.String) _args.get("ACL");
+ StringHolder newVersion = new StringHolder();
+
+
+ // invoke model
+
+ model.writeACL(
+ StringHolder.toValue(
+ version)
+ ,
+
+StringHolder.toValue(
+ aCL)
+ ,
+
+newVersion
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("NewVersion",newVersion.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 AddACLEntryAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public AddACLEntryAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "AddACLEntry",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "Entry",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String entry = (java.lang.String) _args.get("Entry");
+
+
+ // invoke model
+
+ model.addACLEntry(
+ StringHolder.toValue(
+ entry)
+
+ );
+
+ // 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 DeleteACLEntryAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public DeleteACLEntryAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "DeleteACLEntry",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "TargetACLVersion",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addInArg(
+ "Index",
+ upnpService.getStateVariable("A_ARG_TYPE_int")
+ );
+
+ addOutArg(
+ "NewACLVersion",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String targetACLVersion = (java.lang.String) _args.get("TargetACLVersion");
+ java.lang.Integer index = (java.lang.Integer) _args.get("Index");
+ StringHolder newACLVersion = new StringHolder();
+
+
+ // invoke model
+
+ model.deleteACLEntry(
+ StringHolder.toValue(
+ targetACLVersion)
+ ,
+
+IntegerHolder.toValue(
+ index)
+ ,
+
+newACLVersion
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("NewACLVersion",newACLVersion.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 ReplaceACLEntryAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public ReplaceACLEntryAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "ReplaceACLEntry",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "TargetACLVersion",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addInArg(
+ "Index",
+ upnpService.getStateVariable("A_ARG_TYPE_int")
+ );
+
+ addInArg(
+ "Entry",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addOutArg(
+ "NewACLVersion",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String targetACLVersion = (java.lang.String) _args.get("TargetACLVersion");
+ java.lang.Integer index = (java.lang.Integer) _args.get("Index");
+ java.lang.String entry = (java.lang.String) _args.get("Entry");
+ StringHolder newACLVersion = new StringHolder();
+
+
+ // invoke model
+
+ model.replaceACLEntry(
+ StringHolder.toValue(
+ targetACLVersion)
+ ,
+
+IntegerHolder.toValue(
+ index)
+ ,
+
+StringHolder.toValue(
+ entry)
+ ,
+
+newACLVersion
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("NewACLVersion",newACLVersion.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 FactorySecurityResetAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public FactorySecurityResetAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "FactorySecurityReset",
+ ""
+ );
+ this.model=model;
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+
+
+ // invoke model
+
+ model.factorySecurityReset(
+
+ );
+
+ // 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 GrantOwnershipAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public GrantOwnershipAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "GrantOwnership",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "HashAlgorithm",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addInArg(
+ "KeyHash",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String hashAlgorithm = (java.lang.String) _args.get("HashAlgorithm");
+ byte[] keyHash = (byte[]) _args.get("KeyHash");
+
+
+ // invoke model
+
+ model.grantOwnership(
+ StringHolder.toValue(
+ hashAlgorithm)
+ ,
+
+ByteArrayHolder.toValue(
+ keyHash)
+
+ );
+
+ // 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 RevokeOwnershipAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public RevokeOwnershipAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "RevokeOwnership",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "HashAlgorithm",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ addInArg(
+ "KeyHash",
+ upnpService.getStateVariable("A_ARG_TYPE_base64")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String hashAlgorithm = (java.lang.String) _args.get("HashAlgorithm");
+ byte[] keyHash = (byte[]) _args.get("KeyHash");
+
+
+ // invoke model
+
+ model.revokeOwnership(
+ StringHolder.toValue(
+ hashAlgorithm)
+ ,
+
+ByteArrayHolder.toValue(
+ keyHash)
+
+ );
+
+ // 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 ListOwnersAction extends AbstractUPnPAction {
+
+ DeviceSecurityModel model;
+
+ // HERE specific action members
+
+ public ListOwnersAction(
+ UPnPService upnpService,
+ DeviceSecurityModel model
+ ){
+ super(
+ upnpService,
+ "ListOwners",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "ArgNumberOfOwners",
+ upnpService.getStateVariable("NumberOfOwners")
+ );
+
+ addOutArg(
+ "Owners",
+ upnpService.getStateVariable("A_ARG_TYPE_string")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ IntegerHolder argNumberOfOwners = new IntegerHolder();
+ StringHolder owners = new StringHolder();
+
+
+ // invoke model
+
+ model.listOwners(
+ argNumberOfOwners,
+
+owners
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("ArgNumberOfOwners",argNumberOfOwners.getObject());
+ // java.lang.Integer
+ _result.put("Owners",owners.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/hvac/service/DeviceSecurity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/FanSpeed.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/FanSpeed.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/FanSpeed.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/FanSpeed.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,700 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.hvac.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.hvac.model.*;
+import org.apache.felix.upnp.devicegen.hvac.impl.*;
+
+
+
+public class FanSpeed extends AbstractUPnPService {
+
+
+ private FanSpeedModel model;
+
+ /**
+ * constructor
+ */
+ public FanSpeed(
+ UPnPDevice upnpDevice,
+ String serviceId,
+ String serviceType,
+ String version,
+ FanSpeedModel model
+ ){
+ super(
+ upnpDevice,
+ serviceId,
+ serviceType,
+ version
+ );
+ this.model=model;
+
+
+ stateVariables=new HashMap();
+
+
+
+ stateVariables.put(
+ "FanSpeedTarget",
+ new FanSpeedTargetStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "FanSpeedStatus",
+ new FanSpeedStatusStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "DirectionTarget",
+ new DirectionTargetStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "DirectionStatus",
+ new DirectionStatusStateVariable(this,model)
+ );
+
+ actions=new HashMap();
+
+
+
+ actions.put(
+ "SetFanSpeed",
+ new SetFanSpeedAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetFanSpeed",
+ new GetFanSpeedAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetFanSpeedTarget",
+ new GetFanSpeedTargetAction(this,model)
+ );
+
+
+
+ actions.put(
+ "SetFanDirection",
+ new SetFanDirectionAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetFanDirection",
+ new GetFanDirectionAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetFanDirectionTarget",
+ new GetFanDirectionTargetAction(this,model)
+ );
+
+ }
+
+ // UPnPStateVariable classes
+
+
+
+// class FanSpeedTargetStateVariable
+public class FanSpeedTargetStateVariable
+ extends AbstractUPnPStateVariable
+
+ {
+
+ public final static String NAME="FanSpeedTarget";
+ public final static String DATATYPE="ui1";
+
+ // HERE specific state variable members
+ private FanSpeedModel model;
+
+ public FanSpeedTargetStateVariable(
+ UPnPService upnpService,
+ FanSpeedModel 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 0
+ null, // TODO maximum changed for 100
+ // 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 FanSpeedStatusStateVariable
+public class FanSpeedStatusStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="FanSpeedStatus";
+ public final static String DATATYPE="ui1";
+
+ // HERE specific state variable members
+ private FanSpeedModel model;
+
+ public FanSpeedStatusStateVariable(
+ UPnPService upnpService,
+ FanSpeedModel 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 0
+ null, // TODO maximum changed for 100
+ // 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.getFanSpeedStatusStateVariableValue();
+
+ }
+};
+
+
+// class DirectionTargetStateVariable
+public class DirectionTargetStateVariable
+ extends AbstractUPnPStateVariable
+
+ {
+
+ public final static String NAME="DirectionTarget";
+ public final static String DATATYPE="boolean";
+
+ // HERE specific state variable members
+ private FanSpeedModel model;
+
+ public DirectionTargetStateVariable(
+ UPnPService upnpService,
+ FanSpeedModel 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 DirectionStatusStateVariable
+public class DirectionStatusStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="DirectionStatus";
+ public final static String DATATYPE="boolean";
+
+ // HERE specific state variable members
+ private FanSpeedModel model;
+
+ public DirectionStatusStateVariable(
+ UPnPService upnpService,
+ FanSpeedModel 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.getDirectionStatusStateVariableValue();
+
+ }
+};
+
+
+ // UPnPAction classes
+
+
+
+public class SetFanSpeedAction extends AbstractUPnPAction {
+
+ FanSpeedModel model;
+
+ // HERE specific action members
+
+ public SetFanSpeedAction(
+ UPnPService upnpService,
+ FanSpeedModel model
+ ){
+ super(
+ upnpService,
+ "SetFanSpeed",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "NewFanSpeedTarget",
+ upnpService.getStateVariable("FanSpeedTarget")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.Integer newFanSpeedTarget = (java.lang.Integer) _args.get("NewFanSpeedTarget");
+
+
+ // invoke model
+
+ model.setFanSpeed(
+ IntegerHolder.toValue(
+ newFanSpeedTarget)
+
+ );
+
+ // 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 GetFanSpeedAction extends AbstractUPnPAction {
+
+ FanSpeedModel model;
+
+ // HERE specific action members
+
+ public GetFanSpeedAction(
+ UPnPService upnpService,
+ FanSpeedModel model
+ ){
+ super(
+ upnpService,
+ "GetFanSpeed",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "CurrentFanSpeedStatus",
+ upnpService.getStateVariable("FanSpeedStatus")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ IntegerHolder currentFanSpeedStatus = new IntegerHolder();
+
+
+ // invoke model
+
+ model.getFanSpeed(
+ currentFanSpeedStatus
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("CurrentFanSpeedStatus",currentFanSpeedStatus.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 GetFanSpeedTargetAction extends AbstractUPnPAction {
+
+ FanSpeedModel model;
+
+ // HERE specific action members
+
+ public GetFanSpeedTargetAction(
+ UPnPService upnpService,
+ FanSpeedModel model
+ ){
+ super(
+ upnpService,
+ "GetFanSpeedTarget",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "CurrentFanSpeedTarget",
+ upnpService.getStateVariable("FanSpeedTarget")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ IntegerHolder currentFanSpeedTarget = new IntegerHolder();
+
+
+ // invoke model
+
+ model.getFanSpeedTarget(
+ currentFanSpeedTarget
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("CurrentFanSpeedTarget",currentFanSpeedTarget.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 SetFanDirectionAction extends AbstractUPnPAction {
+
+ FanSpeedModel model;
+
+ // HERE specific action members
+
+ public SetFanDirectionAction(
+ UPnPService upnpService,
+ FanSpeedModel model
+ ){
+ super(
+ upnpService,
+ "SetFanDirection",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "NewDirectionTarget",
+ upnpService.getStateVariable("DirectionTarget")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.Boolean newDirectionTarget = (java.lang.Boolean) _args.get("NewDirectionTarget");
+
+
+ // invoke model
+
+ model.setFanDirection(
+ BooleanHolder.toValue(
+ newDirectionTarget)
+
+ );
+
+ // 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 GetFanDirectionAction extends AbstractUPnPAction {
+
+ FanSpeedModel model;
+
+ // HERE specific action members
+
+ public GetFanDirectionAction(
+ UPnPService upnpService,
+ FanSpeedModel model
+ ){
+ super(
+ upnpService,
+ "GetFanDirection",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "CurrentDirectionStatus",
+ upnpService.getStateVariable("DirectionStatus")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ BooleanHolder currentDirectionStatus = new BooleanHolder();
+
+
+ // invoke model
+
+ model.getFanDirection(
+ currentDirectionStatus
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("CurrentDirectionStatus",currentDirectionStatus.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 GetFanDirectionTargetAction extends AbstractUPnPAction {
+
+ FanSpeedModel model;
+
+ // HERE specific action members
+
+ public GetFanDirectionTargetAction(
+ UPnPService upnpService,
+ FanSpeedModel model
+ ){
+ super(
+ upnpService,
+ "GetFanDirectionTarget",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "CurrentDirectionTarget",
+ upnpService.getStateVariable("DirectionTarget")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ BooleanHolder currentDirectionTarget = new BooleanHolder();
+
+
+ // invoke model
+
+ model.getFanDirectionTarget(
+ currentDirectionTarget
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("CurrentDirectionTarget",currentDirectionTarget.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/hvac/service/FanSpeed.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/HVAC_FanOperatingMode.java
URL: http://svn.apache.org/viewvc/incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/HVAC_FanOperatingMode.java?view=auto&rev=533875
==============================================================================
--- incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/HVAC_FanOperatingMode.java (added)
+++ incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/HVAC_FanOperatingMode.java Mon Apr 30 16:15:05 2007
@@ -0,0 +1,597 @@
+
+/*
+__BANNER__
+*/
+// this file was generated at 1-May-2007 12:59 AM by ${author}
+package org.apache.felix.upnp.devicegen.hvac.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.hvac.model.*;
+import org.apache.felix.upnp.devicegen.hvac.impl.*;
+
+
+
+public class HVAC_FanOperatingMode extends AbstractUPnPService {
+
+
+ private HVAC_FanOperatingModeModel model;
+
+ /**
+ * constructor
+ */
+ public HVAC_FanOperatingMode(
+ UPnPDevice upnpDevice,
+ String serviceId,
+ String serviceType,
+ String version,
+ HVAC_FanOperatingModeModel model
+ ){
+ super(
+ upnpDevice,
+ serviceId,
+ serviceType,
+ version
+ );
+ this.model=model;
+
+
+ stateVariables=new HashMap();
+
+
+
+ stateVariables.put(
+ "Mode",
+ new ModeStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "FanStatus",
+ new FanStatusStateVariable(this,model)
+ );
+
+
+
+ stateVariables.put(
+ "Name",
+ new NameStateVariable(this,model)
+ );
+
+ actions=new HashMap();
+
+
+
+ actions.put(
+ "SetMode",
+ new SetModeAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetMode",
+ new GetModeAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetFanStatus",
+ new GetFanStatusAction(this,model)
+ );
+
+
+
+ actions.put(
+ "GetName",
+ new GetNameAction(this,model)
+ );
+
+
+
+ actions.put(
+ "SetName",
+ new SetNameAction(this,model)
+ );
+
+ }
+
+ // UPnPStateVariable classes
+
+
+
+// class ModeStateVariable
+public class ModeStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="Mode";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private HVAC_FanOperatingModeModel model;
+
+ public ModeStateVariable(
+ UPnPService upnpService,
+ HVAC_FanOperatingModeModel model
+ ){
+ super(
+ upnpService,
+ NAME,
+ DATATYPE,
+ null, // TODO defaultValue changed for Auto
+ 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;
+
+
+ /*
+ List allowedValueList=new LinkedList();
+
+ allowedValueList.add(UPnPDataTypeUtil.instanciateObject("string","Auto"));
+
+ allowedValueList.add(UPnPDataTypeUtil.instanciateObject("string","ContinuousOn"));
+
+ allowedValueList.add(UPnPDataTypeUtil.instanciateObject("string","PeriodicOn"));
+
+ this.setallowedValueList(allowedValueList);
+ */
+
+ }
+
+ // 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.getModeStateVariableValue();
+
+ }
+};
+
+
+// class FanStatusStateVariable
+public class FanStatusStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="FanStatus";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private HVAC_FanOperatingModeModel model;
+
+ public FanStatusStateVariable(
+ UPnPService upnpService,
+ HVAC_FanOperatingModeModel model
+ ){
+ super(
+ upnpService,
+ NAME,
+ DATATYPE,
+ null, // TODO defaultValue changed for On
+ 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;
+
+
+ /*
+ List allowedValueList=new LinkedList();
+
+ allowedValueList.add(UPnPDataTypeUtil.instanciateObject("string","On"));
+
+ allowedValueList.add(UPnPDataTypeUtil.instanciateObject("string","Off"));
+
+ this.setallowedValueList(allowedValueList);
+ */
+
+ }
+
+ // 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.getFanStatusStateVariableValue();
+
+ }
+};
+
+
+// class NameStateVariable
+public class NameStateVariable
+ extends AbstractUPnPStateVariable
+
+ implements UPnPStateVariableDescriptor{
+
+ public final static String NAME="Name";
+ public final static String DATATYPE="string";
+
+ // HERE specific state variable members
+ private HVAC_FanOperatingModeModel model;
+
+ public NameStateVariable(
+ UPnPService upnpService,
+ HVAC_FanOperatingModeModel 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.getNameStateVariableValue();
+
+ }
+};
+
+
+ // UPnPAction classes
+
+
+
+public class SetModeAction extends AbstractUPnPAction {
+
+ HVAC_FanOperatingModeModel model;
+
+ // HERE specific action members
+
+ public SetModeAction(
+ UPnPService upnpService,
+ HVAC_FanOperatingModeModel model
+ ){
+ super(
+ upnpService,
+ "SetMode",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "NewMode",
+ upnpService.getStateVariable("Mode")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String newMode = (java.lang.String) _args.get("NewMode");
+
+
+ // invoke model
+
+ model.setMode(
+ StringHolder.toValue(
+ newMode)
+
+ );
+
+ // 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 GetModeAction extends AbstractUPnPAction {
+
+ HVAC_FanOperatingModeModel model;
+
+ // HERE specific action members
+
+ public GetModeAction(
+ UPnPService upnpService,
+ HVAC_FanOperatingModeModel model
+ ){
+ super(
+ upnpService,
+ "GetMode",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "CurrentMode",
+ upnpService.getStateVariable("Mode")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder currentMode = new StringHolder();
+
+
+ // invoke model
+
+ model.getMode(
+ currentMode
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("CurrentMode",currentMode.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 GetFanStatusAction extends AbstractUPnPAction {
+
+ HVAC_FanOperatingModeModel model;
+
+ // HERE specific action members
+
+ public GetFanStatusAction(
+ UPnPService upnpService,
+ HVAC_FanOperatingModeModel model
+ ){
+ super(
+ upnpService,
+ "GetFanStatus",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "CurrentStatus",
+ upnpService.getStateVariable("FanStatus")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder currentStatus = new StringHolder();
+
+
+ // invoke model
+
+ model.getFanStatus(
+ currentStatus
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("CurrentStatus",currentStatus.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 GetNameAction extends AbstractUPnPAction {
+
+ HVAC_FanOperatingModeModel model;
+
+ // HERE specific action members
+
+ public GetNameAction(
+ UPnPService upnpService,
+ HVAC_FanOperatingModeModel model
+ ){
+ super(
+ upnpService,
+ "GetName",
+ ""
+ );
+ this.model=model;
+
+ addOutArg(
+ "CurrentName",
+ upnpService.getStateVariable("Name")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ StringHolder currentName = new StringHolder();
+
+
+ // invoke model
+
+ model.getName(
+ currentName
+ );
+
+ // build returned Dictionary
+ Dictionary _result = new Hashtable();
+
+ _result.put("CurrentName",currentName.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 SetNameAction extends AbstractUPnPAction {
+
+ HVAC_FanOperatingModeModel model;
+
+ // HERE specific action members
+
+ public SetNameAction(
+ UPnPService upnpService,
+ HVAC_FanOperatingModeModel model
+ ){
+ super(
+ upnpService,
+ "SetName",
+ ""
+ );
+ this.model=model;
+
+ addInArg(
+ "NewName",
+ upnpService.getStateVariable("Name")
+ );
+
+ }
+
+ /**
+ * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+ */
+ public Dictionary invoke(Dictionary _args) throws Exception {
+
+ java.lang.String newName = (java.lang.String) _args.get("NewName");
+
+
+ // invoke model
+
+ model.setName(
+ StringHolder.toValue(
+ newName)
+
+ );
+
+ // 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: incubator/felix/sandbox/donsez/upnp.devicegen/src/main/java/org/apache/felix/upnp/devicegen/hvac/service/HVAC_FanOperatingMode.java
------------------------------------------------------------------------------
svn:eol-style = native