Esempio n. 1
0
 @RequestMapping(value = "/datastore/{dsName}", method = RequestMethod.DELETE)
 @ResponseStatus(HttpStatus.OK)
 public void deleteDatastore(@PathVariable("dsName") String dsName) {
   if (dsName == null || dsName.isEmpty()) {
     throw BddException.INVALID_PARAMETER("date store name", dsName);
   }
   datastoreMgr.deleteDatastore(dsName);
 }
Esempio n. 2
0
 @RequestMapping(value = "/datastores", method = RequestMethod.POST, consumes = "application/json")
 @ResponseStatus(HttpStatus.OK)
 public void addDatastore(@RequestBody DatastoreAdd dsSpec) {
   if (dsSpec == null) {
     throw BddException.INVALID_PARAMETER("dsSpec", null);
   }
   if (dsSpec.getName() == null || dsSpec.getName().isEmpty()) {
     throw BddException.INVALID_PARAMETER("date store name", dsSpec.getName());
   }
   if (dsSpec.getSpec() == null || dsSpec.getSpec().isEmpty()) {
     throw BddException.INVALID_PARAMETER("vc data store name", dsSpec.getSpec().toString());
   }
   datastoreMgr.addDataStores(dsSpec);
 }
Esempio n. 3
0
 @RequestMapping(
     value = "/datastore/{dsName}",
     method = RequestMethod.GET,
     produces = "application/json")
 @ResponseBody
 public DatastoreRead getDatastore(@PathVariable("dsName") final String dsName) {
   if (dsName == null || dsName.isEmpty()) {
     throw BddException.INVALID_PARAMETER("date store name", dsName);
   }
   DatastoreRead read = datastoreMgr.getDatastoreRead(dsName);
   if (read == null) {
     throw BddException.NOT_FOUND("data store", dsName);
   }
   return read;
 }
Esempio n. 4
0
 @RequestMapping(value = "/datastores", method = RequestMethod.GET, produces = "application/json")
 @ResponseBody
 public List<DatastoreRead> getDatastore() {
   return datastoreMgr.getAllDatastoreReads();
 }