test_class.declarator: geoServer
test_class.modifier: @Mock
test_class.original_string: @Mock
      GeoServer geoServer;
test_class.type: GeoServer
test_class.var_name: geoServer
test_class.declarator: recent
test_class.modifier: @Mock
test_class.original_string: @Mock
      RecentObjectCache recent;
test_class.type: RecentObjectCache
test_class.var_name: recent
test_class.declarator: ctrl
test_class.modifier: @InjectMocks
test_class.original_string: @InjectMocks
      LayerController ctrl;
test_class.type: LayerController
test_class.var_name: ctrl
test_class.declarator: mvc
test_class.original_string: MockMvc mvc;
test_class.type: MockMvc
test_class.var_name: mvc
test_class.file: geoserver/webapp/api-composer/src/test/java/com/boundlessgeo/geoserver/api/controllers/LayerControllerTest.java
test_class.identifier: LayerControllerTest
test_case.body: @SuppressWarnings("unused")
      @Test
      public void testDelete() throws Exception {
          GeoServer gs = MockGeoServer.get().catalog()
              .workspace("foo", "http://scratch.org", true)
                  .layer("one")
                      .info("The layer", "This layer is cool!")
                      .meta(Metadata.IMPORTED, new Date())
                      .style().layer()
                  .featureType().store("foo")
                  .geoServer().build(geoServer);
  
          mvc.perform(delete("/app/api/layers/foo/one"))
              .andExpect(status().isNoContent())
              .andReturn();
  
          Catalog cat = geoServer.getCatalog();
          verify(cat, times(1)).remove(isA(LayerInfo.class));
          verify(cat, times(1)).remove(isA(StyleInfo.class));
      }
