Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.om2m.ipe.sdt/src/main/java/org/eclipse/om2m/ipe/sdt/flexcontainerservice/ActionFlexContainerService.java')
-rw-r--r--org.eclipse.om2m.ipe.sdt/src/main/java/org/eclipse/om2m/ipe/sdt/flexcontainerservice/ActionFlexContainerService.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/org.eclipse.om2m.ipe.sdt/src/main/java/org/eclipse/om2m/ipe/sdt/flexcontainerservice/ActionFlexContainerService.java b/org.eclipse.om2m.ipe.sdt/src/main/java/org/eclipse/om2m/ipe/sdt/flexcontainerservice/ActionFlexContainerService.java
index 6bc552bc..42d3d6be 100644
--- a/org.eclipse.om2m.ipe.sdt/src/main/java/org/eclipse/om2m/ipe/sdt/flexcontainerservice/ActionFlexContainerService.java
+++ b/org.eclipse.om2m.ipe.sdt/src/main/java/org/eclipse/om2m/ipe/sdt/flexcontainerservice/ActionFlexContainerService.java
@@ -20,11 +20,11 @@ import org.eclipse.om2m.commons.resource.CustomAttribute;
import org.eclipse.om2m.commons.resource.RequestPrimitive;
import org.eclipse.om2m.flexcontainer.service.FlexContainerService;
import org.eclipse.om2m.ipe.sdt.Activator;
-import org.eclipse.om2m.ipe.sdt.SDTUtil;
import org.eclipse.om2m.sdt.Action;
import org.eclipse.om2m.sdt.args.Command;
import org.eclipse.om2m.sdt.exceptions.AccessException;
import org.eclipse.om2m.sdt.exceptions.ActionException;
+import org.eclipse.om2m.sdt.types.DataType;
import org.osgi.framework.ServiceRegistration;
public class ActionFlexContainerService implements FlexContainerService {
@@ -86,16 +86,15 @@ public class ActionFlexContainerService implements FlexContainerService {
for (String argName : action.getArgNames()) {
CustomAttribute ca = getCustomAttribute(customAttributes, argName);
if (ca != null) {
- args.put(argName, SDTUtil.getValue(ca, "string"));
+ DataType type = DataType.getDataType(ca.getType());
+ args.put(argName,
+ type.getTypeChoice().fromString(ca.getValue()));
}
}
} catch (Exception e) {
e.printStackTrace();
}
-// actionToBeInvoked = true;
- } /* else nothing to do */
-// } else {
-// actionToBeInvoked = true;
+ }
}
// if (actionToBeInvoked) {
@@ -105,16 +104,16 @@ public class ActionFlexContainerService implements FlexContainerService {
Object response = ((Command) action).invoke(args);
if (response != null) {
CustomAttribute output = new CustomAttribute();
- output.setCustomAttributeName("output");
- output.setCustomAttributeValue(response.toString());
+ output.setShortName("output");
+ output.setValue(response.toString());
customAttributes.add(output);
}
} catch (ActionException e) {
- logger.debug("setCustomAttributeValues(" + customAttributes
+ logger.info("setCustomAttributeValues(" + customAttributes
+ ") - KO: " + e.getMessage());
throw new Om2mException("action execution failed:" + e.getMessage(), ResponseStatusCode.BAD_REQUEST);
} catch (AccessException e) {
- logger.debug("setCustomAttributeValues(" + customAttributes
+ logger.info("setCustomAttributeValues(" + customAttributes
+ ") - KO: " + e.getMessage());
throw new Om2mException("action execution failed:" + e.getMessage(), ResponseStatusCode.ACCESS_DENIED);
}
@@ -138,7 +137,7 @@ public class ActionFlexContainerService implements FlexContainerService {
private static CustomAttribute getCustomAttribute(List<CustomAttribute> customAttributes, String name) {
if (customAttributes != null) {
for (CustomAttribute ca : customAttributes) {
- if (name.equals(ca.getCustomAttributeName())) {
+ if (name.equals(ca.getShortName())) {
return ca;
}
}

Back to the top