aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/controller-frankfurt
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-10-26 16:48:47 -0400
committerJim Hahn <jrh3@att.com>2020-11-16 14:28:34 -0500
commite8369d6d3088b7b68acb987ebff432ac830a3200 (patch)
tree70a4b752c6c9f2b0ff351dc1a195548a300fb098 /controlloop/common/controller-frankfurt
parent21362791e6488bb36f543f0319b195e24f239dcb (diff)
Make drools-apps event agnostic
Removed tdjam and frankfurt controllers, which use event-specific actors. Issue-ID: POLICY-2804 Change-Id: Ica05f80bf72d039d9c4903591af7fb3793a81159 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/controller-frankfurt')
-rw-r--r--controlloop/common/controller-frankfurt/pom.xml228
-rw-r--r--controlloop/common/controller-frankfurt/src/main/resources/META-INF/kmodule.xml26
-rw-r--r--controlloop/common/controller-frankfurt/src/main/resources/frankfurt.drl363
-rw-r--r--controlloop/common/controller-frankfurt/src/test/java/org/onap/policy/controlloop/FrankfurtTest.java113
-rw-r--r--controlloop/common/controller-frankfurt/src/test/resources/config/event-manager.properties83
-rw-r--r--controlloop/common/controller-frankfurt/src/test/resources/config/frankfurt-controller.properties63
-rw-r--r--controlloop/common/controller-frankfurt/src/test/resources/config/frankfurt-http-client.properties52
-rw-r--r--controlloop/common/controller-frankfurt/src/test/resources/frankfurt.pom30
8 files changed, 0 insertions, 958 deletions
diff --git a/controlloop/common/controller-frankfurt/pom.xml b/controlloop/common/controller-frankfurt/pom.xml
deleted file mode 100644
index e9ef3e8a3..000000000
--- a/controlloop/common/controller-frankfurt/pom.xml
+++ /dev/null
@@ -1,228 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ONAP
- ================================================================================
- Copyright (C) 2020 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.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END=========================================================
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.onap.policy.drools-applications.controlloop.common</groupId>
- <artifactId>drools-applications-common</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>controller-frankfurt</artifactId>
- <packaging>kjar</packaging>
-
- <name>${project.artifactId}</name>
- <description>Frankfurt Controller</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.kie</groupId>
- <artifactId>kie-maven-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>events</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>aai</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>appc</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>appclcm</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>cds</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>sdnc</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>sdnr</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>so</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>vfc</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.drools-applications.controlloop.common</groupId>
- <artifactId>eventmanager</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actorServiceProvider</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.aai</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.appc</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.appclcm</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.cds</artifactId>
- <version>${policy.models.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.guard</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.sdnc</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.sdnr</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.so</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.vfc</artifactId>
- <version>${policy.models.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.drools-pdp</groupId>
- <artifactId>policy-management</artifactId>
- <version>${version.policy.drools-pdp}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.drools-applications.controlloop.common</groupId>
- <artifactId>rules-test</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <!--This profile is used to store Eclipse m2e settings only. It has no
- influence on the Maven build itself. -->
- <id>only-eclipse</id>
- <activation>
- <property>
- <name>m2e.version</name>
- </property>
- </activation>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.kie</groupId>
- <artifactId>kie-maven-plugin</artifactId>
- <goals>
- <goal>build</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore />
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/controlloop/common/controller-frankfurt/src/main/resources/META-INF/kmodule.xml b/controlloop/common/controller-frankfurt/src/main/resources/META-INF/kmodule.xml
deleted file mode 100644
index cc39944a0..000000000
--- a/controlloop/common/controller-frankfurt/src/main/resources/META-INF/kmodule.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ONAP
- ================================================================================
- Copyright (C) 2020 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.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END=========================================================
- -->
-<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
- <kbase name="onap.policies.controlloop.operational.common.Drools" equalsBehavior="equality"
- packages="org.onap.policy.controlloop">
- <ksession name="frankfurt"/>
- </kbase>
-</kmodule>
diff --git a/controlloop/common/controller-frankfurt/src/main/resources/frankfurt.drl b/controlloop/common/controller-frankfurt/src/main/resources/frankfurt.drl
deleted file mode 100644
index 8169e1cdc..000000000
--- a/controlloop/common/controller-frankfurt/src/main/resources/frankfurt.drl
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * ONAP
- * ================================================================================
- * Copyright (C) 2020 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.controlloop;
-
-import org.onap.policy.controlloop.drl.legacy.ControlLoopParams;
-import org.onap.policy.controlloop.CanonicalOnset;
-import org.onap.policy.controlloop.VirtualControlLoopEvent;
-import org.onap.policy.controlloop.VirtualControlLoopNotification;
-import org.onap.policy.controlloop.ControlLoopNotificationType;
-import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager2Drools;
-import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager2.NewEventStatus;
-import org.onap.policy.controlloop.eventmanager.ControlLoopOperationManager2;
-import org.onap.policy.controlloop.utils.ControlLoopUtils;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
-
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-import org.onap.policy.drools.system.PolicyEngineConstants;
-
-/*
-*
-* Called when the ControlLoopParams object has been inserted into working memory from the BRMSGW.
-*
-*/
-rule "INSERT.PARAMS"
- when
- $params : ControlLoopParams()
- then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
- logger.info("{}: {} : TOSCA-POLICY=[{}]", $params.getClosedLoopControlName(), $params.getPolicyName() + "."
- + drools.getRule().getName(), $params.getToscaPolicy());
-end
-
-/*
-*
-* Called when a Tosca Policy is present.
-*
-*/
-rule "NEW.TOSCA.POLICY"
- when
- $policy : ToscaPolicy()
- then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
- logger.info("{}: [{}|{}|{}|{}]: CONTENT: {}", drools.getRule().getName(),
- $policy.getType(), $policy.getTypeVersion(), $policy.getName(),
- $policy.getVersion(), $policy);
-
- ControlLoopParams params = ControlLoopUtils.toControlLoopParams($policy);
- if (params != null) {
- insert(params);
- }
-end
-
-/*
- * Remove Control Loop Parameters.
- */
-rule "REMOVE.PARAMS"
- when
- $params : ControlLoopParams( $policyName : getPolicyName(), $policyVersion : getPolicyVersion() )
- not ( ToscaPolicy( getName() == $policyName, getVersion() == $policyVersion ) )
- then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
- logger.info("{}: [{}|{}|{}]", drools.getRule().getName(),
- $params.getPolicyScope(), $params.getPolicyName(), $params.getPolicyVersion());
-
- retract($params);
-end
-
-/*
-*
-* This rule responds to DCAE Events where there is no manager yet. Either it is
-* the first ONSET, or a subsequent badly formed Event (i.e. Syntax error, or is-closed-loop-disabled)
-*
-*/
-rule "EVENT"
- when
- $params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : CanonicalOnset( closedLoopControlName == $clName )
- not ( ControlLoopEventManager2Drools( closedLoopControlName == $event.getClosedLoopControlName(),
- getContext().getEvent() == $event ) )
- then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
- logger.info("{}: {}.{}: event={}",
- $clName, $params.getPolicyName(), drools.getRule().getName(),
- $event);
- //
- // Retract the event from memory; it will be managed by the manager for now on
- //
- retract($event);
-
- VirtualControlLoopNotification notification;
-
- try {
- //
- // Check the event, because we need it to not be null when
- // we create the ControlLoopEventManager2Drools. The ControlLoopEventManager2Drools
- // will do extra syntax checking as well as check if the closed loop is disabled.
- //
- if ($event.getRequestId() == null) {
- notification = new VirtualControlLoopNotification($event);
- notification.setNotification(ControlLoopNotificationType.REJECTED);
- notification.setFrom("policy");
- notification.setMessage("Missing requestId");
- notification.setPolicyName($params.getPolicyName() + "." + drools.getRule().getName());
- notification.setPolicyScope($params.getPolicyScope());
- notification.setPolicyVersion($params.getPolicyVersion());
-
- } else {
- ControlLoopEventManager2Drools manager = new ControlLoopEventManager2Drools($params, $event, drools.getWorkingMemory());
- insert(manager);
- try {
- manager.start();
- } catch(Exception e) {
- retract(manager);
- throw e;
- }
- notification = manager.makeNotification();
- notification.setNotification(ControlLoopNotificationType.ACTIVE);
- notification.setPolicyName($params.getPolicyName() + "." + drools.getRule().getName());
- }
- } catch (Exception e) {
- logger.warn("{}: {}.{}", $clName, $params.getPolicyName(), drools.getRule().getName(), e);
- notification = new VirtualControlLoopNotification($event);
- notification.setNotification(ControlLoopNotificationType.REJECTED);
- notification.setMessage("Exception occurred: " + e.getMessage());
- notification.setPolicyName($params.getPolicyName() + "." + drools.getRule().getName());
- notification.setPolicyScope($params.getPolicyScope());
- notification.setPolicyVersion($params.getPolicyVersion());
- }
- //
- // Generate notification
- //
- try {
- PolicyEngineConstants.getManager().deliver("POLICY-CL-MGT", notification);
-
- } catch(RuntimeException e) {
- logger.warn("{}: {}.{}: event={} exception generating notification",
- $clName, $params.getPolicyName(), drools.getRule().getName(),
- $event, e);
- }
-end
-
-/*
-*
-* This rule happens when we get a subsequent event.
-*
-*/
-rule "EVENT.MANAGER.NEW.EVENT"
- when
- $event : VirtualControlLoopEvent( )
- $manager : ControlLoopEventManager2Drools( closedLoopControlName == $event.getClosedLoopControlName(),
- getContext().getEvent() == $event )
- then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
- logger.info("{}: {}.{}: event={} manager={}",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName(),
- $event, $manager);
- //
- // Remove the event from memory
- //
- retract($event);
-
- //
- // Check what kind of event this is
- //
- switch($manager.onNewEvent($event)) {
- case SYNTAX_ERROR:
- //
- // Ignore any bad syntax events
- //
- logger.warn("{}: {}.{}: syntax error",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName());
- break;
-
- case FIRST_ABATEMENT:
- case SUBSEQUENT_ABATEMENT:
- //
- // TODO: handle the abatement. Currently, it's just discarded.
- //
- logger.info("{}: {}.{}: abatement",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName());
- break;
-
- case FIRST_ONSET:
- case SUBSEQUENT_ONSET:
- default:
- //
- // We don't care about subsequent onsets
- //
- logger.warn("{}: {}.{}: subsequent onset",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName());
- break;
- }
-end
-
-/*
-*
-* Step completed
-*
-*/
-rule "EVENT.MANAGER.PROCESSING"
- when
- $manager : ControlLoopEventManager2Drools( isUpdated(), isActive(), $notification : getNotification() )
- then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
- logger.info("{}: {}.{}: manager={}",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName(),
- $manager);
- //
- // Generate notification
- //
- try {
- $notification.setPolicyName($manager.getPolicyName() + "." + drools.getRule().getName());
- PolicyEngineConstants.getManager().deliver("POLICY-CL-MGT", $notification);
-
- } catch(RuntimeException e) {
- logger.warn("{}: {}.{}: manager={} exception generating notification",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName(),
- $manager, e);
- }
- //
- // Generate Response notification
- //
- try {
- ControlLoopResponse clResponse = $manager.getControlLoopResponse();
- if (clResponse != null) {
- PolicyEngineConstants.getManager().deliver("DCAE_CL_RSP", clResponse);
- }
-
- } catch(RuntimeException e) {
- logger.warn("{}: {}.{}: manager={} exception generating Response notification",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName(),
- $manager, e);
- }
- //
- // Discard this message and wait for the next response.
- //
- $manager.nextStep();
- update($manager);
-end
-
-/*
-*
-* Final step completed
-*
-*/
-rule "EVENT.MANAGER.FINAL"
- when
- $manager : ControlLoopEventManager2Drools( !isActive(), $notification : getNotification() )
- then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
- logger.info("{}: {}.{}: manager={}",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName(),
- $manager);
- //
- // Generate notification
- //
- try {
- $notification.setPolicyName($manager.getPolicyName() + "." + drools.getRule().getName());
- PolicyEngineConstants.getManager().deliver("POLICY-CL-MGT", $notification);
-
- } catch(RuntimeException e) {
- logger.warn("{}: {}.{}: manager={} exception generating notification",
- $manager.getClosedLoopControlName(), $manager.getPolicyName(), drools.getRule().getName(),
- $manager, e);
- }
- //
- // Retract and destroy the manager
- //
- retract($manager);
- $manager.destroy();
-end
-
-/*
-*
-* This rule will clean up any rogue events where there is no
-* ControlLoopParams object corresponding to the onset event.
-*
-*/
-rule "EVENT.CLEANUP"
- salience -1
- when
- $event : VirtualControlLoopEvent( $clName: closedLoopControlName )
- then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
- logger.info("{}: {}", $clName, drools.getRule().getName());
- logger.debug("{}: {}: orphan event={}",
- $clName, drools.getRule().getName(), $event);
- //
- // Retract the event
- //
- retract($event);
-end
-
-/*
-*
-* At this point, it appears that if we prevent the rules from getting messages from
-* topics, then that will also prevent the actors from getting them. So the following
-* rules are here just to discard those messages.
-*
-* These have a higher salience so the objects are removed before the "FINAL" message
-* is processed, so that the junit test can assume things are done once they see the
-* "FINAL" message. Otherwise, tests might fail sporadically.
-*
-*/
-rule "APPC.Response.CLEANUP"
- salience 1
- when
- $msg : org.onap.policy.appc.Response( )
- then
- retract($msg);
-end
-
-rule "APPC.Request.CLEANUP"
- salience 1
- when
- $msg : org.onap.policy.appc.Request( )
- then
- retract($msg);
-end
-
-rule "APPC-LCM.Response.CLEANUP"
- salience 1
- when
- $msg : org.onap.policy.appclcm.AppcLcmDmaapWrapper( )
- then
- retract($msg);
-end
-
-rule "SDNR.Response.CLEANUP"
- salience 1
- when
- $msg : org.onap.policy.sdnr.PciResponseWrapper( )
- then
- retract($msg);
-end
diff --git a/controlloop/common/controller-frankfurt/src/test/java/org/onap/policy/controlloop/FrankfurtTest.java b/controlloop/common/controller-frankfurt/src/test/java/org/onap/policy/controlloop/FrankfurtTest.java
deleted file mode 100644
index fd9847b07..000000000
--- a/controlloop/common/controller-frankfurt/src/test/java/org/onap/policy/controlloop/FrankfurtTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP
- * ================================================================================
- * Copyright (C) 2020 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.controlloop;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-import org.onap.policy.controlloop.common.rules.test.DroolsRuleTest;
-import org.onap.policy.controlloop.common.rules.test.Listener;
-import org.onap.policy.controlloop.common.rules.test.NamedRunner;
-import org.onap.policy.controlloop.common.rules.test.TestNames;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
-import org.onap.policy.simulators.Util;
-
-/**
- * Tests use cases using Frankfurt rules.
- *
- * <p/>
- * Note: this runs ALL tests (i.e., any whose names start with "test").
- */
-@RunWith(NamedRunner.class)
-@TestNames(prefixes = {"test"})
-
-public class FrankfurtTest extends DroolsRuleTest {
- protected static final String CONTROLLER_NAME = "frankfurt";
-
-
- /**
- * Sets up statics.
- */
- @BeforeClass
- public static void setUpBeforeClass() {
- initStatics(CONTROLLER_NAME);
-
- rules.configure("src/main/resources");
- rules.start();
- httpClients.addClients("frankfurt");
- simulators.start(Util::buildAaiSim, Util::buildSoSim, Util::buildVfcSim, Util::buildGuardSim,
- Util::buildSdncSim);
- }
-
- /**
- * Cleans up statics.
- */
- @AfterClass
- public static void tearDownAfterClass() {
- finishStatics();
- }
-
- /**
- * Sets up.
- */
- @Before
- public void setUp() {
- init();
- }
-
- /**
- * Tears down.
- */
- @After
- public void tearDown() {
- finish();
- }
-
- @Override
- protected void waitForLockAndPermit(ToscaPolicy policy, Listener<VirtualControlLoopNotification> policyClMgt) {
- String policyName = policy.getIdentifier().getName();
-
- policyClMgt.await(notif -> notif.getNotification() == ControlLoopNotificationType.ACTIVE
- && (policyName + ".EVENT").equals(notif.getPolicyName()));
-
- policyClMgt.await(notif -> notif.getNotification() == ControlLoopNotificationType.OPERATION
- && (policyName + ".EVENT.MANAGER.PROCESSING").equals(notif.getPolicyName())
- && notif.getMessage().startsWith("Sending guard query"));
-
- policyClMgt.await(notif -> notif.getNotification() == ControlLoopNotificationType.OPERATION
- && (policyName + ".EVENT.MANAGER.PROCESSING").equals(notif.getPolicyName())
- && notif.getMessage().startsWith("Guard result") && notif.getMessage().endsWith("Permit"));
-
- policyClMgt.await(notif -> notif.getNotification() == ControlLoopNotificationType.OPERATION
- && (policyName + ".EVENT.MANAGER.PROCESSING").equals(notif.getPolicyName())
- && notif.getMessage().startsWith("actor="));
- }
-
- @Override
- protected VirtualControlLoopNotification waitForFinal(ToscaPolicy policy,
- Listener<VirtualControlLoopNotification> policyClMgt, ControlLoopNotificationType finalType) {
-
- return policyClMgt.await(notif -> notif.getNotification() == finalType
- && (policy.getIdentifier().getName() + ".EVENT.MANAGER.FINAL").equals(notif.getPolicyName()));
- }
-}
diff --git a/controlloop/common/controller-frankfurt/src/test/resources/config/event-manager.properties b/controlloop/common/controller-frankfurt/src/test/resources/config/event-manager.properties
deleted file mode 100644
index 7dd1e73c2..000000000
--- a/controlloop/common/controller-frankfurt/src/test/resources/config/event-manager.properties
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# ============LICENSE_START======================================================
-# ONAP
-# ===============================================================================
-# Copyright (C) 2020 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.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END========================================================
-#
-
-# DB parameters
-operation.history.url=jdbc:h2:mem:Frankfurt
-operation.history.userName=sa
-operation.history.password=
-
-# Actor parameters
-#
-# Note: every operation must have at least one entry, otherwise it will not be
-# configured and started. Thus some of them have a "placeholder" property.
-#
-
-#actor.service.GUARD.disabled=true
-actor.service.GUARD.clientName=GUARD
-actor.service.GUARD.onapName=my-onap-name
-actor.service.GUARD.onapComponent=my-onap-component
-actor.service.GUARD.onapInstance=my-onap-instance
-actor.service.GUARD.operations.Decision.path=decision
-
-actor.service.AAI.clientName=AAI
-actor.service.AAI.operations.CustomQuery.path=aai/v16/query
-actor.service.AAI.operations.Pnf.path=aai/v16/network/pnfs/pnf
-actor.service.AAI.operations.Tenant.path=aai/v16/search/nodes-query
-
-actor.service.APPC.sinkTopic=APPC-LCM-READ
-actor.service.APPC.sourceTopic=APPC-LCM-WRITE
-actor.service.APPC.operations.ConfigModify.placeholder=
-actor.service.APPC.operations.Migrate.placeholder=
-actor.service.APPC.operations.Restart.placeholder=
-actor.service.APPC.operations.Rebuild.placeholder=
-
-# legacy APPC - must specify sink and source for each operation
-actor.service.APPC.operations.ModifyConfig.sinkTopic=APPC-CL
-actor.service.APPC.operations.ModifyConfig.sourceTopic=APPC-CL
-
-actor.service.CDS.operations.any.host=localhost
-actor.service.CDS.operations.any.port=7878
-actor.service.CDS.operations.any.username=grpc-username
-actor.service.CDS.operations.any.password=grpc-password
-actor.service.CDS.operations.any.timeout=10
-
-actor.service.SDNC.clientName=SDNC
-actor.service.SDNC.operations.BandwidthOnDemand.path=\
- GENERIC-RESOURCE-API:vf-module-topology-operation
-actor.service.SDNC.operations.Reroute.path=\
- GENERIC-RESOURCE-API:network-topology-operation
-
-actor.service.SDNR.sinkTopic=SDNR-CL
-actor.service.SDNR.sourceTopic=SDNR-CL-RSP
-actor.service.SDNR.operations.any.placeholder=
-
-actor.service.SO.clientName=SO
-actor.service.SO.pollPath=orchestrationRequests/v5/
-actor.service.SO.maxPolls=20
-actor.service.SO.pollWaitSec=20
-actor.service.SO.operations.VF\ Module\ Create.path=serviceInstantiation/v7/serviceInstances
-actor.service.SO.operations.VF\ Module\ Delete.path=serviceInstances/v7
-
-actor.service.VFC.clientName=VFC
-actor.service.VFC.pollPath=jobs
-actor.service.VFC.maxPolls=20
-actor.service.VFC.pollWaitSec=20
-actor.service.VFC.operations.Restart.path=ns
-actor.service.VFC.operations.Restart.timeoutSec=60
diff --git a/controlloop/common/controller-frankfurt/src/test/resources/config/frankfurt-controller.properties b/controlloop/common/controller-frankfurt/src/test/resources/config/frankfurt-controller.properties
deleted file mode 100644
index af3d0eb24..000000000
--- a/controlloop/common/controller-frankfurt/src/test/resources/config/frankfurt-controller.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# ============LICENSE_START=======================================================
-# ONAP
-# ================================================================================
-# Copyright (C) 2020 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.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-
-controller.name=frankfurt
-
-rules.groupId=org.onap.policy.controlloop
-rules.artifactId=frankfurt
-rules.version=1.0.0
-
-noop.source.topics=DCAE_TOPIC,APPC-CL,APPC-LCM-WRITE,SDNR-CL-RSP,POLICY-CL-MGT,APPC-LCM-READ
-
-noop.source.topics.DCAE_TOPIC.events=\
- org.onap.policy.controlloop.CanonicalOnset,org.onap.policy.controlloop.CanonicalAbated
-noop.source.topics.DCAE_TOPIC.events.org.onap.policy.controlloop.CanonicalOnset.\
- filter=[?($.closedLoopEventStatus == 'ONSET')]
-noop.source.topics.DCAE_TOPIC.events.org.onap.policy.controlloop.CanonicalAbated.\
- filter=[?($.closedLoopEventStatus == 'ABATED')]
-noop.source.topics.DCAE_TOPIC.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gson
-
-noop.source.topics.APPC-CL.events=org.onap.policy.appc.Response,org.onap.policy.appc.Request
-noop.source.topics.APPC-CL.events.org.onap.policy.appc.Response.filter=[?($.CommonHeader && $.Status)]
-noop.source.topics.APPC-CL.events.org.onap.policy.appc.Request.filter=[?($.CommonHeader && $.Action)]
-noop.source.topics.APPC-CL.events.custom.gson=org.onap.policy.appc.util.Serialization,gsonPretty
-
-noop.source.topics.APPC-LCM-WRITE.events=org.onap.policy.appclcm.AppcLcmDmaapWrapper
-noop.source.topics.APPC-LCM-WRITE.events.org.onap.policy.appclcm.AppcLcmDmaapWrapper.filter=[?($.type == 'response')]
-noop.source.topics.APPC-LCM-WRITE.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
-
-noop.source.topics.SDNR-CL-RSP.events=org.onap.policy.sdnr.PciResponseWrapper
-noop.source.topics.SDNR-CL-RSP.events.org.onap.policy.sdnr.PciResponseWrapper.filter=[?($.type == 'response')]
-noop.source.topics.SDNR-CL-RSP.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson
-
-noop.source.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification
-noop.source.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
-
-noop.source.topics.APPC-LCM-READ.events=org.onap.policy.appclcm.AppcLcmDmaapWrapper
-noop.source.topics.APPC-LCM-READ.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
-
-noop.sink.topics=APPC-CL,APPC-LCM-READ,POLICY-CL-MGT,SDNR-CL,DCAE_CL_RSP
-
-noop.sink.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification
-noop.sink.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
-
-noop.sink.topics.DCAE_CL_RSP.events=org.onap.policy.controlloop.ControlLoopResponse
-noop.sink.topics.DCAE_CL_RSP.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
-
diff --git a/controlloop/common/controller-frankfurt/src/test/resources/config/frankfurt-http-client.properties b/controlloop/common/controller-frankfurt/src/test/resources/config/frankfurt-http-client.properties
deleted file mode 100644
index 1e3e88cec..000000000
--- a/controlloop/common/controller-frankfurt/src/test/resources/config/frankfurt-http-client.properties
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# ============LICENSE_START=======================================================
-# ONAP
-# ================================================================================
-# Copyright (C) 2020 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.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-
-http.client.services=GUARD,AAI,SDNC,SO,VFC
-
-http.client.services.GUARD.managed=true
-http.client.services.GUARD.host=localhost
-http.client.services.GUARD.port=6669
-http.client.services.GUARD.userName=pdpx
-http.client.services.GUARD.password=pdpx
-http.client.services.GUARD.contextUriPath=policy/pdpx/v1/
-
-http.client.services.AAI.managed=true
-http.client.services.AAI.host=localhost
-http.client.services.AAI.port=6666
-http.client.services.AAI.contextUriPath=
-
-http.client.services.SDNC.managed=true
-http.client.services.SDNC.host=localhost
-http.client.services.SDNC.port=6665
-http.client.services.SDNC.userName=sdnc
-http.client.services.SDNC.password=sdnc
-http.client.services.SDNC.contextUriPath=
-
-http.client.services.SO.managed=true
-http.client.services.SO.host=localhost
-http.client.services.SO.port=6667
-http.client.services.SO.contextUriPath=
-
-http.client.services.VFC.managed=true
-http.client.services.VFC.host=localhost
-http.client.services.VFC.port=6668
-http.client.services.VFC.userName=VFC
-http.client.services.VFC.password=VFC
-http.client.services.VFC.contextUriPath=api/nslcm/v1
diff --git a/controlloop/common/controller-frankfurt/src/test/resources/frankfurt.pom b/controlloop/common/controller-frankfurt/src/test/resources/frankfurt.pom
deleted file mode 100644
index 707e59c9e..000000000
--- a/controlloop/common/controller-frankfurt/src/test/resources/frankfurt.pom
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ONAP
- ================================================================================
- Copyright (C) 2020 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.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END=========================================================
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.onap.policy.controlloop</groupId>
- <artifactId>frankfurt</artifactId>
- <version>1.0.0</version>
-</project>