* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import com.google.common.base.Strings;
import java.util.Collection;
import java.util.Map;
+import lombok.NoArgsConstructor;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@NoArgsConstructor
public class StdCombinedPolicyResultsTranslator extends StdBaseTranslator {
private static final Logger LOGGER = LoggerFactory.getLogger(StdCombinedPolicyResultsTranslator.class);
- public StdCombinedPolicyResultsTranslator() {
- super();
- }
-
@Override
public Object convertPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException {
//
//
// Get the policy Id
//
- String policyId = toscaPolicy.getMetadata().get(POLICY_ID);
+ String policyId = String.valueOf(toscaPolicy.getMetadata().get(POLICY_ID));
//
// Set it as the policy ID
//
// Sanity check that we got the attributes we care about. NOTE: This translator
// ensures that these are set when convertPolicy is called.
//
- if (! Strings.isNullOrEmpty(policyId) && policyContent != null) {
+ if (! Strings.isNullOrEmpty(policyId) && !policyContent.isEmpty()) {
decisionResponse.getPolicies().put(policyId, policyContent);
} else {
LOGGER.error("Missing obligation policyId {} or policyContent {}", policyId,