@Test public void testRemove() throws Exception { Process process = new Process(); process.setName("remove"); store.publish(EntityType.PROCESS, process); Process p = store.get(EntityType.PROCESS, "remove"); Assert.assertEquals(p, process); store.remove(EntityType.PROCESS, "remove"); p = store.get(EntityType.PROCESS, "remove"); Assert.assertNull(p); }
public boolean remove(EntityType type, String name) throws IvoryException { Map<String, Entity> entityMap = dictionary.get(type); if (entityMap.containsKey(name)) { try { archive(type, name); onRemove(entityMap.remove(name)); } catch (IOException e) { throw new StoreAccessException(e); } AUDIT.info(type + " " + name + " is removed from config store"); return true; } return false; }
ConfigurationStore implements IvoryService { public boolean remove(EntityType type, String name) throws IvoryException { Map<String, Entity> entityMap = dictionary.get(type); if (entityMap.containsKey(name)) { try { archive(type, name); onRemove(entityMap.remove(name)); } catch (IOException e) { throw new StoreAccessException(e); } AUDIT.info(type + " " + name + " is removed from config store"); return true; } return false; } }
ConfigurationStore implements IvoryService { public boolean remove(EntityType type, String name) throws IvoryException { Map<String, Entity> entityMap = dictionary.get(type); if (entityMap.containsKey(name)) { try { archive(type, name); onRemove(entityMap.remove(name)); } catch (IOException e) { throw new StoreAccessException(e); } AUDIT.info(type + " " + name + " is removed from config store"); return true; } return false; } @SuppressWarnings("unchecked") private  ConfigurationStore(); }
ConfigurationStore implements IvoryService { public boolean remove(EntityType type, String name) throws IvoryException { Map<String, Entity> entityMap = dictionary.get(type); if (entityMap.containsKey(name)) { try { archive(type, name); onRemove(entityMap.remove(name)); } catch (IOException e) { throw new StoreAccessException(e); } AUDIT.info(type + " " + name + " is removed from config store"); return true; } return false; } @SuppressWarnings("unchecked") private  ConfigurationStore(); static ConfigurationStore get(); @Override void init(); void registerListener(ConfigurationChangeListener listener); synchronized void publish(EntityType type, Entity entity); synchronized void rollbackUpdate(EntityType type, Entity entity); synchronized void update(EntityType type, Entity entity); synchronized void initiateUpdate(Entity entity); @SuppressWarnings("unchecked") T get(EntityType type, String name); Collection<String> getEntities(EntityType type); boolean remove(EntityType type, String name); Entity[] search(EntityType type, String... keywords); void cleanupUpdateInit(); @Override String getName(); @Override void destroy(); }
ConfigurationStore implements IvoryService { public boolean remove(EntityType type, String name) throws IvoryException { Map<String, Entity> entityMap = dictionary.get(type); if (entityMap.containsKey(name)) { try { archive(type, name); onRemove(entityMap.remove(name)); } catch (IOException e) { throw new StoreAccessException(e); } AUDIT.info(type + " " + name + " is removed from config store"); return true; } return false; } @SuppressWarnings("unchecked") private  ConfigurationStore(); static ConfigurationStore get(); @Override void init(); void registerListener(ConfigurationChangeListener listener); synchronized void publish(EntityType type, Entity entity); synchronized void rollbackUpdate(EntityType type, Entity entity); synchronized void update(EntityType type, Entity entity); synchronized void initiateUpdate(Entity entity); @SuppressWarnings("unchecked") T get(EntityType type, String name); Collection<String> getEntities(EntityType type); boolean remove(EntityType type, String name); Entity[] search(EntityType type, String... keywords); void cleanupUpdateInit(); @Override String getName(); @Override void destroy();  }