X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ms%2Fcontrollerblueprints%2Fmodules%2Fservice%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fccsdk%2Fapps%2Fcontrollerblueprints%2Fservice%2Frs%2FModelTypeRest.java;h=0f485a08116ca6efaf560550bc01d7f8280963fc;hb=85d6ddebaad320f05e1ffee82bbf16e25f50b5b0;hp=f6e5c274fb6dde79996b20516051ff7414db69f3;hpb=42b670cfd17dab61dbd6632080c95572ea3b83c8;p=ccsdk%2Fapps.git diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java index f6e5c274..0f485a08 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java @@ -1,5 +1,6 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +21,6 @@ import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException; import org.onap.ccsdk.apps.controllerblueprints.service.ModelTypeService; import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType; import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -45,49 +44,29 @@ public class ModelTypeRest { } @GetMapping(path = "/{name}", produces = MediaType.APPLICATION_JSON_VALUE) - public ModelType getModelTypeByName(@PathVariable(value = "name") String name) throws BluePrintException { - try { - return modelTypeService.getModelTypeByName(name); - } catch (Exception e) { - throw new BluePrintException(1000, e.getMessage(), e); - } + public ModelType getModelTypeByName(@PathVariable(value = "name") String name) { + return modelTypeService.getModelTypeByName(name); } @GetMapping(path = "/search/{tags}", produces = MediaType.APPLICATION_JSON_VALUE) - public List searchModelTypes(@PathVariable(value = "tags") String tags) throws BluePrintException { - try { - return modelTypeService.searchModelTypes(tags); - } catch (Exception e) { - throw new BluePrintException(1001, e.getMessage(), e); - } + public List searchModelTypes(@PathVariable(value = "tags") String tags) { + return modelTypeService.searchModelTypes(tags); } @GetMapping(path = "/by-definition/{definitionType}", produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody - List getModelTypeByDefinitionType(@PathVariable(value = "definitionType") String definitionType) throws BluePrintException { - try { - return modelTypeService.getModelTypeByDefinitionType(definitionType); - } catch (Exception e) { - throw new BluePrintException(1002, e.getMessage(), e); - } + List getModelTypeByDefinitionType(@PathVariable(value = "definitionType") String definitionType) { + return modelTypeService.getModelTypeByDefinitionType(definitionType); } - @PostMapping(path = "/", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(path = "", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ModelType saveModelType(@RequestBody ModelType modelType) throws BluePrintException { - try { - return modelTypeService.saveModel(modelType); - } catch (Exception e) { - throw new BluePrintException(1100, e.getMessage(), e); - } + return modelTypeService.saveModel(modelType); } @DeleteMapping(path = "/{name}") - public void deleteModelTypeByName(@PathVariable(value = "name") String name) throws BluePrintException { - try { - modelTypeService.deleteByModelName(name); - } catch (Exception e) { - throw new BluePrintException(1400, e.getMessage(), e); - } + public void deleteModelTypeByName(@PathVariable(value = "name") String name) { + modelTypeService.deleteByModelName(name); } }