Skip to content
Snippets Groups Projects
Commit b99db771 authored by Alvaro Fides's avatar Alvaro Fides
Browse files

Fixed the ServiceProfiles of the full-code templates in versions 2.0.0 and...

Fixed the ServiceProfiles of the full-code templates in versions 2.0.0 and above (NPE when registering them)
parent 50ffacec
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -67,7 +67,7 @@ public class SCalleeProvidedService extends DeviceService {
MergedRestriction r = MergedRestriction.getFixedValueRestriction( MergedRestriction r = MergedRestriction.getFixedValueRestriction(
DeviceService.PROP_CONTROLS, new SwitchController( DeviceService.PROP_CONTROLS, new SwitchController(
CPublisher.DEVICE_OWN_URI)); CPublisher.DEVICE_OWN_URI));
profiles[0].getTheService().addInstanceLevelRestriction(r, getOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[0] = getOnOffActuatorStatus.getProfile(); profiles[0] = getOnOffActuatorStatus.getProfile();
...@@ -81,7 +81,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -81,7 +81,7 @@ public class SCalleeProvidedService extends DeviceService {
TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] { TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] {
DeviceService.PROP_CONTROLS, DeviceService.PROP_CONTROLS,
SwitchController.PROP_HAS_VALUE }); SwitchController.PROP_HAS_VALUE });
profiles[1].getTheService().addInstanceLevelRestriction(r, setOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[1] = setOnOffActuatorStatus.getProfile(); profiles[1] = setOnOffActuatorStatus.getProfile();
...@@ -90,5 +90,9 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -90,5 +90,9 @@ public class SCalleeProvidedService extends DeviceService {
protected SCalleeProvidedService(String uri) { protected SCalleeProvidedService(String uri) {
super(uri); super(uri);
} }
public String getClassURI() {
return MY_URI;
}
} }
...@@ -70,7 +70,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -70,7 +70,7 @@ public class SCalleeProvidedService extends DeviceService {
MergedRestriction r = MergedRestriction.getFixedValueRestriction( MergedRestriction r = MergedRestriction.getFixedValueRestriction(
DeviceService.PROP_CONTROLS, new SwitchController( DeviceService.PROP_CONTROLS, new SwitchController(
CPublisher.DEVICE_OWN_URI)); CPublisher.DEVICE_OWN_URI));
profiles[0].getTheService().addInstanceLevelRestriction(r, getOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[0] = getOnOffActuatorStatus.getProfile(); profiles[0] = getOnOffActuatorStatus.getProfile();
...@@ -84,7 +84,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -84,7 +84,7 @@ public class SCalleeProvidedService extends DeviceService {
TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] { TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] {
DeviceService.PROP_CONTROLS, DeviceService.PROP_CONTROLS,
SwitchController.PROP_HAS_VALUE }); SwitchController.PROP_HAS_VALUE });
profiles[1].getTheService().addInstanceLevelRestriction(r, setOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[1] = setOnOffActuatorStatus.getProfile(); profiles[1] = setOnOffActuatorStatus.getProfile();
...@@ -98,5 +98,9 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -98,5 +98,9 @@ public class SCalleeProvidedService extends DeviceService {
protected SCalleeProvidedService(String uri) { protected SCalleeProvidedService(String uri) {
super(uri); super(uri);
} }
public String getClassURI() {
return MY_URI;
}
} }
...@@ -67,7 +67,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -67,7 +67,7 @@ public class SCalleeProvidedService extends DeviceService {
MergedRestriction r = MergedRestriction.getFixedValueRestriction( MergedRestriction r = MergedRestriction.getFixedValueRestriction(
DeviceService.PROP_CONTROLS, new SwitchController( DeviceService.PROP_CONTROLS, new SwitchController(
CPublisher.DEVICE_OWN_URI)); CPublisher.DEVICE_OWN_URI));
profiles[0].getTheService().addInstanceLevelRestriction(r, getOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[0] = getOnOffActuatorStatus.getProfile(); profiles[0] = getOnOffActuatorStatus.getProfile();
...@@ -81,7 +81,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -81,7 +81,7 @@ public class SCalleeProvidedService extends DeviceService {
TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] { TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] {
DeviceService.PROP_CONTROLS, DeviceService.PROP_CONTROLS,
SwitchController.PROP_HAS_VALUE }); SwitchController.PROP_HAS_VALUE });
profiles[1].getTheService().addInstanceLevelRestriction(r, setOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[1] = setOnOffActuatorStatus.getProfile(); profiles[1] = setOnOffActuatorStatus.getProfile();
...@@ -90,5 +90,9 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -90,5 +90,9 @@ public class SCalleeProvidedService extends DeviceService {
protected SCalleeProvidedService(String uri) { protected SCalleeProvidedService(String uri) {
super(uri); super(uri);
} }
public String getClassURI() {
return MY_URI;
}
} }
...@@ -67,7 +67,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -67,7 +67,7 @@ public class SCalleeProvidedService extends DeviceService {
MergedRestriction r = MergedRestriction.getFixedValueRestriction( MergedRestriction r = MergedRestriction.getFixedValueRestriction(
DeviceService.PROP_CONTROLS, new SwitchController( DeviceService.PROP_CONTROLS, new SwitchController(
CPublisher.DEVICE_OWN_URI)); CPublisher.DEVICE_OWN_URI));
profiles[0].getTheService().addInstanceLevelRestriction(r, getOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[0] = getOnOffActuatorStatus.getProfile(); profiles[0] = getOnOffActuatorStatus.getProfile();
...@@ -81,7 +81,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -81,7 +81,7 @@ public class SCalleeProvidedService extends DeviceService {
TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] { TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] {
DeviceService.PROP_CONTROLS, DeviceService.PROP_CONTROLS,
SwitchController.PROP_HAS_VALUE }); SwitchController.PROP_HAS_VALUE });
profiles[1].getTheService().addInstanceLevelRestriction(r, setOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[1] = setOnOffActuatorStatus.getProfile(); profiles[1] = setOnOffActuatorStatus.getProfile();
...@@ -90,5 +90,9 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -90,5 +90,9 @@ public class SCalleeProvidedService extends DeviceService {
protected SCalleeProvidedService(String uri) { protected SCalleeProvidedService(String uri) {
super(uri); super(uri);
} }
public String getClassURI() {
return MY_URI;
}
} }
...@@ -70,7 +70,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -70,7 +70,7 @@ public class SCalleeProvidedService extends DeviceService {
MergedRestriction r = MergedRestriction.getFixedValueRestriction( MergedRestriction r = MergedRestriction.getFixedValueRestriction(
DeviceService.PROP_CONTROLS, new SwitchController( DeviceService.PROP_CONTROLS, new SwitchController(
CPublisher.DEVICE_OWN_URI)); CPublisher.DEVICE_OWN_URI));
profiles[0].getTheService().addInstanceLevelRestriction(r, getOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[0] = getOnOffActuatorStatus.getProfile(); profiles[0] = getOnOffActuatorStatus.getProfile();
...@@ -84,7 +84,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -84,7 +84,7 @@ public class SCalleeProvidedService extends DeviceService {
TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] { TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] {
DeviceService.PROP_CONTROLS, DeviceService.PROP_CONTROLS,
SwitchController.PROP_HAS_VALUE }); SwitchController.PROP_HAS_VALUE });
profiles[1].getTheService().addInstanceLevelRestriction(r, setOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[1] = setOnOffActuatorStatus.getProfile(); profiles[1] = setOnOffActuatorStatus.getProfile();
...@@ -98,5 +98,9 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -98,5 +98,9 @@ public class SCalleeProvidedService extends DeviceService {
protected SCalleeProvidedService(String uri) { protected SCalleeProvidedService(String uri) {
super(uri); super(uri);
} }
public String getClassURI() {
return MY_URI;
}
} }
...@@ -67,7 +67,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -67,7 +67,7 @@ public class SCalleeProvidedService extends DeviceService {
MergedRestriction r = MergedRestriction.getFixedValueRestriction( MergedRestriction r = MergedRestriction.getFixedValueRestriction(
DeviceService.PROP_CONTROLS, new SwitchController( DeviceService.PROP_CONTROLS, new SwitchController(
CPublisher.DEVICE_OWN_URI)); CPublisher.DEVICE_OWN_URI));
profiles[0].getTheService().addInstanceLevelRestriction(r, getOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[0] = getOnOffActuatorStatus.getProfile(); profiles[0] = getOnOffActuatorStatus.getProfile();
...@@ -81,7 +81,7 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -81,7 +81,7 @@ public class SCalleeProvidedService extends DeviceService {
TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] { TypeMapper.getDatatypeURI(Boolean.class), 1, 1, new String[] {
DeviceService.PROP_CONTROLS, DeviceService.PROP_CONTROLS,
SwitchController.PROP_HAS_VALUE }); SwitchController.PROP_HAS_VALUE });
profiles[1].getTheService().addInstanceLevelRestriction(r, setOnOffActuatorStatus.addInstanceLevelRestriction(r,
new String[] { DeviceService.PROP_CONTROLS }); new String[] { DeviceService.PROP_CONTROLS });
profiles[1] = setOnOffActuatorStatus.getProfile(); profiles[1] = setOnOffActuatorStatus.getProfile();
...@@ -90,5 +90,9 @@ public class SCalleeProvidedService extends DeviceService { ...@@ -90,5 +90,9 @@ public class SCalleeProvidedService extends DeviceService {
protected SCalleeProvidedService(String uri) { protected SCalleeProvidedService(String uri) {
super(uri); super(uri);
} }
public String getClassURI() {
return MY_URI;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment