From 9eb34d921839ef5e32d2dd29d5af043e7dfe73dc Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 8 May 2019 15:39:37 -0400 Subject: Change vFW payload from pg-streams to streams Changed APPC payload from pg-streams to streams. Also removed trafficgenerator. Updated licenses. Added log message when payload is null. Replaced "ref$" with real payload values in yaml and docs. Change-Id: I4b38b0f64784d5fffc8f62f3a26cd007e500fbc7 Issue-ID: POLICY-1752 Signed-off-by: Jim Hahn --- .../model-actors/actor.appc/pom.xml | 8 +- .../actor/appc/AppcActorServiceProvider.java | 56 ++++++++------ .../actor/appc/AppcServiceProviderTest.java | 64 +++++++++++++++- models-interactions/model-impl/pom.xml | 1 - .../model-impl/trafficgenerator/pom.xml | 87 ---------------------- .../policy/vnf/trafficgenerator/PgRequest.java | 38 ---------- .../onap/policy/vnf/trafficgenerator/PgStream.java | 40 ---------- .../policy/vnf/trafficgenerator/PgStreams.java | 40 ---------- .../vnf/trafficgenerator/util/Serialization.java | 33 -------- .../onap/policy/vnf/trafficgenerator/DemoTest.java | 55 -------------- models-interactions/model-yaml/README-v2.0.0.md | 4 +- .../src/test/resources/v2.0.0/pgstreams.json | 26 ------- .../v2.0.0/policy_ONAP_demo_vFirewall.yaml | 4 +- 13 files changed, 101 insertions(+), 355 deletions(-) delete mode 100644 models-interactions/model-impl/trafficgenerator/pom.xml delete mode 100644 models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgRequest.java delete mode 100644 models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgStream.java delete mode 100644 models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgStreams.java delete mode 100644 models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/util/Serialization.java delete mode 100644 models-interactions/model-impl/trafficgenerator/src/test/java/org/onap/policy/vnf/trafficgenerator/DemoTest.java delete mode 100644 models-interactions/model-yaml/src/test/resources/v2.0.0/pgstreams.json diff --git a/models-interactions/model-actors/actor.appc/pom.xml b/models-interactions/model-actors/actor.appc/pom.xml index c9f7dc144..bc5bbe47d 100644 --- a/models-interactions/model-actors/actor.appc/pom.xml +++ b/models-interactions/model-actors/actor.appc/pom.xml @@ -1,7 +1,7 @@ - - - - 4.0.0 - - - org.onap.policy.models.policy-models-interactions.model-impl - model-impl - 2.0.0-SNAPSHOT - - - trafficgenerator - - - - junit - junit - test - - - com.google.code.gson - gson - provided - - - - - - - maven-checkstyle-plugin - - - onap-java-style - - check - - process-sources - - - onap-checkstyle/onap-java-style.xml - - ${project.build.sourceDirectory} - true - true - true - - - true - true - warning - - - - - - org.onap.oparent - checkstyle - ${oparent.version} - compile - - - - - - diff --git a/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgRequest.java b/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgRequest.java deleted file mode 100644 index 248d23e39..000000000 --- a/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgRequest.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * trafficgenerator - * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.vnf.trafficgenerator; - -import com.google.gson.annotations.SerializedName; - -import java.io.Serializable; - -public class PgRequest implements Serializable { - - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("pg-streams") - public PgStreams pgStreams; - - public PgRequest() { - //required by author - } -} diff --git a/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgStream.java b/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgStream.java deleted file mode 100644 index 9034f08db..000000000 --- a/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgStream.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * trafficgenerator - * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.vnf.trafficgenerator; - -import com.google.gson.annotations.SerializedName; - -import java.io.Serializable; - -public class PgStream implements Serializable { - - private static final long serialVersionUID = 5567635677419358210L; - - @SerializedName("id") - public String streamId; - @SerializedName("is-enabled") - public String isEnabled; - - public PgStream() { - //required by author - } -} diff --git a/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgStreams.java b/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgStreams.java deleted file mode 100644 index e912722cb..000000000 --- a/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PgStreams.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * trafficgenerator - * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.vnf.trafficgenerator; - -import com.google.gson.annotations.SerializedName; - -import java.io.Serializable; -import java.util.LinkedList; -import java.util.List; - -public class PgStreams implements Serializable { - - private static final long serialVersionUID = 5567635677419358210L; - - @SerializedName("pg-stream") - public List pgStream = new LinkedList<>(); - - public PgStreams() { - // required by author - } -} diff --git a/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/util/Serialization.java b/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/util/Serialization.java deleted file mode 100644 index 901fe4076..000000000 --- a/models-interactions/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/util/Serialization.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * trafficgenerator - * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.vnf.trafficgenerator.util; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -public final class Serialization { - - public static final Gson gsonPretty = - new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create(); - - private Serialization() {} -} diff --git a/models-interactions/model-impl/trafficgenerator/src/test/java/org/onap/policy/vnf/trafficgenerator/DemoTest.java b/models-interactions/model-impl/trafficgenerator/src/test/java/org/onap/policy/vnf/trafficgenerator/DemoTest.java deleted file mode 100644 index d4ddd6ee4..000000000 --- a/models-interactions/model-impl/trafficgenerator/src/test/java/org/onap/policy/vnf/trafficgenerator/DemoTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * trafficgenerator - * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.vnf.trafficgenerator; - -import org.junit.Test; - -import org.onap.policy.vnf.trafficgenerator.PgRequest; -import org.onap.policy.vnf.trafficgenerator.PgStream; -import org.onap.policy.vnf.trafficgenerator.PgStreams; -import org.onap.policy.vnf.trafficgenerator.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DemoTest { - private static final Logger logger = LoggerFactory.getLogger(DemoTest.class); - - @Test - public void test() { - PgRequest request = new PgRequest(); - request.pgStreams = new PgStreams(); - - PgStream pgStream; - for (int i = 0; i < 5; i++) { - pgStream = new PgStream(); - pgStream.streamId = "fw_udp" + (i + 1); - pgStream.isEnabled = "true"; - request.pgStreams.pgStream.add(pgStream); - } - - String body = Serialization.gsonPretty.toJson(request); - logger.debug(body); - - // fail("Not yet implemented"); - } - -} diff --git a/models-interactions/model-yaml/README-v2.0.0.md b/models-interactions/model-yaml/README-v2.0.0.md index d6613add2..bb72cc03e 100644 --- a/models-interactions/model-yaml/README-v2.0.0.md +++ b/models-interactions/model-yaml/README-v2.0.0.md @@ -1,4 +1,4 @@ -Copyright 2018 AT&T Intellectual Property. All rights reserved. +Copyright 2018-2019 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2019 Nordix Foundation. This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE Full license text at https://creativecommons.org/licenses/by/4.0/legalcode @@ -307,7 +307,7 @@ policies: resourceID: Eace933104d443b496b8.nodes.heat.vpg payload: generic-vnf.vnf-id: {generic-vnf.vnf-id} - ref$: pgstreams.json + streams: '{"active-streams":5}' retry: 0 timeout: 300 success: final_success diff --git a/models-interactions/model-yaml/src/test/resources/v2.0.0/pgstreams.json b/models-interactions/model-yaml/src/test/resources/v2.0.0/pgstreams.json deleted file mode 100644 index 4d118afa1..000000000 --- a/models-interactions/model-yaml/src/test/resources/v2.0.0/pgstreams.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "pg-streams": { - "pg-stream": [ - { - "id": "fw_udp1", - "is-enabled": "true" - }, - { - "id": "fw_udp2", - "is-enabled": "true" - }, - { - "id": "fw_udp3", - "is-enabled": "true" - }, - { - "id": "fw_udp4", - "is-enabled": "true" - }, - { - "id": "fw_udp5", - "is-enabled": "true" - } - ] - } -} \ No newline at end of file diff --git a/models-interactions/model-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml b/models-interactions/model-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml index caf3babbc..00b9b4cb1 100644 --- a/models-interactions/model-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml +++ b/models-interactions/model-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml @@ -1,4 +1,4 @@ -# Copyright 2018 AT&T Intellectual Property. All rights reserved +# Copyright 2018-2019 AT&T Intellectual Property. All rights reserved # Modifications Copyright (C) 2019 Nordix Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,7 +61,7 @@ policies: resourceID: Eace933104d443b496b8.nodes.heat.vpg payload: generic-vnf.vnf-id: {generic-vnf.vnf-id} - ref$: pgstreams.json + streams: '{"active-streams":5}' retry: 0 timeout: 300 success: final_success -- cgit 1.2.3-korg