aboutsummaryrefslogtreecommitdiffstats
path: root/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/controller/VesController.java
diff options
context:
space:
mode:
authorPooja03 <PM00501616@techmahindra.com>2018-03-23 17:49:26 +0530
committerPooja03 <PM00501616@techmahindra.com>2018-03-23 17:49:26 +0530
commitd407638086b08c3de199cbef5e717fb16556077c (patch)
treeae56b4f5cf80eaa1b06bd60fa3de046f22212f29 /UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/controller/VesController.java
parent97991213fa2883fe6658862cf5bb0151246f7361 (diff)
Added UniversalVesAdapter in the Mapper
Adding full UniversalVesAdapter Module in Mapper Change-Id: I7edece763546b91700983554ffcf38f8ab945ae2 Issue-ID: DCAEGEN2-335 Signed-off-by: Pooja03 <PM00501616@techmahindra.com>
Diffstat (limited to 'UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/controller/VesController.java')
-rw-r--r--UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/controller/VesController.java64
1 files changed, 64 insertions, 0 deletions
diff --git a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/controller/VesController.java b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/controller/VesController.java
new file mode 100644
index 0000000..588c912
--- /dev/null
+++ b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/controller/VesController.java
@@ -0,0 +1,64 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : DCAE
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.universalvesadapter.controller;
+
+import org.onap.universalvesadapter.service.VesService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * This controller will be starting point for this micro service. On triggering, it will listen to Dmaap topic for events.
+ *
+ * @author kmalbari
+ */
+@RestController
+public class VesController {
+
+ private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
+
+ @Autowired
+ private VesService vesService;
+
+ /**
+ * @return message that application is started
+ */
+ @RequestMapping("/start")
+ public String start() {
+
+ LOGGER.debug("UniversalVesAdapter Application starting...");
+ vesService.start();
+ return "Application started";
+ }
+
+ /**
+ * @return message that application stop process is triggered
+ */
+ @RequestMapping("/stop")
+ public String stop() {
+
+ vesService.stop();
+ LOGGER.debug("UniversalVesAdapter Application is stopping...");
+ return "Application will be stopped soon";
+ }
+}