Upgrade spring/camel versions
[clamp.git] / src / main / java / org / onap / clamp / clds / service / CldsTemplateService.java
index 9e50682..276670e 100644 (file)
@@ -18,7 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * 
+ *
  */
 
 package org.onap.clamp.clds.service;
@@ -27,13 +27,6 @@ import java.util.Date;
 import java.util.List;
 
 import javax.annotation.PostConstruct;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
 
 import org.onap.clamp.clds.dao.CldsDao;
 import org.onap.clamp.clds.model.CldsTemplate;
@@ -47,7 +40,6 @@ import org.springframework.stereotype.Component;
  * Service to save and retrieve the CLDS model attributes.
  */
 @Component
-@Path("/cldsTempate")
 public class CldsTemplateService extends SecureServiceBase {
 
     @Value("${clamp.config.security.permission.type.template:permission-type-template}")
@@ -60,9 +52,9 @@ public class CldsTemplateService extends SecureServiceBase {
     @PostConstruct
     private final void afterConstruction() {
         permissionReadTemplate = SecureServicePermission.create(cldsPermissionTypeTemplate, cldsPermissionInstance,
-                "read");
+            "read");
         permissionUpdateTemplate = SecureServicePermission.create(cldsPermissionTypeTemplate, cldsPermissionInstance,
-                "update");
+            "update");
     }
 
     @Autowired
@@ -76,10 +68,7 @@ public class CldsTemplateService extends SecureServiceBase {
      * @param templateName
      * @return bpmn xml text - content of bpmn given name
      */
-    @GET
-    @Path("/template/bpmn/{templateName}")
-    @Produces(MediaType.TEXT_XML)
-    public String getBpmnTemplate(@PathParam("templateName") String templateName) {
+    public String getBpmnTemplate(String templateName) {
         Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsTemplateService: GET template bpmn", getPrincipalName());
         isAuthorized(permissionReadTemplate);
@@ -100,10 +89,7 @@ public class CldsTemplateService extends SecureServiceBase {
      * @param templateName
      * @return image xml text - content of image given name
      */
-    @GET
-    @Path("/template/image/{templateName}")
-    @Produces(MediaType.TEXT_XML)
-    public String getImageXml(@PathParam("templateName") String templateName) {
+    public String getImageXml(String templateName) {
         Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsTemplateService: GET template image", getPrincipalName());
         isAuthorized(permissionReadTemplate);
@@ -122,10 +108,7 @@ public class CldsTemplateService extends SecureServiceBase {
      * @param templateName
      * @return clds template - clds template for the given template name
      */
-    @GET
-    @Path("/template/{templateName}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public CldsTemplate getTemplate(@PathParam("templateName") String templateName) {
+    public CldsTemplate getTemplate(String templateName) {
         Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsTemplateService: GET template", getPrincipalName());
         isAuthorized(permissionReadTemplate);
@@ -146,11 +129,7 @@ public class CldsTemplateService extends SecureServiceBase {
      * @param cldsTemplate
      * @return The CldsTemplate modified and saved in DB
      */
-    @PUT
-    @Path("/template/{templateName}")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public CldsTemplate putTemplate(@PathParam("templateName") String templateName, CldsTemplate cldsTemplate) {
+    public CldsTemplate putTemplate(String templateName, CldsTemplate cldsTemplate) {
         Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsTemplateService: PUT template", getPrincipalName());
         isAuthorized(permissionUpdateTemplate);
@@ -172,9 +151,6 @@ public class CldsTemplateService extends SecureServiceBase {
      *
      * @return template names in JSON
      */
-    @GET
-    @Path("/template-names")
-    @Produces(MediaType.APPLICATION_JSON)
     public List<ValueItem> getTemplateNames() {
         Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsTemplateService: GET template names", getPrincipalName());