Merge "Add Control Loop Coordination policy."
[policy/xacml-pdp.git] / applications / common / src / main / java / org / onap / policy / pdp / xacml / application / common / std / StdXacmlApplicationServiceProvider.java
index 2eddc2e..95a642e 100644 (file)
@@ -132,7 +132,8 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
             //
             // Convert the policies first
             //
-            PolicyType xacmlPolicy = this.getTranslator().convertPolicy(toscaPolicy);
+            PolicyType xacmlPolicy = this.getTranslator(toscaPolicy.getType())
+                .convertPolicy(toscaPolicy);
             if (xacmlPolicy == null) {
                 throw new ToscaPolicyConversionException("Failed to convert policy");
             }
@@ -254,8 +255,11 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
         return this.getTranslator().convertResponse(xacmlResponse);
     }
 
+    protected abstract ToscaPolicyTranslator getTranslator(String type);
 
-    protected abstract ToscaPolicyTranslator getTranslator();
+    protected ToscaPolicyTranslator getTranslator() {
+        return this.getTranslator("");
+    }
 
     protected synchronized PDPEngine getEngine() {
         return this.pdpEngine;