public RegionConfig findRegionConfiguration(String regionPath) { if (regionPath.startsWith(SEPARATOR)) { regionPath = regionPath.substring(1); } return findElement(getRegions(), regionPath); }
public <T extends CacheElement> T findCustomRegionElement(String regionPath, String elementId, Class<T> classT) { return findElement(findCustomRegionElements(regionPath, classT), elementId); }
public <T extends CacheElement> T findCustomCacheElement(String elementId, Class<T> classT) { return findElement(findCustomCacheElements(classT), elementId); }
void checkForJDBCMapping(String regionPath) { String regionName = regionPath; if (regionPath.startsWith("/")) { regionName = regionPath.substring(1); } InternalConfigurationPersistenceService ccService = getConfigurationPersistenceService(); if (ccService == null) { return; } CacheConfig cacheConfig = ccService.getCacheConfig(null); if (cacheConfig == null) { return; } RegionConfig regionConfig = CacheElement.findElement(cacheConfig.getRegions(), regionName); if (regionConfig == null) { return; } CacheElement element = CacheElement.findElement(regionConfig.getCustomRegionElements(), "jdbc-mapping"); if (element != null) { throw new IllegalStateException("Cannot destroy region \"" + regionName + "\" because JDBC mapping exists. Use \"destroy jdbc-mapping\" first."); } } }
CacheConfig.AsyncEventQueue findAEQ(String aeqId) { CacheConfig.AsyncEventQueue queue = null; InternalConfigurationPersistenceService ccService = (InternalConfigurationPersistenceService) this.getConfigurationPersistenceService(); if (ccService == null) { return null; } Set<String> groups = ccService.getGroups(); for (String group : groups) { queue = CacheElement.findElement(ccService.getCacheConfig(group).getAsyncEventQueues(), aeqId); if (queue != null) { return queue; } } return queue; }
@Test public void checkDefaultRegionAttributesForShortcuts() { RegionShortcut[] shortcuts = RegionShortcut.values(); for (RegionShortcut shortcut : shortcuts) { RegionConfig config = new RegionConfig(); config.setType(shortcut.name()); config.setName(shortcut.name()); RegionConfig masterRegion = CacheElement.findElement(master.getRegions(), shortcut.name()); assertThat(config).isEqualToComparingFieldByFieldRecursively(masterRegion); } }
List<JndiBindingsType.JndiBinding> bindings = service.getCacheConfig("cluster").getJndiBindings(); JndiBindingsType.JndiBinding binding = CacheElement.findElement(bindings, jndiName);
List<JndiBindingsType.JndiBinding> bindings = service.getCacheConfig("cluster").getJndiBindings(); JndiBindingsType.JndiBinding binding = CacheElement.findElement(bindings, dataSourceName); if (binding == null) { throw new EntityNotFoundException(
CacheElement.findElement(clusterConfig.getRegions(), regionPath.substring(1));
@Override public boolean updateConfigForGroup(String group, CacheConfig cacheConfig, Object configObject) { RegionConfig deltaConfig = (RegionConfig) configObject; RegionConfig existingConfig = CacheElement.findElement(cacheConfig.getRegions(), deltaConfig.getId());