From 10b21aae2bde224ab7f91f4b5ab1b89369c8fd1c Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 8 May 2019 14:33:57 -0400 Subject: Add payload to vFW policy yaml Added new "streams" payload to vFW policy yaml files. Removed references to pg-streams. Also deleted directories that were moved to policy/models. Also removed references to trafficgenerator. Updated licenses. Removed some trailing whitespace. Change-Id: I6becaa573628eee677f0959fadf86f9a9f032f88 Issue-ID: POLICY-1752 Signed-off-by: Jim Hahn --- .../common/actors/actorServiceProvider/pom.xml | 40 ------------ .../actorserviceprovider/ActorService.java | 72 ---------------------- .../actorserviceprovider/spi/Actor.java | 35 ----------- .../ActorServiceProviderTest.java | 53 ---------------- .../actorserviceprovider/DummyActor.java | 60 ------------------ ...licy.controlloop.actorserviceprovider.spi.Actor | 1 - 6 files changed, 261 deletions(-) delete mode 100644 controlloop/common/actors/actorServiceProvider/pom.xml delete mode 100644 controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java delete mode 100644 controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/spi/Actor.java delete mode 100644 controlloop/common/actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceProviderTest.java delete mode 100644 controlloop/common/actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/DummyActor.java delete mode 100644 controlloop/common/actors/actorServiceProvider/src/test/resources/META-INF/services/org.onap.policy.controlloop.actorserviceprovider.spi.Actor (limited to 'controlloop/common/actors/actorServiceProvider') diff --git a/controlloop/common/actors/actorServiceProvider/pom.xml b/controlloop/common/actors/actorServiceProvider/pom.xml deleted file mode 100644 index b89b5806e..000000000 --- a/controlloop/common/actors/actorServiceProvider/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - 4.0.0 - - - org.onap.policy.drools-applications.controlloop.common.actors - actors - 1.4.0-SNAPSHOT - - - actorServiceProvider - - - - junit - junit - test - - - diff --git a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java b/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java deleted file mode 100644 index aeb536c57..000000000 --- a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ActorService - * ================================================================================ - * Copyright (C) 2017-2018 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.actorserviceprovider; - -import com.google.common.collect.ImmutableList; - -import java.util.Iterator; -import java.util.ServiceLoader; - -import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ActorService { - - private static final Logger logger = LoggerFactory.getLogger(ActorService.class); - private static ActorService service; - - // USed to load actors - private final ServiceLoader loader; - - private ActorService() { - loader = ServiceLoader.load(Actor.class); - } - - /** - * Get the single instance. - * - * @return the instance - */ - public static synchronized ActorService getInstance() { - if (service == null) { - service = new ActorService(); - } - return service; - } - - /** - * Get the actors. - * - * @return the actors - */ - public ImmutableList actors() { - Iterator iter = loader.iterator(); - logger.debug("returning actors"); - while (iter.hasNext()) { - if (logger.isDebugEnabled()) { - logger.debug("Got {}", iter.next().actor()); - } - } - - return ImmutableList.copyOf(loader.iterator()); - } -} diff --git a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/spi/Actor.java b/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/spi/Actor.java deleted file mode 100644 index 47e02a5cb..000000000 --- a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/spi/Actor.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Actor - * ================================================================================ - * Copyright (C) 2017-2018 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.actorserviceprovider.spi; - -import java.util.List; - -public interface Actor { - - String actor(); - - List recipes(); - - List recipeTargets(String recipe); - - List recipePayloads(String recipe); - -} diff --git a/controlloop/common/actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceProviderTest.java b/controlloop/common/actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceProviderTest.java deleted file mode 100644 index 4e50d855f..000000000 --- a/controlloop/common/actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceProviderTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * TestActorServiceProvider - * ================================================================================ - * Copyright (C) 2018 Ericsson. 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.actorserviceprovider; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; - -public class ActorServiceProviderTest { - - @Test - public void testActorServiceProvider() { - ActorService actorService = ActorService.getInstance(); - assertNotNull(actorService); - - assertEquals(1, actorService.actors().size()); - - actorService = ActorService.getInstance(); - assertNotNull(actorService); - - Actor dummyActor = ActorService.getInstance().actors().get(0); - assertNotNull(dummyActor); - - assertEquals("DummyActor", dummyActor.actor()); - - assertEquals(2, dummyActor.recipes().size()); - assertEquals("Dorothy", dummyActor.recipes().get(0)); - assertEquals("Wizard", dummyActor.recipes().get(1)); - - assertEquals(2, dummyActor.recipeTargets("Dorothy").size()); - assertEquals(2, dummyActor.recipePayloads("Dorothy").size()); - } -} diff --git a/controlloop/common/actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/DummyActor.java b/controlloop/common/actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/DummyActor.java deleted file mode 100644 index 2e8512411..000000000 --- a/controlloop/common/actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/DummyActor.java +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * TestActorServiceProvider - * ================================================================================ - * Copyright (C) 2018 Ericsson. 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.actorserviceprovider; - -import java.util.ArrayList; -import java.util.List; - -import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; - -public class DummyActor implements Actor { - @Override - public String actor() { - return this.getClass().getSimpleName(); - } - - @Override - public List recipes() { - List recipeList = new ArrayList<>(); - recipeList.add("Dorothy"); - recipeList.add("Wizard"); - - return recipeList; - } - - @Override - public List recipeTargets(String recipe) { - List recipeTargetList = new ArrayList<>(); - recipeTargetList.add("Wicked Witch"); - recipeTargetList.add("Wizard of Oz"); - - return recipeTargetList; - } - - @Override - public List recipePayloads(String recipe) { - List recipePayloadList = new ArrayList<>(); - recipePayloadList.add("Dorothy"); - recipePayloadList.add("Toto"); - - return recipePayloadList; - } -} diff --git a/controlloop/common/actors/actorServiceProvider/src/test/resources/META-INF/services/org.onap.policy.controlloop.actorserviceprovider.spi.Actor b/controlloop/common/actors/actorServiceProvider/src/test/resources/META-INF/services/org.onap.policy.controlloop.actorserviceprovider.spi.Actor deleted file mode 100644 index 2a4bb5749..000000000 --- a/controlloop/common/actors/actorServiceProvider/src/test/resources/META-INF/services/org.onap.policy.controlloop.actorserviceprovider.spi.Actor +++ /dev/null @@ -1 +0,0 @@ -org.onap.policy.controlloop.actorserviceprovider.DummyActor \ No newline at end of file -- cgit 1.2.3-korg