From 0f12815d373a4a656bca88e3093128c1fda4ae80 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Thu, 2 Aug 2018 11:34:07 -0400 Subject: update infra apihandler to utilize rest rather than direct access Change-Id: I0cd3d3902e32249263298f91263401ce05c34be3 Issue-ID: SO-790 Signed-off-by: Benjamin, Max (mb388a) --- ...raActiveRequestsRepositoryCustomController.java | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java (limited to 'adapters/mso-requests-db-adapter/src/main/java') diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java new file mode 100644 index 0000000000..8e5d04152c --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * 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.so.adapters.requestsdb; + +import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.db.request.data.controller.InstanceNameDuplicateCheckRequest; +import org.onap.so.db.request.data.repository.InfraActiveRequestsRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.ws.rs.PathParam; +import java.util.List; +import java.util.Map; + +@RestController +public class InfraActiveRequestsRepositoryCustomController { + + @Autowired + InfraActiveRequestsRepository infraActiveRequestsRepository; + @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/getCloudOrchestrationFiltersFromInfraActive") + public List getCloudOrchestrationFiltersFromInfraActive(@RequestBody Map orchestrationMap){ + return infraActiveRequestsRepository.getCloudOrchestrationFiltersFromInfraActive(orchestrationMap); + } + @RequestMapping(method = RequestMethod.POST, value = "/getOrchestrationFiltersFromInfraActive") + public List getOrchestrationFiltersFromInfraActive(@RequestBody Map> orchestrationMap){ + return infraActiveRequestsRepository.getOrchestrationFiltersFromInfraActive(orchestrationMap); + } + @RequestMapping(method = RequestMethod.GET, value = "/infraActiveRequests/checkVnfIdStatus/{nsInstanceId}") + public InfraActiveRequests checkVnfIdStatus(@PathParam("nsInstanceId") String operationalEnvironmentId){ + return infraActiveRequestsRepository.checkVnfIdStatus(operationalEnvironmentId); + } + @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/checkInstanceNameDuplicate") + public InfraActiveRequests checkInstanceNameDuplicate(@RequestBody InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest){ + return infraActiveRequestsRepository.checkInstanceNameDuplicate(instanceNameDuplicateCheckRequest.getInstanceIdMap(), instanceNameDuplicateCheckRequest.getInstanceName(),instanceNameDuplicateCheckRequest.getRequestScope()); + } +} -- cgit 1.2.3-korg