import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
import org.onap.policy.appc.CommonHeader;
import org.onap.policy.appc.Request;
import org.onap.policy.appc.Response;
super(params, config, Response.class);
}
+ /**
+ * Starts the GUARD.
+ */
+ @Override
+ protected CompletableFuture<OperationOutcome> startPreprocessorAsync() {
+ return startGuardAsync();
+ }
+
/**
* Makes a request, given the target VNF. This is a support function for
* {@link #makeRequest(int)}.
* @param source source from which to get the values
* @param target where to place the decoded values
*/
- private static void convertPayload(Map<String, String> source, Map<String, Object> target) {
- for (Entry<String, String> ent : source.entrySet()) {
+ private static void convertPayload(Map<String, Object> source, Map<String, Object> target) {
+ for (Entry<String, Object> ent : source.entrySet()) {
+ Object value = ent.getValue();
+ if (value == null) {
+ target.put(ent.getKey(), null);
+ continue;
+ }
+
try {
- target.put(ent.getKey(), coder.decode(ent.getValue(), Object.class));
+ target.put(ent.getKey(), coder.decode(value.toString(), Object.class));
} catch (CoderException e) {
logger.warn("cannot decode JSON value {}: {}", ent.getKey(), ent.getValue(), e);