Class OracleSyncCache

java.lang.Object
io.micronaut.cache.oracle.OracleSyncCache
All Implemented Interfaces:
Cache<OracleCacheEntryRepository>, SyncCache<OracleCacheEntryRepository>

public final class OracleSyncCache extends Object implements SyncCache<OracleCacheEntryRepository>
Synchronous Oracle cache implementation.
Since:
6.2.0
Author:
Davide Cocco
  • Constructor Details

  • Method Details

    • get

      public <T> @NonNull Optional<T> get(@NonNull Object key, @NonNull io.micronaut.core.type.Argument<T> requiredType)
      Description copied from interface: SyncCache
      Resolve the given value for the given key.
      Specified by:
      get in interface SyncCache<OracleCacheEntryRepository>
      Type Parameters:
      T - The concrete type
      Parameters:
      key - The cache key
      requiredType - The required type
      Returns:
      An optional containing the value if it exists and is able to be converted to the specified type
    • get

      public <T> T get(@NonNull Object key, @NonNull io.micronaut.core.type.Argument<T> requiredType, @NonNull Supplier<T> supplier)
      Description copied from interface: SyncCache
      Resolve the given value for the given key. If the value is not found the specified Supplier will be invoked and the return value cached.
      Specified by:
      get in interface SyncCache<OracleCacheEntryRepository>
      Type Parameters:
      T - The concrete type
      Parameters:
      key - The cache key
      requiredType - The required type
      supplier - The supplier that should be invoked if the value is not found
      Returns:
      An optional containing the value if it exists and is able to be converted to the specified type
    • putIfAbsent

      public <T> @NonNull Optional<T> putIfAbsent(@NonNull Object key, @NonNull T value)
      Description copied from interface: SyncCache

      Cache the specified value using the specified key if it is not already present.

      Specified by:
      putIfAbsent in interface SyncCache<OracleCacheEntryRepository>
      Type Parameters:
      T - The concrete type
      Parameters:
      key - the key with which the specified value is to be associated
      value - the value to be associated with the specified key
      Returns:
      An optional of the existing value or Optional.empty() if the specified value parameter was cached
    • put

      public void put(@NonNull Object key, @Nullable Object value)
      Description copied from interface: SyncCache

      Cache the specified value using the specified key.

      Specified by:
      put in interface SyncCache<OracleCacheEntryRepository>
      Parameters:
      key - the key with which the specified value is to be associated
      value - the value to be associated with the specified key
    • invalidate

      public void invalidate(@NonNull Object key)
      Description copied from interface: SyncCache
      Invalidate the value for the given key.
      Specified by:
      invalidate in interface SyncCache<OracleCacheEntryRepository>
      Parameters:
      key - The key to invalid
    • invalidateAll

      public void invalidateAll()
      Description copied from interface: SyncCache
      Invalidate all cached values within this cache.
      Specified by:
      invalidateAll in interface SyncCache<OracleCacheEntryRepository>
    • getName

      public String getName()
      Specified by:
      getName in interface Cache<OracleCacheEntryRepository>
      Returns:
      The name of the cache
    • getNativeCache

      public OracleCacheEntryRepository getNativeCache()
      Specified by:
      getNativeCache in interface Cache<OracleCacheEntryRepository>
      Returns:
      The native cache implementation
    • getExecutorService

      public ExecutorService getExecutorService()
      Specified by:
      getExecutorService in interface SyncCache<OracleCacheEntryRepository>
      Returns:
      The executor service used to construct the default asynchronous cache.
    • getCacheInfo

      public org.reactivestreams.Publisher<CacheInfo> getCacheInfo()
      Specified by:
      getCacheInfo in interface Cache<OracleCacheEntryRepository>
      Returns:
      The cache information.
    • runCleanup

      public void runCleanup()