V - the value typepublic abstract class AbstractTransactionalExternalCache<V> extends AbstractNonDirectExternalCache<V> implements TransactionalExternalCache<V>, TransactionControl
TransactionalExternalCache instances.| Modifier and Type | Field and Description |
|---|---|
protected Supplier<RequestContext> |
contextSupplier |
metricsRecordername| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTransactionalExternalCache(String name,
Supplier<RequestContext> contextSupplier,
MetricsRecorder metricsRecorder) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Optional<V>> |
checkValuesRecorded(Iterable<String> internalKeys)
Checks for values recorded for specified internal keys.
|
protected Map<String,V> |
handleCreation(Function<Set<String>,Map<String,V>> factory,
Set<String> externalKeys)
Handles the creation of a number of entries
|
protected V |
handleCreation(String internalKey,
Supplier<V> supplier)
Handles the creation of an entry, if required.
|
void |
put(String internalKey,
V value,
PutPolicy policy)
Puts the value under the specified key using the specified policy.
|
void |
remove(Iterable<String> internalKeys)
Remove the entries with the specified keys.
|
void |
removeAll()
Remove all entries in the cache.
|
boolean |
transactionDiscard()
Discard any changes.
|
directGet, directGetBulk, get, get, getBulk, getBulkensureCacheContext, getLogger, getName, mapException, perform, performclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitget, get, getBulk, getBulk, getBulk, getBulkremovetransactionSyncprotected final Supplier<RequestContext> contextSupplier
protected AbstractTransactionalExternalCache(String name, Supplier<RequestContext> contextSupplier, MetricsRecorder metricsRecorder)
public final void put(String internalKey, V value, PutPolicy policy)
ExternalWriteOperationsBufferedput in interface ExternalWriteOperationsBuffered<V>internalKey - the key to put the data undervalue - the value to associate with the key.policy - the policy to applypublic final void remove(Iterable<String> internalKeys)
ExternalWriteOperationsBufferedremove in interface ExternalWriteOperationsBuffered<V>internalKeys - the keys of the entries to remove.public final void removeAll()
ExternalWriteOperationsBufferedremoveAll in interface ExternalWriteOperationsBuffered<V>public final boolean transactionDiscard()
TransactionControltransactionDiscard in interface TransactionControlprotected final Map<String,Optional<V>> checkValuesRecorded(Iterable<String> internalKeys)
AbstractNonDirectExternalCachecheckValuesRecorded in class AbstractNonDirectExternalCache<V>protected final V handleCreation(String internalKey, Supplier<V> supplier) throws ExecutionException, InterruptedException
AbstractNonDirectExternalCachehandleCreation in class AbstractNonDirectExternalCache<V>internalKey - the internal key for the entry.supplier - called to create the value, if requiredExecutionExceptionInterruptedExceptionprotected final Map<String,V> handleCreation(Function<Set<String>,Map<String,V>> factory, Set<String> externalKeys) throws ExecutionException, InterruptedException
AbstractNonDirectExternalCachehandleCreation in class AbstractNonDirectExternalCache<V>factory - called to create the required values.externalKeys - the external keys for the entries.ExecutionExceptionInterruptedExceptionCopyright © 2016 Atlassian. All rights reserved.