@Test public void testDeleteBean() { BeanId id = BeanId.create("g1", GRANDFATHER_SCHEMA_NAME); try { admin.delete(id); } catch (AbortRuntimeException e) { assertThat(e.getEvent().getCode(), is(CFG090)); } admin.create(toBean(g1)); Optional<Bean> optional = admin.get(id); assertTrue(optional.isPresent()); admin.delete(id); optional = admin.get(id); assertFalse(optional.isPresent()); }
@DELETE @Consumes({ "*/*" }) @Path("deleteBean/{schemaName}/{id}") public void deleteBean(@PathParam("schemaName") String schemaName, @PathParam("id") String id) throws AbortRuntimeException { admin.delete(BeanId.create(id, schemaName)); }
JaxrsConfigEndpoint { @DELETE @Consumes({ "*/*" }) @Path("deleteBean/{schemaName}/{id}") public void deleteBean(@PathParam("schemaName") String schemaName, @PathParam("id") String id) throws AbortRuntimeException { admin.delete(BeanId.create(id, schemaName)); } }
JaxrsConfigEndpoint { @DELETE @Consumes({ "*/*" }) @Path("deleteBean/{schemaName}/{id}") public void deleteBean(@PathParam("schemaName") String schemaName, @PathParam("id") String id) throws AbortRuntimeException { admin.delete(BeanId.create(id, schemaName)); } @Inject  JaxrsConfigEndpoint(AdminContext admin); }
JaxrsConfigEndpoint { @DELETE @Consumes({ "*/*" }) @Path("deleteBean/{schemaName}/{id}") public void deleteBean(@PathParam("schemaName") String schemaName, @PathParam("id") String id) throws AbortRuntimeException { admin.delete(BeanId.create(id, schemaName)); } @Inject  JaxrsConfigEndpoint(AdminContext admin); @GET @Produces({ APPLICATION_JSON }) @Path("getBean/{schemaName}/{id}") JaxrsBean getBean(@PathParam("schemaName") String schemaName,
                        @PathParam("id") String id); @GET @Produces({ APPLICATION_JSON }) @Path("getSingleton/{className}") JaxrsObject getSingleton(@PathParam("className") String className); @GET @Produces({ APPLICATION_JSON }) @Path("getObject/{className}/{id}") JaxrsObject getObject(@PathParam("className") String className,
                            @PathParam("id") String id); @GET @Produces({ APPLICATION_JSON }) @Path("listBean/{schemaName}") JaxrsBeans listBean(@PathParam("schemaName") String schemaName); @GET @Produces({ APPLICATION_JSON }) @Path("listObjects/{className}") JaxrsObjects listObjects(@PathParam("className") String className); @GET @Produces({ APPLICATION_JSON }) @Path("listBeans/{schemaName}") JaxrsBeans listBeans(@PathParam("schemaName") String schemaName,
                                @QueryParam("id") final List<String> ids); @POST @Consumes({ APPLICATION_JSON }) @Path("createBean") void createBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("createObject") void createObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("createBeans") void createBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("createObjects") void createObjects(JaxrsObjects jaxrsObjects); @POST @Consumes({ APPLICATION_JSON }) @Path("setBean") void setBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("setObject") void setObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("setBeans") void setBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("setObjects") void setObjects(JaxrsObjects jaxrsObjects); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeBean") void mergeBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeObject") void mergeObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeBeans") void mergeBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeObjects") void mergeObjects(JaxrsObjects jaxrsObjects); @DELETE @Consumes({ "*/*" }) @Path("deleteBean/{schemaName}/{id}") void deleteBean(@PathParam("schemaName") String schemaName,
                           @PathParam("id") String id); @DELETE @Consumes({ "*/*" }) @Path("deleteBeans/{schemaName}") void deleteBeans(@PathParam("schemaName") String schemaName,
                            @QueryParam("id") final List<String> ids); @GET @Produces({ APPLICATION_JSON }) @Path("getSchemas") JaxrsSchemas getSchemas(); @GET @Produces({ APPLICATION_JSON }) @Path("getSchema/{schemaName}") JaxrsSchema getSchema(@PathParam("schemaName") String schemaName); @GET @Produces({ APPLICATION_JSON }) @Path("query/{schemaName}") JaxrsBeans query(@PathParam("schemaName") String schemaName, @QueryParam("q") String query,
                            @QueryParam("first") String first, @QueryParam("max") int max); }
JaxrsConfigEndpoint { @DELETE @Consumes({ "*/*" }) @Path("deleteBean/{schemaName}/{id}") public void deleteBean(@PathParam("schemaName") String schemaName, @PathParam("id") String id) throws AbortRuntimeException { admin.delete(BeanId.create(id, schemaName)); } @Inject  JaxrsConfigEndpoint(AdminContext admin); @GET @Produces({ APPLICATION_JSON }) @Path("getBean/{schemaName}/{id}") JaxrsBean getBean(@PathParam("schemaName") String schemaName,
                        @PathParam("id") String id); @GET @Produces({ APPLICATION_JSON }) @Path("getSingleton/{className}") JaxrsObject getSingleton(@PathParam("className") String className); @GET @Produces({ APPLICATION_JSON }) @Path("getObject/{className}/{id}") JaxrsObject getObject(@PathParam("className") String className,
                            @PathParam("id") String id); @GET @Produces({ APPLICATION_JSON }) @Path("listBean/{schemaName}") JaxrsBeans listBean(@PathParam("schemaName") String schemaName); @GET @Produces({ APPLICATION_JSON }) @Path("listObjects/{className}") JaxrsObjects listObjects(@PathParam("className") String className); @GET @Produces({ APPLICATION_JSON }) @Path("listBeans/{schemaName}") JaxrsBeans listBeans(@PathParam("schemaName") String schemaName,
                                @QueryParam("id") final List<String> ids); @POST @Consumes({ APPLICATION_JSON }) @Path("createBean") void createBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("createObject") void createObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("createBeans") void createBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("createObjects") void createObjects(JaxrsObjects jaxrsObjects); @POST @Consumes({ APPLICATION_JSON }) @Path("setBean") void setBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("setObject") void setObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("setBeans") void setBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("setObjects") void setObjects(JaxrsObjects jaxrsObjects); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeBean") void mergeBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeObject") void mergeObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeBeans") void mergeBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeObjects") void mergeObjects(JaxrsObjects jaxrsObjects); @DELETE @Consumes({ "*/*" }) @Path("deleteBean/{schemaName}/{id}") void deleteBean(@PathParam("schemaName") String schemaName,
                           @PathParam("id") String id); @DELETE @Consumes({ "*/*" }) @Path("deleteBeans/{schemaName}") void deleteBeans(@PathParam("schemaName") String schemaName,
                            @QueryParam("id") final List<String> ids); @GET @Produces({ APPLICATION_JSON }) @Path("getSchemas") JaxrsSchemas getSchemas(); @GET @Produces({ APPLICATION_JSON }) @Path("getSchema/{schemaName}") JaxrsSchema getSchema(@PathParam("schemaName") String schemaName); @GET @Produces({ APPLICATION_JSON }) @Path("query/{schemaName}") JaxrsBeans query(@PathParam("schemaName") String schemaName, @QueryParam("q") String query,
                            @QueryParam("first") String first, @QueryParam("max") int max); static final String PATH; }