+ try {
+ // TODO: This is a HACK, we need to validate the properties against their
+ // TODO: their data type in their policy type definition in TOSCA, which means reading
+ // TODO: the policy type from the database and parsing the property value object correctly
+ // TODO: Here we are simply reading a JSON string from the database and deserializing the
+ // TODO: property value from JSON
+ propertyMap.put(entry.getKey(), new StandardCoder().decode(entry.getValue(), Object.class));
+ } catch (CoderException ce) {
+ String errorMessage = "error decoding property JSON value read from database: key=" + entry.getKey()
+ + ", value=" + entry.getValue();
+ throw new PfModelRuntimeException(Response.Status.INTERNAL_SERVER_ERROR, errorMessage, ce);
+ }