Class MockExternalCache<T>

java.lang.Object
com.atlassian.jira.cache.vcache.MockExternalCache<T>
All Implemented Interfaces:
com.atlassian.vcache.DirectExternalCache<T>, com.atlassian.vcache.ExternalCache<T>, com.atlassian.vcache.ExternalWriteOperationsUnbuffered<T>, com.atlassian.vcache.StableReadExternalCache<T>, com.atlassian.vcache.VCache

@ParametersAreNonnullByDefault public class MockExternalCache<T> extends Object implements com.atlassian.vcache.DirectExternalCache<T>, com.atlassian.vcache.StableReadExternalCache<T>
  • Constructor Details

    • MockExternalCache

      public MockExternalCache(String name, com.atlassian.vcache.Marshaller<T> marshaller, com.atlassian.vcache.ExternalCacheSettings settings)
  • Method Details

    • getIdentified

      @Nonnull public CompletionStage<Optional<com.atlassian.vcache.IdentifiedValue<T>>> getIdentified(String s)
      Specified by:
      getIdentified in interface com.atlassian.vcache.DirectExternalCache<T>
    • getIdentified

      public CompletionStage<com.atlassian.vcache.IdentifiedValue<T>> getIdentified(String s, Supplier<T> supplier)
      Specified by:
      getIdentified in interface com.atlassian.vcache.DirectExternalCache<T>
    • getBulkIdentified

      public CompletionStage<Map<String,Optional<com.atlassian.vcache.IdentifiedValue<T>>>> getBulkIdentified(String... keys)
      Specified by:
      getBulkIdentified in interface com.atlassian.vcache.DirectExternalCache<T>
    • getBulkIdentified

      @Nonnull public CompletionStage<Map<String,Optional<com.atlassian.vcache.IdentifiedValue<T>>>> getBulkIdentified(Iterable<String> iterable)
      Specified by:
      getBulkIdentified in interface com.atlassian.vcache.DirectExternalCache<T>
    • removeIf

      @Nonnull public CompletionStage<Boolean> removeIf(String s, com.atlassian.vcache.CasIdentifier casIdentifier)
      Specified by:
      removeIf in interface com.atlassian.vcache.DirectExternalCache<T>
    • replaceIf

      @Nonnull public CompletionStage<Boolean> replaceIf(String s, com.atlassian.vcache.CasIdentifier casIdentifier, T t)
      Specified by:
      replaceIf in interface com.atlassian.vcache.DirectExternalCache<T>
    • get

      @Nonnull public CompletionStage<Optional<T>> get(String key)
      Specified by:
      get in interface com.atlassian.vcache.ExternalCache<T>
    • get

      @Nonnull public CompletionStage<T> get(String key, Supplier<T> supplier)
      Specified by:
      get in interface com.atlassian.vcache.ExternalCache<T>
    • getBulk

      public CompletionStage<Map<String,Optional<T>>> getBulk(String... keys)
      Specified by:
      getBulk in interface com.atlassian.vcache.ExternalCache<T>
    • getBulk

      @Nonnull public CompletionStage<Map<String,Optional<T>>> getBulk(Iterable<String> iterable)
      Specified by:
      getBulk in interface com.atlassian.vcache.ExternalCache<T>
    • getBulk

      public CompletionStage<Map<String,T>> getBulk(Function<Set<String>,Map<String,T>> factory, String... keys)
      Specified by:
      getBulk in interface com.atlassian.vcache.ExternalCache<T>
    • getBulk

      @Nonnull public CompletionStage<Map<String,T>> getBulk(Function<Set<String>,Map<String,T>> function, Iterable<String> iterable)
      Specified by:
      getBulk in interface com.atlassian.vcache.ExternalCache<T>
    • put

      @Nonnull public CompletionStage<Boolean> put(String key, T value, com.atlassian.vcache.PutPolicy putPolicy)
      Specified by:
      put in interface com.atlassian.vcache.ExternalWriteOperationsUnbuffered<T>
    • remove

      public CompletionStage<Void> remove(String... keys)
      Specified by:
      remove in interface com.atlassian.vcache.ExternalWriteOperationsUnbuffered<T>
    • remove

      @Nonnull public CompletionStage<Void> remove(Iterable<String> iterable)
      Specified by:
      remove in interface com.atlassian.vcache.ExternalWriteOperationsUnbuffered<T>
    • removeAll

      @Nonnull public CompletionStage<Void> removeAll()
      Specified by:
      removeAll in interface com.atlassian.vcache.ExternalWriteOperationsUnbuffered<T>
    • getName

      @Nonnull public String getName()
      Specified by:
      getName in interface com.atlassian.vcache.VCache