public interface InvalidationStrategy
disable()
identity()
. Recommended for single shard
configurationswithJdkRegistry()
withCustomRegistry(KeyStoreRegistry)
Modifier and Type | Method and Description |
---|---|
StoreService |
adaptStoreService(StoreService storeService)
Obtain a transformed
StoreService that is capable of supporting this invalidation strategy. |
static discord4j.core.shard.NoInvalidationStrategy |
disable()
Create an
InvalidationStrategy that disables any action on shard invalidation. |
static discord4j.core.shard.IdentityInvalidationStrategy |
identity()
Create an
InvalidationStrategy that falls through the underlying Store.invalidate()
implementation to invalidate entries on shard session closing. |
Mono<Void> |
invalidate(ShardInfo shardInfo,
StateHolder stateHolder)
Invalidate the contents of the given
StateHolder depending on the triggering shard . |
static discord4j.core.shard.KeyStoreInvalidationStrategy |
withCustomRegistry(KeyStoreRegistry keyStoreRegistry)
Create an
InvalidationStrategy that uses a custom KeyStoreRegistry to keep track of stored keys
and invalidate them on shard session closing. |
static discord4j.core.shard.KeyStoreInvalidationStrategy |
withJdkRegistry()
Create an
InvalidationStrategy that uses a JdkKeyStoreRegistry to keep track of stored keys
and invalidate them on shard session closing. |
StoreService adaptStoreService(StoreService storeService)
StoreService
that is capable of supporting this invalidation strategy.storeService
- the original configured StoreService
StoreService
that can run this strategyMono<Void> invalidate(ShardInfo shardInfo, StateHolder stateHolder)
StateHolder
depending on the triggering shard
.static discord4j.core.shard.NoInvalidationStrategy disable()
InvalidationStrategy
that disables any action on shard invalidation.NoInvalidationStrategy
static discord4j.core.shard.IdentityInvalidationStrategy identity()
InvalidationStrategy
that falls through the underlying Store.invalidate()
implementation to invalidate entries on shard session closing.IdentityInvalidationStrategy
static discord4j.core.shard.KeyStoreInvalidationStrategy withJdkRegistry()
InvalidationStrategy
that uses a JdkKeyStoreRegistry
to keep track of stored keys
and invalidate them on shard session closing. This enables up-to-date cached entities at the cost of
additional memory footprint.KeyStoreInvalidationStrategy
using a JDK based registrystatic discord4j.core.shard.KeyStoreInvalidationStrategy withCustomRegistry(KeyStoreRegistry keyStoreRegistry)
InvalidationStrategy
that uses a custom KeyStoreRegistry
to keep track of stored keys
and invalidate them on shard session closing.keyStoreRegistry
- the registry used to store keysKeyStoreInvalidationStrategy
using a custom registry