Class KeyValueStoreWrapper<T>

  • All Implemented Interfaces:
    org.opennms.integration.api.v1.distributed.KeyValueStore<T>

    public class KeyValueStoreWrapper<T>
    extends Object
    implements org.opennms.integration.api.v1.distributed.KeyValueStore<T>
    • Constructor Detail

      • KeyValueStoreWrapper

        public KeyValueStoreWrapper​(KeyValueStore store)
    • Method Detail

      • put

        public long put​(String key,
                        T value,
                        String context)
        Specified by:
        put in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • put

        public long put​(String key,
                        T value,
                        String context,
                        Integer ttlInSeconds)
        Specified by:
        put in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • get

        public Optional<T> get​(String key,
                               String context)
        Specified by:
        get in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • getIfStale

        public Optional<T> getIfStale​(String key,
                                      String context,
                                      long timestamp)
        Specified by:
        getIfStale in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • getLastUpdated

        public OptionalLong getLastUpdated​(String key,
                                           String context)
        Specified by:
        getLastUpdated in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • enumerateContext

        public Map<String,​T> enumerateContext​(String context)
        Specified by:
        enumerateContext in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • delete

        public void delete​(String key,
                           String context)
        Specified by:
        delete in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • truncateContext

        public void truncateContext​(String context)
        Specified by:
        truncateContext in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • putAsync

        public CompletableFuture<Long> putAsync​(String key,
                                                T value,
                                                String context)
        Specified by:
        putAsync in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • putAsync

        public CompletableFuture<Long> putAsync​(String key,
                                                T value,
                                                String context,
                                                Integer ttlInSeconds)
        Specified by:
        putAsync in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • getIfStaleAsync

        public CompletableFuture<Optional<T>> getIfStaleAsync​(String key,
                                                              String context,
                                                              long timestamp)
        Specified by:
        getIfStaleAsync in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • getLastUpdatedAsync

        public CompletableFuture<OptionalLong> getLastUpdatedAsync​(String key,
                                                                   String context)
        Specified by:
        getLastUpdatedAsync in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • getName

        public String getName()
        Specified by:
        getName in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • enumerateContextAsync

        public CompletableFuture<Map<String,​T>> enumerateContextAsync​(String context)
        Specified by:
        enumerateContextAsync in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • deleteAsync

        public CompletableFuture<Void> deleteAsync​(String key,
                                                   String context)
        Specified by:
        deleteAsync in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>
      • truncateContextAsync

        public CompletableFuture<Void> truncateContextAsync​(String context)
        Specified by:
        truncateContextAsync in interface org.opennms.integration.api.v1.distributed.KeyValueStore<T>