Merge "Logging improvements"
[vid.git] / vid-app-common / src / main / java / org / onap / vid / controllers / FeatureTogglingController.java
1 package org.onap.vid.controllers;
2
3 import org.onap.vid.properties.Features;
4 import org.onap.portalsdk.core.controller.RestrictedBaseController;
5 import org.springframework.http.MediaType;
6 import org.springframework.web.bind.annotation.RequestMapping;
7 import org.springframework.web.bind.annotation.RequestMethod;
8 import org.springframework.web.bind.annotation.ResponseBody;
9 import org.springframework.web.bind.annotation.RestController;
10
11 import java.util.HashMap;
12 import java.util.Map;
13
14 @RestController
15 @RequestMapping("flags")
16 public class FeatureTogglingController extends RestrictedBaseController {
17
18     @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
19     public @ResponseBody Map<String,Boolean> getFeatureToggles()
20     {
21         HashMap<String,Boolean> flags = new HashMap <String, Boolean>();
22         for(Features flag : Features.values()){
23             flags.put(flag.name(), flag.isActive());
24         }
25         return flags;
26
27
28     }
29 }