/*\r
* Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
}\r
\r
@GetMapping(path = "/{name}", produces = MediaType.APPLICATION_JSON_VALUE)\r
- public ModelType getModelTypeByName(@PathVariable(value = "name") String name) throws BluePrintException {\r
- try {\r
- return modelTypeService.getModelTypeByName(name);\r
- } catch (Exception e) {\r
- throw new BluePrintException(1000, e.getMessage(), e);\r
- }\r
+ public ModelType getModelTypeByName(@PathVariable(value = "name") String name) {\r
+ return modelTypeService.getModelTypeByName(name);\r
}\r
\r
@GetMapping(path = "/search/{tags}", produces = MediaType.APPLICATION_JSON_VALUE)\r
- public List<ModelType> searchModelTypes(@PathVariable(value = "tags") String tags) throws BluePrintException {\r
- try {\r
- return modelTypeService.searchModelTypes(tags);\r
- } catch (Exception e) {\r
- throw new BluePrintException(1001, e.getMessage(), e);\r
- }\r
+ public List<ModelType> searchModelTypes(@PathVariable(value = "tags") String tags) {\r
+ return modelTypeService.searchModelTypes(tags);\r
}\r
\r
@GetMapping(path = "/by-definition/{definitionType}", produces = MediaType.APPLICATION_JSON_VALUE)\r
public @ResponseBody\r
- List<ModelType> getModelTypeByDefinitionType(@PathVariable(value = "definitionType") String definitionType) throws BluePrintException {\r
- try {\r
- return modelTypeService.getModelTypeByDefinitionType(definitionType);\r
- } catch (Exception e) {\r
- throw new BluePrintException(1002, e.getMessage(), e);\r
- }\r
+ List<ModelType> getModelTypeByDefinitionType(@PathVariable(value = "definitionType") String definitionType) {\r
+ return modelTypeService.getModelTypeByDefinitionType(definitionType);\r
}\r
\r
- @PostMapping(path = "/", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)\r
+ @PostMapping(path = "", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)\r
public @ResponseBody\r
ModelType saveModelType(@RequestBody ModelType modelType) throws BluePrintException {\r
- try {\r
- return modelTypeService.saveModel(modelType);\r
- } catch (Exception e) {\r
- throw new BluePrintException(1100, e.getMessage(), e);\r
- }\r
+ return modelTypeService.saveModel(modelType);\r
}\r
\r
@DeleteMapping(path = "/{name}")\r
- public void deleteModelTypeByName(@PathVariable(value = "name") String name) throws BluePrintException {\r
- try {\r
- modelTypeService.deleteByModelName(name);\r
- } catch (Exception e) {\r
- throw new BluePrintException(1400, e.getMessage(), e);\r
- }\r
+ public void deleteModelTypeByName(@PathVariable(value = "name") String name) {\r
+ modelTypeService.deleteByModelName(name);\r
}\r
}\r