test_case.class_method_signature: LayerControllerTest.testDelete()
test_case.full_signature: @SuppressWarnings("unused") @Test public void testDelete()
test_case.identifier: testDelete
test_case.invocations: build geoServer store featureType layer style meta info layer workspace catalog get andReturn andExpect perform delete isNoContent status getCatalog remove verify times isA remove verify times isA
test_case.modifiers: @SuppressWarnings("unused") @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDelete()
focal_class.declarator: LOG = Logging.getLogger(LayerController.class)
focal_class.modifier: static
focal_class.original_string: static Logger LOG = Logging.getLogger(LayerController.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: importer
focal_class.original_string: Importer importer;
focal_class.type: Importer
focal_class.var_name: importer
focal_class.file: geoserver/webapp/api-composer/src/main/java/com/boundlessgeo/geoserver/api/controllers/LayerController.java
focal_class.identifier: LayerController
focal_class.class_method_signature: LayerController.LayerController(GeoServer geoServer, RecentObjectCache recentCache, Importer importer)
focal_class.full_signature: @Autowired public  LayerController(GeoServer geoServer, RecentObjectCache recentCache, Importer importer)
focal_class.identifier: LayerController
focal_class.modifiers: @Autowired public
focal_class.parameters: (GeoServer geoServer, RecentObjectCache recentCache, Importer importer)
focal_class.signature:  LayerController(GeoServer geoServer, RecentObjectCache recentCache, Importer importer)
focal_class.class_method_signature: LayerController.list(@PathVariable String wsName, 
              @RequestParam(value="page", required=false) Integer page,
              @RequestParam(value="count", required=false, defaultValue=""+DEFAULT_PAGESIZE) Integer count,
              @RequestParam(value="sort", required=false) String sort, 
              @RequestParam(value="filter", required=false) String textFilter, 
              HttpServletRequest req)
focal_class.full_signature: @RequestMapping(value="/{wsName:.+}", method = RequestMethod.GET) public @ResponseBody JSONObj list(@PathVariable String wsName, 
              @RequestParam(value="page", required=false) Integer page,
              @RequestParam(value="count", required=false, defaultValue=""+DEFAULT_PAGESIZE) Integer count,
              @RequestParam(value="sort", required=false) String sort, 
              @RequestParam(value="filter", required=false) String textFilter, 
              HttpServletRequest req)
focal_class.identifier: list
focal_class.modifiers: @RequestMapping(value="/{wsName:.+}", method = RequestMethod.GET) public @ResponseBody
focal_class.parameters: (@PathVariable String wsName, 
              @RequestParam(value="page", required=false) Integer page,
              @RequestParam(value="count", required=false, defaultValue=""+DEFAULT_PAGESIZE) Integer count,
              @RequestParam(value="sort", required=false) String sort, 
              @RequestParam(value="filter", required=false) String textFilter, 
              HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj list(@PathVariable String wsName, 
              @RequestParam(value="page", required=false) Integer page,
              @RequestParam(value="count", required=false, defaultValue=""+DEFAULT_PAGESIZE) Integer count,
              @RequestParam(value="sort", required=false) String sort, 
              @RequestParam(value="filter", required=false) String textFilter, 
              HttpServletRequest req)
focal_class.class_method_signature: LayerController.create(@PathVariable String wsName, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.full_signature: @RequestMapping(value = "/{wsName:.+}", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.CREATED) public @ResponseBody JSONObj create(@PathVariable String wsName, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.identifier: create
focal_class.modifiers: @RequestMapping(value = "/{wsName:.+}", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.CREATED) public @ResponseBody
focal_class.parameters: (@PathVariable String wsName, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj create(@PathVariable String wsName, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.class_method_signature: LayerController.createLayerFromLayer(JSONObj from, WorkspaceInfo ws, Catalog cat)
focal_class.full_signature:  LayerInfo createLayerFromLayer(JSONObj from, WorkspaceInfo ws, Catalog cat)
focal_class.identifier: createLayerFromLayer
focal_class.parameters: (JSONObj from, WorkspaceInfo ws, Catalog cat)
focal_class.return: LayerInfo
focal_class.signature: LayerInfo createLayerFromLayer(JSONObj from, WorkspaceInfo ws, Catalog cat)
focal_class.class_method_signature: LayerController.createLayerFromResource(JSONObj ref, WorkspaceInfo ws, Catalog cat)
focal_class.full_signature:  LayerInfo createLayerFromResource(JSONObj ref, WorkspaceInfo ws, Catalog cat)
focal_class.identifier: createLayerFromResource
focal_class.parameters: (JSONObj ref, WorkspaceInfo ws, Catalog cat)
focal_class.return: LayerInfo
focal_class.signature: LayerInfo createLayerFromResource(JSONObj ref, WorkspaceInfo ws, Catalog cat)
focal_class.class_method_signature: LayerController.copyStyle(LayerInfo l, WorkspaceInfo ws, Catalog cat)
focal_class.full_signature:  StyleInfo copyStyle(LayerInfo l, WorkspaceInfo ws, Catalog cat)
focal_class.identifier: copyStyle
focal_class.parameters: (LayerInfo l, WorkspaceInfo ws, Catalog cat)
focal_class.return: StyleInfo
focal_class.signature: StyleInfo copyStyle(LayerInfo l, WorkspaceInfo ws, Catalog cat)
focal_class.class_method_signature: LayerController.findUniqueStyleName(String name, WorkspaceInfo ws, Catalog cat)
focal_class.full_signature:  String findUniqueStyleName(String name, WorkspaceInfo ws, Catalog cat)
focal_class.identifier: findUniqueStyleName
focal_class.parameters: (String name, WorkspaceInfo ws, Catalog cat)
focal_class.return: String
focal_class.signature: String findUniqueStyleName(String name, WorkspaceInfo ws, Catalog cat)
focal_class.class_method_signature: LayerController.get(@PathVariable String wsName, @PathVariable String name, HttpServletRequest req)
focal_class.full_signature: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.GET) public @ResponseBody JSONObj get(@PathVariable String wsName, @PathVariable String name, HttpServletRequest req)
focal_class.identifier: get
focal_class.modifiers: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.GET) public @ResponseBody
focal_class.parameters: (@PathVariable String wsName, @PathVariable String name, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj get(@PathVariable String wsName, @PathVariable String name, HttpServletRequest req)
focal_class.class_method_signature: LayerController.delete(@PathVariable String wsName, @PathVariable String name)
focal_class.full_signature: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.DELETE) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void delete(@PathVariable String wsName, @PathVariable String name)
focal_class.identifier: delete
focal_class.modifiers: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.DELETE) @ResponseStatus(value = HttpStatus.NO_CONTENT) public
focal_class.parameters: (@PathVariable String wsName, @PathVariable String name)
focal_class.return: void
focal_class.signature: void delete(@PathVariable String wsName, @PathVariable String name)
focal_class.class_method_signature: LayerController.patch(@PathVariable String wsName, @PathVariable String name, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.full_signature: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.PATCH) public @ResponseBody JSONObj patch(@PathVariable String wsName, @PathVariable String name, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.identifier: patch
focal_class.modifiers: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.PATCH) public @ResponseBody
focal_class.parameters: (@PathVariable String wsName, @PathVariable String name, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj patch(@PathVariable String wsName, @PathVariable String name, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.class_method_signature: LayerController.put(@PathVariable String wsName, @PathVariable String name, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.full_signature: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody JSONObj put(@PathVariable String wsName, @PathVariable String name, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.identifier: put
focal_class.modifiers: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody
focal_class.parameters: (@PathVariable String wsName, @PathVariable String name, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj put(@PathVariable String wsName, @PathVariable String name, @RequestBody JSONObj obj, HttpServletRequest req)
focal_class.class_method_signature: LayerController.update(LayerInfo layer, WorkspaceInfo ws, JSONObj obj, HttpServletRequest req)
focal_class.full_signature:  JSONObj update(LayerInfo layer, WorkspaceInfo ws, JSONObj obj, HttpServletRequest req)
focal_class.identifier: update
focal_class.parameters: (LayerInfo layer, WorkspaceInfo ws, JSONObj obj, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj update(LayerInfo layer, WorkspaceInfo ws, JSONObj obj, HttpServletRequest req)
focal_class.class_method_signature: LayerController.computeNativeBounds(ResourceInfo r, Catalog catalog)
focal_class.full_signature: public void computeNativeBounds(ResourceInfo r, Catalog catalog)
focal_class.identifier: computeNativeBounds
focal_class.modifiers: public
focal_class.parameters: (ResourceInfo r, Catalog catalog)
focal_class.return: void
focal_class.signature: void computeNativeBounds(ResourceInfo r, Catalog catalog)
focal_class.class_method_signature: LayerController.computeLatLonBounds(ResourceInfo r, Catalog catalog)
focal_class.full_signature: public void computeLatLonBounds(ResourceInfo r, Catalog catalog)
focal_class.identifier: computeLatLonBounds
focal_class.modifiers: public
focal_class.parameters: (ResourceInfo r, Catalog catalog)
focal_class.return: void
focal_class.signature: void computeLatLonBounds(ResourceInfo r, Catalog catalog)
focal_class.class_method_signature: LayerController.style(@RequestBody byte[] rawStyle, @PathVariable String wsName,
          @PathVariable String name, @RequestParam(value="map", required=false) String mapName)
focal_class.full_signature: @RequestMapping(value="/{wsName}/{name}/style", method = RequestMethod.PUT, consumes = YsldHandler.MIMETYPE) @ResponseStatus(value = HttpStatus.OK) public void style(@RequestBody byte[] rawStyle, @PathVariable String wsName,
          @PathVariable String name, @RequestParam(value="map", required=false) String mapName)
focal_class.identifier: style
focal_class.modifiers: @RequestMapping(value="/{wsName}/{name}/style", method = RequestMethod.PUT, consumes = YsldHandler.MIMETYPE) @ResponseStatus(value = HttpStatus.OK) public
focal_class.parameters: (@RequestBody byte[] rawStyle, @PathVariable String wsName,
          @PathVariable String name, @RequestParam(value="map", required=false) String mapName)
focal_class.return: void
focal_class.signature: void style(@RequestBody byte[] rawStyle, @PathVariable String wsName,
          @PathVariable String name, @RequestParam(value="map", required=false) String mapName)
focal_class.class_method_signature: LayerController.createYsld(String name, WorkspaceInfo ws)
focal_class.full_signature: private StyleInfo createYsld(String name, WorkspaceInfo ws)
focal_class.identifier: createYsld
focal_class.modifiers: private
focal_class.parameters: (String name, WorkspaceInfo ws)
focal_class.return: StyleInfo
focal_class.signature: StyleInfo createYsld(String name, WorkspaceInfo ws)
focal_class.class_method_signature: LayerController.style(@PathVariable String wsName, @PathVariable String name)
focal_class.full_signature: @RequestMapping(value="/{wsName}/{name}/style", method = RequestMethod.GET, produces = YsldHandler.MIMETYPE) public @ResponseBody Object style(@PathVariable String wsName, @PathVariable String name)
focal_class.identifier: style
focal_class.modifiers: @RequestMapping(value="/{wsName}/{name}/style", method = RequestMethod.GET, produces = YsldHandler.MIMETYPE) public @ResponseBody
focal_class.parameters: (@PathVariable String wsName, @PathVariable String name)
focal_class.return: Object
focal_class.signature: Object style(@PathVariable String wsName, @PathVariable String name)
focal_class.class_method_signature: LayerController.error(InvalidYsldException e, HttpServletResponse response)
focal_class.full_signature: @ExceptionHandler(InvalidYsldException.class) public @ResponseBody JSONObj error(InvalidYsldException e, HttpServletResponse response)
focal_class.identifier: error
focal_class.modifiers: @ExceptionHandler(InvalidYsldException.class) public @ResponseBody
focal_class.parameters: (InvalidYsldException e, HttpServletResponse response)
focal_class.return: JSONObj
focal_class.signature: JSONObj error(InvalidYsldException e, HttpServletResponse response)
focal_class.class_method_signature: LayerController.recent(HttpServletRequest req)
focal_class.full_signature: @RequestMapping(value="/recent", method = RequestMethod.GET) public @ResponseBody JSONArr recent(HttpServletRequest req)
focal_class.identifier: recent
focal_class.modifiers: @RequestMapping(value="/recent", method = RequestMethod.GET) public @ResponseBody
focal_class.parameters: (HttpServletRequest req)
focal_class.return: JSONArr
focal_class.signature: JSONArr recent(HttpServletRequest req)
focal_class.class_method_signature: LayerController.layer(JSONObj obj, LayerInfo l, HttpServletRequest req)
focal_class.full_signature:  JSONObj layer(JSONObj obj, LayerInfo l, HttpServletRequest req)
focal_class.identifier: layer
focal_class.parameters: (JSONObj obj, LayerInfo l, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layer(JSONObj obj, LayerInfo l, HttpServletRequest req)
focal_class.class_method_signature: LayerController.findUniqueStyleName(String wsName, String name, Catalog cat)
focal_class.full_signature:  String findUniqueStyleName(String wsName, String name, Catalog cat)
focal_class.identifier: findUniqueStyleName
focal_class.parameters: (String wsName, String name, Catalog cat)
focal_class.return: String
focal_class.signature: String findUniqueStyleName(String wsName, String name, Catalog cat)
focal_class.superclass: extends ApiController
focal_method.body: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.DELETE)
      @ResponseStatus(value = HttpStatus.NO_CONTENT)
      public void delete(@PathVariable String wsName, @PathVariable String name) throws IOException {
          Catalog cat = geoServer.getCatalog();
          WorkspaceInfo ws = findWorkspace(wsName, cat);
          LayerInfo layer = findLayer(wsName, name, cat);
  
          recent.remove(LayerInfo.class, layer);
          recent.add(WorkspaceInfo.class, ws);
  
          CascadeDeleteVisitor remover = new CascadeDeleteVisitor(cat);
          remover.visit(layer);
  
          // if this layer was imported, delete it's style as well
          if (layer.getMetadata().containsKey(Metadata.IMPORTED)) {
              StyleInfo s = layer.getDefaultStyle();
              try {
                  remover.visit(s);
                  dataDir().style(s).delete();
              }
              catch(Exception e) {
                  LOG.log(Level.WARNING, "Unable to delete style for layer " + wsName + ":" + layer.getName(), e);
              }
          }
      }
focal_method.class_method_signature: LayerController.delete(@PathVariable String wsName, @PathVariable String name)
focal_method.full_signature: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.DELETE) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void delete(@PathVariable String wsName, @PathVariable String name)
focal_method.identifier: delete
focal_method.invocations: getCatalog findWorkspace findLayer remove add visit containsKey getMetadata getDefaultStyle visit delete style dataDir log getName
focal_method.modifiers: @RequestMapping(value="/{wsName}/{name:.+}", method = RequestMethod.DELETE) @ResponseStatus(value = HttpStatus.NO_CONTENT) public
focal_method.parameters: (@PathVariable String wsName, @PathVariable String name)
focal_method.return: void
focal_method.signature: void delete(@PathVariable String wsName, @PathVariable String name)