From c5f38f5de2f49d3f2fa7f03808f9f063f1cb2ed9 Mon Sep 17 00:00:00 2001 From: "Hockla, Ali (ah999m)" Date: Wed, 13 Sep 2017 09:24:43 -0500 Subject: Added changes for vDNS Use Case -Renamed remaining MSO classes and packages to SO and modified drl accordingly -Connected SO Interface to SO Simulator -Added vDNS Control Loop junit -Modified SOActorServiceProvider to reflect AAI class changes (POLICY-103) Issue-ID: POLICY-102 Change-Id: Iea5d3f096c4ccfedde68e79d7593d66331127aaf Signed-off-by: Hockla, Ali (ah999m) --- .../onap/policy/simulators/MsoSimulatorJaxRs.java | 37 ------------------ .../onap/policy/simulators/SoSimulatorJaxRs.java | 44 ++++++++++++++++++++++ .../main/java/org/onap/policy/simulators/Util.java | 6 +-- 3 files changed, 47 insertions(+), 40 deletions(-) delete mode 100644 controlloop/common/simulators/src/main/java/org/onap/policy/simulators/MsoSimulatorJaxRs.java create mode 100644 controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java (limited to 'controlloop/common/simulators/src/main') diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/MsoSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/MsoSimulatorJaxRs.java deleted file mode 100644 index 824c547ce..000000000 --- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/MsoSimulatorJaxRs.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * simulators - * ================================================================================ - * Copyright (C) 2017 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.simulators; - -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; - -@Path("/serviceInstances") -public class MsoSimulatorJaxRs { - - @POST - @Path("/v2/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModulesHTTPS/1.1") - public String msoPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId) - { - return "{\"requestReferences\": {\"instanceId\": \"ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff\", \"requestId\": \"rq1234d1-5a33-ffdf-23ab-12abad84e331\"}}"; - } - -} diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java new file mode 100644 index 000000000..1ebb281fd --- /dev/null +++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * simulators + * ================================================================================ + * Copyright (C) 2017 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.simulators; + +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.core.MediaType; + +import org.onap.policy.so.SORequest; +import org.onap.policy.so.util.Serialization; + +@Path("/serviceInstances") +public class SoSimulatorJaxRs { + + @POST + @Path("/v2/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModulesHTTPS/1.1") + @Consumes(MediaType.APPLICATION_JSON) + public String SoPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, String req) + { + SORequest request = Serialization.gsonPretty.fromJson(req, SORequest.class); + return "{\"requestReferences\": {\"instanceId\": \"ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff\", \"requestId\": " + request.requestId + "}}"; + } + +} diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java index 27cc6e0fa..e0eb1ff01 100644 --- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java +++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java @@ -22,7 +22,7 @@ package org.onap.policy.simulators; import org.onap.policy.drools.http.server.HttpServletServer; import org.onap.policy.simulators.AaiSimulatorJaxRs; -import org.onap.policy.simulators.MsoSimulatorJaxRs; +import org.onap.policy.simulators.SoSimulatorJaxRs; import org.onap.policy.simulators.VfcSimulatorJaxRs; public class Util { @@ -33,9 +33,9 @@ public class Util { return testServer; } - public static HttpServletServer buildMsoSim() throws InterruptedException { + public static HttpServletServer buildSoSim() throws InterruptedException { HttpServletServer testServer = HttpServletServer.factory.build("testServer", "localhost", 6667, "/", false, true); - testServer.addServletClass("/*", MsoSimulatorJaxRs.class.getName()); + testServer.addServletClass("/*", SoSimulatorJaxRs.class.getName()); testServer.waitedStart(5000); return testServer; } -- cgit 1.2.3-korg