diff options
Diffstat (limited to 'applications/guard')
3 files changed, 7 insertions, 7 deletions
diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java index f1006c6d..2c7ad587 100644 --- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java +++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java @@ -39,9 +39,6 @@ import java.util.Map; import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.Stream; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; - import org.apache.commons.io.IOUtils; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardYamlCoder; @@ -63,7 +60,7 @@ public class CoordinationGuardTranslator implements ToscaPolicyTranslator { } @Override - public PolicyType convertPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException { + public Object convertPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException { LOGGER.debug("Using CoordinationGuardTranslator.convertPolicy"); // // Policy name should be at the root @@ -88,7 +85,7 @@ public class CoordinationGuardTranslator implements ToscaPolicyTranslator { // Scan the string and convert to PoilcyType // try (InputStream is = new ByteArrayInputStream(xacmlStr.getBytes(StandardCharsets.UTF_8))) { - return (PolicyType) XACMLPolicyScanner.readPolicy(is); + return XACMLPolicyScanner.readPolicy(is); } catch (IOException e) { throw new ToscaPolicyConversionException("Failed to read policy", e); } diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java index fd46a988..1e4333ea 100644 --- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java +++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java @@ -96,7 +96,8 @@ public class GuardTranslator implements ToscaPolicyTranslator { /** * Convert the policy. */ - public PolicyType convertPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException { + @Override + public Object convertPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException { // // Policy name should be at the root // @@ -140,6 +141,7 @@ public class GuardTranslator implements ToscaPolicyTranslator { /** * Convert Request. */ + @Override public Request convertRequest(DecisionRequest request) throws ToscaPolicyConversionException { LOGGER.info("Converting Request {}", request); try { @@ -152,6 +154,7 @@ public class GuardTranslator implements ToscaPolicyTranslator { /** * Convert response. */ + @Override public DecisionResponse convertResponse(Response xacmlResponse) { LOGGER.info("Converting Response {}", xacmlResponse); DecisionResponse decisionResponse = new DecisionResponse(); diff --git a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslatorTest.java b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslatorTest.java index 36b43aee..c785a50c 100644 --- a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslatorTest.java +++ b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslatorTest.java @@ -166,7 +166,7 @@ public class GuardTranslatorTest { translator.convertPolicy(policy)); continue; } - PolicyType xacmlPolicy = translator.convertPolicy(policy); + PolicyType xacmlPolicy = (PolicyType) translator.convertPolicy(policy); assertThat(xacmlPolicy).isNotNull(); // // Let's dump it out |