public void removeIndex(Schema schema) { if(!configQueryFeatureEnabled) { return; } String schemaName = schema.getName(); indexCollections.remove(schemaName); configIndexes.remove(schemaName); if(cacheManager.isPresent()) { cacheManager.get().clear(schemaName); } }
@Override public Object next() { return cacheManager.get(it.next().getBeanId()); }
public void cacheRemove(BeanId beanId) { if(!configQueryFeatureEnabled) { return; } if(!cacheManager.isPresent()) { return; } cacheManager.get().remove(beanId); ConfigIndexedCollection col = indexCollections.get(beanId.getSchemaName()); col.remove(beanId); }
public void cache(Bean bean) { if(!configQueryFeatureEnabled) { return; } if(!cacheManager.isPresent()) { throw new IllegalArgumentException("A cache manager is needed to to queries."); } ConfigIndexedCollection col = indexCollections.get(bean.getId().getSchemaName()); col.add(bean); cacheManager.get().put(bean); }
public void putIndex(Schema schema) { if(!configQueryFeatureEnabled) { return; } if(configIndexes.get(schema.getName()) != null) { return; } cacheManager.get().registerSchema(schema); ConfigIndex index = new ConfigIndex(schema); configIndexes.put(schema.getName(), index); indexCollections.put(schema.getName(), new ConfigIndexedCollection(index)); }