@Test public void testGetCurrentDataDoNotUseCacheCuratorReturnsNull() throws Exception { testee = new ZkNodeCacheWrapper(client, "/test", null); setupZookeeperConnectorReturnResult(null); byte[] result = testee.getCurrentData(); Assert.assertNull(result); }
@Override public byte[] getCurrentData() { byte[] result = null; if (isCacheUsageAllowed()) { ChildData data = cache.getCurrentData(); if (data != null) { result = data.getData(); } } else { try { result = dataIsCompressed ? connector.getDataDecompressed(path) : connector.getData(path); } catch (DataSourceConnectorException e) { log.warn("Failed to get data for zkPath={} {}", path); } } return result; }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public byte[] getCurrentData() { byte[] result = null; if (isCacheUsageAllowed()) { ChildData data = cache.getCurrentData(); if (data != null) { result = data.getData(); } } else { try { result = dataIsCompressed ? connector.getDataDecompressed(path) : connector.getData(path); } catch (DataSourceConnectorException e) { log.warn("Failed to get data for zkPath={} {}", path); } } return result; } }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public byte[] getCurrentData() { byte[] result = null; if (isCacheUsageAllowed()) { ChildData data = cache.getCurrentData(); if (data != null) { result = data.getData(); } } else { try { result = dataIsCompressed ? connector.getDataDecompressed(path) : connector.getData(path); } catch (DataSourceConnectorException e) { log.warn("Failed to get data for zkPath={} {}", path); } } return result; } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public byte[] getCurrentData() { byte[] result = null; if (isCacheUsageAllowed()) { ChildData data = cache.getCurrentData(); if (data != null) { result = data.getData(); } } else { try { result = dataIsCompressed ? connector.getDataDecompressed(path) : connector.getData(path); } catch (DataSourceConnectorException e) { log.warn("Failed to get data for zkPath={} {}", path); } } return result; } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); @Override void start(final boolean buildInitial); @Override void addListener(NodeCacheListener listener); @Override void rebuild(); @Override void close(); @Override byte[] getCurrentData(); @Override int getCurrentDataVersion(); @Override String getPath(); boolean isUseCache(); }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public byte[] getCurrentData() { byte[] result = null; if (isCacheUsageAllowed()) { ChildData data = cache.getCurrentData(); if (data != null) { result = data.getData(); } } else { try { result = dataIsCompressed ? connector.getDataDecompressed(path) : connector.getData(path); } catch (DataSourceConnectorException e) { log.warn("Failed to get data for zkPath={} {}", path); } } return result; } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); @Override void start(final boolean buildInitial); @Override void addListener(NodeCacheListener listener); @Override void rebuild(); @Override void close(); @Override byte[] getCurrentData(); @Override int getCurrentDataVersion(); @Override String getPath(); boolean isUseCache();  }