package org.datavault.broker.controllers;

import java.util.List;

import org.datavault.common.model.Policy;
import org.datavault.broker.services.PoliciesService;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * User: Tom Higgins
 * Date: 11/05/2015
 * Time: 14:29
 */

@RestController
public class PoliciesController {
    
    private PoliciesService policiesService;
    
    public void setPoliciesService(PoliciesService policiesService) {
        this.policiesService = policiesService;
    }
    
    @RequestMapping(value = "/policies", method = RequestMethod.GET)
    public List<Policy> getPolicies() {
        return policiesService.getPolicies();
    }
}

@@ -155,16 +155,77 @@
 Service;
+%0Aimport org.springframework.web.bind.annotation.PathVariable;
 %0A%0Aimport
@@ -867,10 +867,226 @@
 ;%0A    %7D%0A
+    %0A    @RequestMapping(value = %22/policies/%7Bpolicyid%7D%22, method = RequestMethod.GET)%0A    public Policy getPolicy(@PathVariable(%22policyid%22) String policyID) %7B%0A        return policiesService.getPolicy(policyID);%0A    %7D%0A
 %7D%0A

Add policy lookup API