View Javadoc

1   package com.atlassian.vcache.internal.core.service;
2   
3   import com.atlassian.vcache.internal.core.ExternalCacheKeyGenerator;
4   
5   import java.time.Duration;
6   import java.util.function.Supplier;
7   
8   /**
9    * Represents the request context for an {@link com.atlassian.vcache.ExternalCache} that does not maintain a
10   * cache version.
11   *
12   * @param <V> the value type
13   * @since 1.0.0
14   */
15  public class UnversionedExternalCacheRequestContext<V> extends AbstractExternalCacheRequestContext<V> {
16      private static final long FIXED_CACHE_VERSION = 200106074;
17  
18      public UnversionedExternalCacheRequestContext(
19              ExternalCacheKeyGenerator keyGenerator,
20              String name,
21              Supplier<String> partitionSupplier,
22              Duration lockTimeout) {
23          super(keyGenerator, name, partitionSupplier, lockTimeout);
24      }
25  
26      @Override
27      protected final long cacheVersion() {
28          return FIXED_CACHE_VERSION;
29      }
30  }