diff --git a/sdk/src/main/java/io/opentdf/platform/sdk/NanoTDF.java b/sdk/src/main/java/io/opentdf/platform/sdk/NanoTDF.java index a4d5f359..f893762a 100644 --- a/sdk/src/main/java/io/opentdf/platform/sdk/NanoTDF.java +++ b/sdk/src/main/java/io/opentdf/platform/sdk/NanoTDF.java @@ -35,7 +35,7 @@ public class NanoTDF { private final CollectionStore collectionStore; public NanoTDF() { - this(null); + this(new CollectionStore.NoOpCollectionStore()); } public NanoTDF(boolean collectionStoreEnabled) { diff --git a/sdk/src/main/java/io/opentdf/platform/sdk/nanotdf/CollectionStore.java b/sdk/src/main/java/io/opentdf/platform/sdk/nanotdf/CollectionStore.java index fd87a37e..69a0be8c 100644 --- a/sdk/src/main/java/io/opentdf/platform/sdk/nanotdf/CollectionStore.java +++ b/sdk/src/main/java/io/opentdf/platform/sdk/nanotdf/CollectionStore.java @@ -3,7 +3,19 @@ import io.opentdf.platform.sdk.NanoTDF; public interface CollectionStore { - public static final NanoTDF.CollectionKey NO_PRIVATE_KEY = new NanoTDF.CollectionKey(null); + NanoTDF.CollectionKey NO_PRIVATE_KEY = new NanoTDF.CollectionKey(null); void store(Header header, NanoTDF.CollectionKey key); NanoTDF.CollectionKey getKey(Header header); + + class NoOpCollectionStore implements CollectionStore { + public NoOpCollectionStore() {} + + @Override + public void store(Header header, NanoTDF.CollectionKey key) {} + + @Override + public NanoTDF.CollectionKey getKey(Header header) { + return NO_PRIVATE_KEY; + } + } }