public String getLayerMetadata(final String layerName, final String key) { return this.blobStore.getLayerMetadata(layerName, key); }
@Override public String getLayerMetadata(String layerName, String key) { componentsStateLock.lock(); try { if (LOG.isDebugEnabled()) { LOG.debug("Getting metadata for Layer: " + layerName); } // Get the Layer metadata return store.getLayerMetadata(layerName, key); } finally { componentsStateLock.unlock(); } }
@Override public String getLayerMetadata(String layerName, String key) { // Check if the blobstore has already been configured if (configured.get()) { // Increment the number of current operations // This behavior is used in order to wait // the end of all the operations after setting // the configured parameter to false actualOperations.incrementAndGet(); try { // Get The Layer metadata return delegate.getLayerMetadata(layerName, key); } finally { // Decrement the number of current operations. actualOperations.decrementAndGet(); } } return null; }
@Override public String getLayerMetadata(String layerName, String key) { return readFunction(() -> store(layerName).getLayerMetadata(layerName, key)); }
@Test public void testMetadataWithAmpInKey() throws Exception { assertThat(store.getLayerMetadata("testLayer", "test&Key"), nullValue()); store.putLayerMetadata("testLayer", "test&Key", "testValue"); assertThat(store.getLayerMetadata("testLayer", "test&Key"), equalTo("testValue")); }
@Test public void testMetadataWithAmpInValue() throws Exception { assertThat(store.getLayerMetadata("testLayer", "testKey"), nullValue()); store.putLayerMetadata("testLayer", "testKey", "test&Value"); assertThat(store.getLayerMetadata("testLayer", "testKey"), equalTo("test&Value")); }
@Test public void testMetadataWithPercentInValue() throws Exception { assertThat(store.getLayerMetadata("testLayer", "testKey"), nullValue()); store.putLayerMetadata("testLayer", "testKey", "test%Value"); assertThat(store.getLayerMetadata("testLayer", "testKey"), equalTo("test%Value")); }
@Test public void testMetadataWithEqualsInKey() throws Exception { assertThat(store.getLayerMetadata("testLayer", "test=Key"), nullValue()); store.putLayerMetadata("testLayer", "test=Key", "testValue"); assertThat(store.getLayerMetadata("testLayer", "test=Key"), equalTo("testValue")); }
@Test public void testMetadata() throws Exception { assertThat(store.getLayerMetadata("testLayer", "testKey"), nullValue()); store.putLayerMetadata("testLayer", "testKey", "testValue"); assertThat(store.getLayerMetadata("testLayer", "testKey"), equalTo("testValue")); }
@Test public void testMetadataWithEqualsInValue() throws Exception { assertThat(store.getLayerMetadata("testLayer", "testKey"), nullValue()); store.putLayerMetadata("testLayer", "testKey", "test=Value"); assertThat(store.getLayerMetadata("testLayer", "testKey"), equalTo("test=Value")); }
@Test public void testMetadataWithPercentInKey() throws Exception { assertThat(store.getLayerMetadata("testLayer", "test%Key"), nullValue()); store.putLayerMetadata("testLayer", "test%Key", "testValue"); assertThat(store.getLayerMetadata("testLayer", "test%Key"), equalTo("testValue")); }
public void testLayerMetadata() throws Exception { fbs = setup(); final String layerName = "TestLayer"; final String key1 = "Test.Metadata.Property_1"; final String key2 = "Test.Metadata.Property_2"; assertNull(fbs.getLayerMetadata(layerName, key1)); assertNull(fbs.getLayerMetadata(layerName, key2)); fbs.putLayerMetadata(layerName, key1, "value 1"); fbs.putLayerMetadata(layerName, key2, "value 2"); assertEquals("value 1", fbs.getLayerMetadata(layerName, key1)); assertEquals("value 2", fbs.getLayerMetadata(layerName, key2)); fbs.putLayerMetadata(layerName, key1, "value 1_1"); fbs.putLayerMetadata(layerName, key2, null); assertEquals("value 1_1", fbs.getLayerMetadata(layerName, key1)); assertNull(fbs.getLayerMetadata(layerName, key2)); } }