package org.onap.policy.controlloop.policy.builder;
-import java.util.Map;
-
import org.onap.policy.aai.Pnf;
import org.onap.policy.controlloop.policy.ControlLoop;
import org.onap.policy.controlloop.policy.OperationsAccumulateParams;
import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.controlloop.policy.PolicyParam;
import org.onap.policy.controlloop.policy.PolicyResult;
-import org.onap.policy.controlloop.policy.Target;
import org.onap.policy.controlloop.policy.builder.impl.ControlLoopPolicyBuilderImpl;
import org.onap.policy.sdc.Resource;
import org.onap.policy.sdc.Service;
import com.google.common.base.Strings;
import java.util.LinkedList;
-import java.util.Map;
import java.util.UUID;
+
import org.onap.policy.aai.Pnf;
import org.onap.policy.controlloop.compiler.CompilerException;
import org.onap.policy.controlloop.compiler.ControlLoopCompiler;
import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.controlloop.policy.PolicyParam;
import org.onap.policy.controlloop.policy.PolicyResult;
-import org.onap.policy.controlloop.policy.Target;
import org.onap.policy.controlloop.policy.builder.BuilderException;
import org.onap.policy.controlloop.policy.builder.ControlLoopPolicyBuilder;
import org.onap.policy.controlloop.policy.builder.MessageLevel;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, null,
- 1111);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "APPC-LCM-READ",
- "org.onap.policy.appclcm.LcmRequestWrapper", new JsonProtocolFilter(), null, null, 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("APPC-LCM-READ")
+ .eventClass("org.onap.policy.appclcm.LcmRequestWrapper")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
} catch (Exception e) {
* control loop (abatement message).
*
* @param controlLoopName the control loop name
- * @param requestID the requestId for this event
+ * @param requestId the requestId for this event
* @param status could be onset or abated
* @param target the target name
* @param kieSession the kieSession to which this event is being sent
import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
final List<TopicSink> noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null,
- null, 1111);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "APPC-CL",
- "org.onap.policy.appc.Request", new JsonProtocolFilter(), null, null, 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("APPC-CL")
+ .eventClass("org.onap.policy.appc.Request")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(),
- null, null,1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
final List<TopicSink> noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null,
- null, 1111);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "APPC-CL",
- "org.onap.policy.appc.Request", new JsonProtocolFilter(), null, null, 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("APPC-CL")
+ .eventClass("org.onap.policy.appc.Request")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, null,
- 1111);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "APPC-LCM-READ",
- "org.onap.policy.appclcm.LcmRequestWrapper", new JsonProtocolFilter(), null, null, 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("APPC-LCM-READ")
+ .eventClass("org.onap.policy.appclcm.LcmRequestWrapper")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
Util.buildGuardSim();
* message) or end the control loop (abatement message).
*
* @param policy the controlLoopName comes from the policy
- * @param requestID the requestId for this event
+ * @param requestId the requestId for this event
* @param status could be onset or abated
* @param target the target entity to take an action on
*/
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, null,
- 1111);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "APPC-LCM-READ",
- "org.onap.policy.appclcm.LcmRequestWrapper", new JsonProtocolFilter(), null, null, 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("APPC-LCM-READ")
+ .eventClass("org.onap.policy.appclcm.LcmRequestWrapper")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
Util.buildGuardSim();
* message) or end the control loop (abatement message).
*
* @param policy the controlLoopName comes from the policy
- * @param requestID the requestId for this event
+ * @param requestId the requestId for this event
* @param status could be onset or abated
*/
protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status) {
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, null,
- 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
* message) or end the control loop (abatement message).
*
* @param policy the controlLoopName comes from the policy
- * @param requestID the requestId for this event
+ * @param requestId the requestId for this event
* @param status could be onset or abated
*/
protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status) {
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, null,
- 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
* message) or end the control loop (abatement message).
*
* @param policy the controlLoopName comes from the policy
- * @param requestID the requestId for this event
+ * @param requestId the requestId for this event
* @param status could be onset or abated
*/
protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status) {
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, null,
- 1111);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "APPC-CL",
- "org.onap.policy.appc.Request", new JsonProtocolFilter(), null, null, 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("APPC-CL")
+ .eventClass("org.onap.policy.appc.Request")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
* message) or end the control loop (abatement message).
*
* @param policy the controlLoopName comes from the policy
- * @param requestID the requestId for this event
+ * @param requestId the requestId for this event
* @param status could be onset or abated
*/
protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status) {
* message) or end the control loop (abatement message).
*
* @param policy the controlLoopName comes from the policy
- * @param requestID the requestId for this event
+ * @param requestId the requestId for this event
* @param status could be onset or abated
*/
protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status, String vnfId) {
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.protocol.coders.EventProtocolCoder;
+import org.onap.policy.drools.protocol.coders.EventProtocolParams;
import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.drools.system.PolicyEngine;
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT",
- "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, null,
- 1111);
- EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "SDNR-CL",
- "org.onap.policy.sdnr.PciRequestWrapper", new JsonProtocolFilter(), null, null, 1111);
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("POLICY-CL-MGT")
+ .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
+ EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
+ .groupId("junit.groupId")
+ .artifactId("junit.artifactId")
+ .topic("SDNR-CL")
+ .eventClass("org.onap.policy.sdnr.PciRequestWrapper")
+ .protocolFilter(new JsonProtocolFilter())
+ .customGsonCoder(null)
+ .customJacksonCoder(null)
+ .modelClassLoaderHash(1111));
try {
Util.buildAaiSim();
Util.buildGuardSim();
*
* @param policy
* the controlLoopName comes from the policy
- * @param requestID
+ * @param requestId
* the requestId for this event
* @param status
* could be onset