added appropriate annotations 39/106739/1
authorRupinder <rupinsi1@in.ibm.com>
Tue, 28 Apr 2020 12:05:05 +0000 (17:35 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Tue, 28 Apr 2020 12:05:55 +0000 (17:35 +0530)
Issue-ID: USECASEUI-413
Change-Id: I531b95e504a96540bf30a7ee09eab3cecb596907
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java
server/src/main/java/org/onap/usecaseui/server/controller/PerformanceController.java
server/src/main/java/org/onap/usecaseui/server/controller/lcm/CustomerController.java

index 0cceee2..2134aa7 100755 (executable)
@@ -43,6 +43,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;\r
 import org.springframework.web.bind.annotation.PathVariable;\r
 import org.springframework.web.bind.annotation.RequestMapping;\r
+import org.springframework.web.bind.annotation.GetMapping;\r
 import org.springframework.web.bind.annotation.RequestMethod;\r
 import org.springframework.web.bind.annotation.RequestParam;\r
 import org.springframework.web.bind.annotation.RestController;\r
@@ -101,7 +102,7 @@ public class AlarmController
         * test commit\r
         * @throws ParseException \r
         */\r
-    @RequestMapping(value = {"/alarm/{currentPage}/{pageSize}"}, method = RequestMethod.GET,\r
+    @GetMapping(value = {"/alarm/{currentPage}/{pageSize}"},\r
             produces = "application/json")\r
     public String getAlarmData(@RequestParam(required = false) String sourceName,\r
             @RequestParam(required = false) String priority, @RequestParam(required = false) String startTime,\r
@@ -129,7 +130,7 @@ public class AlarmController
         }\r
     }\r
 \r
-    @RequestMapping(value = {"/alarm/sourceId"},method = RequestMethod.GET)\r
+    @GetMapping(value = {"/alarm/sourceId"})\r
     public String getSourceId() throws JsonProcessingException{\r
         List<String> sourceIds = new ArrayList<>();\r
        Page page  = alarmsHeaderService.queryAlarmsHeader(new AlarmsHeader(), 1, Integer.MAX_VALUE);\r
@@ -153,7 +154,7 @@ public class AlarmController
         return omAlarm.writeValueAsString(sourceIds);\r
     }\r
     \r
-    @RequestMapping(value = {"/alarm/getSourceNames"},method = RequestMethod.GET,produces = "application/json")\r
+    @GetMapping(value = {"/alarm/getSourceNames"},produces = "application/json")\r
     public String getSourceNames() throws JsonProcessingException{\r
        Set<String> sourceNames = new HashSet<>();\r
        Page<AlarmsHeader> page  = alarmsHeaderService.queryAlarmsHeader(new AlarmsHeader(), 1, Integer.MAX_VALUE);\r
@@ -174,7 +175,7 @@ public class AlarmController
         return omAlarm.writeValueAsString(sourceNames);\r
     }\r
     \r
-    @RequestMapping(value = {"/alarm/diagram"},method = RequestMethod.GET,produces = "application/json")\r
+    @GetMapping(value = {"/alarm/diagram"},produces = "application/json")\r
     public String diagram(@RequestParam String sourceName, @RequestParam(required = false) String startTime,\r
             @RequestParam(required = false) String endTime, @RequestParam String format) {\r
         long timeInterval = 0;\r
@@ -250,7 +251,7 @@ public class AlarmController
         return result;\r
     }\r
     \r
-    @RequestMapping(value = "/alarm/statusCount", method = RequestMethod.GET, produces = "application/json")\r
+    @GetMapping(value = "/alarm/statusCount", produces = "application/json")\r
     public String getStatusCount() throws JsonProcessingException {\r
         List<String> statusCount = new ArrayList<>();\r
 \r
@@ -277,7 +278,7 @@ public class AlarmController
         return string;\r
     }\r
     \r
-    @RequestMapping(value="/listSortMasters",method=RequestMethod.GET,produces = "application/json;charset=utf8")\r
+    @GetMapping(value="/listSortMasters",produces = "application/json;charset=utf8")\r
     public String getSortMasterInfo() throws JsonProcessingException{\r
        Map<String,List<SortMaster>> map = new HashMap<>();\r
        List<SortMaster> operationTypes = alarmsHeaderService.listSortMasters("operationType");\r
index 220ca46..9651a2d 100755 (executable)
@@ -40,6 +40,7 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
@@ -72,7 +73,7 @@ public class PerformanceController {
 
     private ObjectMapper omPerformance = new ObjectMapper();
     
-    @RequestMapping(value = {"/performance/{currentPage}/{pageSize}"},method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {"/performance/{currentPage}/{pageSize}"}, produces = "application/json")
     public String getPerformanceData(@PathVariable String currentPage,
                                      @PathVariable String pageSize,
                                      @RequestParam(required = false) String sourceName,
@@ -95,7 +96,7 @@ public class PerformanceController {
         }
     }
     
-    @RequestMapping(value = {"/performance/queryAllSourceNames"},method = RequestMethod.GET)
+    @GetMapping(value = {"/performance/queryAllSourceNames"})
     public String getSourceIds(){
         try {
             return omPerformance.writeValueAsString(performanceHeaderService.queryAllSourceNames());
@@ -122,7 +123,7 @@ public class PerformanceController {
         return string;
     }
     
-    @RequestMapping(value = {"/performance/getSourceNames/{currentPage}/{pageSize}"},method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {"/performance/getSourceNames/{currentPage}/{pageSize}"}, produces = "application/json")
     public String getPerformanceSourceNames(@PathVariable String currentPage,@PathVariable String pageSize,
             @RequestParam(required = false) String sourceName) throws JsonProcessingException{
         PerformanceHeader performanceHeader = new PerformanceHeader.PerformanceHeaderBuilder().createPerformanceHeader();
index 98bbb29..f3f938c 100644 (file)
@@ -23,6 +23,9 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
@@ -48,49 +51,49 @@ public class CustomerController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/customers"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/customers"} , produces = "application/json")
     public List<AAICustomer> getCustomers(){
         return customerService.listCustomer();
     }
     
     @ResponseBody
-    @RequestMapping(value={"/uui-lcm/customers/{customerId}"},method = RequestMethod.PUT,produces="application/json")
+    @PutMapping(value={"/uui-lcm/customers/{customerId}"},produces="application/json")
     public JSONObject createOrUpdateCustomer(HttpServletRequest request,@PathVariable String customerId){
        return customerService.createOrUpdateCustomer(request, customerId);
     }
     
     @ResponseBody
-    @RequestMapping(value={"/uui-lcm/customers/{customerId}"},method = RequestMethod.GET,produces="application/json")
+    @GetMapping(value={"/uui-lcm/customers/{customerId}"},produces="application/json")
     public JSONObject getCustomerById(@PathVariable String customerId){
        return customerService.getCustomerById(customerId);
     }
     
     @ResponseBody
-    @RequestMapping(value={"/uui-lcm/customers"},method = RequestMethod.DELETE,produces="application/json")
+    @DeleteMapping(value={"/uui-lcm/customers"},produces="application/json")
     public JSONObject deleteCustomer(@RequestParam String customerId,@RequestParam String resourceVersion){
        return customerService.deleteCustomer(customerId,resourceVersion);
     }
     
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/customers/{customerId}/service-subscriptions"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/customers/{customerId}/service-subscriptions"} , produces = "application/json")
     public List<AAIServiceSubscription> getServiceSubscriptions(@PathVariable(value="customerId") String customerId){
         return customerService.listServiceSubscriptions(customerId);
     }
     
     @ResponseBody
-    @RequestMapping(value={"/uui-lcm/customers/{customerId}/service-subscriptions/{serviceType}"},method = RequestMethod.PUT,produces="application/json")
+    @PutMapping(value={"/uui-lcm/customers/{customerId}/service-subscriptions/{serviceType}"},produces="application/json")
     public JSONObject createOrUpdateServiceType(HttpServletRequest request,@PathVariable String serviceType,@PathVariable String customerId){
        return customerService.createOrUpdateServiceType(request, serviceType,customerId);
     }
     
     @ResponseBody
-    @RequestMapping(value={"/uui-lcm/customers/{customerId}/service-subscriptions/{serviceType}"},method = RequestMethod.DELETE,produces="application/json")
+    @DeleteMapping(value={"/uui-lcm/customers/{customerId}/service-subscriptions/{serviceType}"},produces="application/json")
     public JSONObject deleteServiceType(@PathVariable String customerId,@PathVariable String serviceType,@RequestParam String resourceVersion){
        return customerService.deleteServiceType(customerId,serviceType,resourceVersion);
     }
     
     @ResponseBody
-    @RequestMapping(value={"/uui-lcm/customers/{customerId}/service-subscriptions/{serviceType}"},method = RequestMethod.GET,produces="application/json")
+    @GetMapping(value={"/uui-lcm/customers/{customerId}/service-subscriptions/{serviceType}"}, produces="application/json")
     public JSONObject getServiceTypeById(@PathVariable String customerId,@PathVariable String serviceType){
        return customerService.getServiceTypeById(customerId,serviceType);
     }