X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-simulators%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fsimulators%2FSoSimulatorJaxRs.java;h=a1456c15e79420821d7066c4bd465ee8806a7266;hb=HEAD;hp=2e6f46b263bb0b2259a26c254a9a784d253e0918;hpb=f203526d0f86d385976da394bd1f0f918e4445d9;p=policy%2Fmodels.git diff --git a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java index 2e6f46b26..a1456c15e 100644 --- a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java +++ b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java @@ -2,8 +2,10 @@ * ============LICENSE_START======================================================= * simulators * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019, 2023 Nordix Foundation. + * Modifications Copyright (C) 2020 Wipro Limited. + * Modifications Copyright (C) 2022 CTC, Inc. and others. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,23 +23,24 @@ package org.onap.policy.simulators; -import io.swagger.annotations.ApiParam; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; import lombok.Setter; import org.onap.policy.common.utils.resources.ResourceUtils; import org.onap.policy.so.SoRequest; +import org.onap.policy.so.SoRequest3gpp; @Path("/") public class SoSimulatorJaxRs { @@ -64,8 +67,8 @@ public class SoSimulatorJaxRs { /** * SO post query. * - * @param serviceInstanceId the service instance Id - * @param vnfInstanceId the VNF Id + * @param serviceInstanceId the service instance ID + * @param vnfInstanceId the VNF ID * @return the response */ @POST @@ -74,7 +77,7 @@ public class SoSimulatorJaxRs { @Produces("application/json") public String soPostQuery(@PathParam("serviceInstanceId") final String serviceInstanceId, @PathParam("vnfInstanceId") final String vnfInstanceId, - @ApiParam(required = true) SoRequest request) { + SoRequest request) { List> userParam = null; userParam = request.getRequestDetails().getRequestParameters().getUserParams(); @@ -88,8 +91,8 @@ public class SoSimulatorJaxRs { /** * SO Delete. * - * @param serviceInstanceId the service instance Id - * @param vnfInstanceId the VNF Id + * @param serviceInstanceId the service instance ID + * @param vnfInstanceId the VNF ID * @return the response */ @DELETE @@ -123,10 +126,26 @@ public class SoSimulatorJaxRs { } } + @PUT + @Path("/3gppservices/v7/modify") + @Consumes(MediaType.APPLICATION_JSON) + @Produces("application/json") + public String soPost3gpp(SoRequest3gpp request) { + return ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.3gpp.success.json"); + } + + @PUT + @Path("/infra/serviceIntent/v1/modify") + @Consumes(MediaType.APPLICATION_JSON) + @Produces("application/json") + public String soPostModifyCll(SoRequest3gpp request) { + return ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.cll.success.json"); + } + private String makeStarted() { - String requestId = UUID.randomUUID().toString(); + var requestId = UUID.randomUUID().toString(); - String response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.started.json"); + var response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.started.json"); incomplete.add(requestId); @@ -134,17 +153,17 @@ public class SoSimulatorJaxRs { } private String makeImmediateComplete() { - String response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.immediate.success.json"); + var response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.immediate.success.json"); return response.replace(REPLACE_ME, UUID.randomUUID().toString()); } private String makeComplete(String requestId) { - String response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.complete.success.json"); + var response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.complete.success.json"); return response.replace(REPLACE_ME, requestId); } private String makeStillRunning(String requestId) { - String response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.still.running.json"); + var response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.still.running.json"); return response.replace(REPLACE_ME, requestId); } }