Package org.redisson.transaction
Class RedissonTransaction
-
- org.redisson.transaction.RedissonTransaction
-
- All Implemented Interfaces:
RTransaction
public class RedissonTransaction extends implements RTransaction
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description RedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options)
RedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options, <TransactionalOperation> operations, <> localCaches)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkState()
void
commit()
Commits all changes made on this transaction.void
<> localCaches, <TransactionalOperation> operations)
>
commitAsync()
Commits all changes made on this transaction in async mode.protected static
generateId()
<V> RBucket<V>
name)
Returns transactional object holder instance by name.<V> RBucket<V>
name, Codec codec)
Returns transactional object holder instance by name using provided codec for object.RBuckets
getBuckets()
Returns transactional interface for mass operations with Bucket objects.RBuckets
getBuckets(Codec codec)
Returns transactional interface for mass operations with Bucket objects using provided codec for object.<K,V>
RLocalCachedMap<K,V>getLocalCachedMap(RLocalCachedMap<K,V> fromInstance)
Returns transactional local cached map proxy for specified local cached map instance.<>
getLocalCaches()
<K,V>
RMap<K,V>name)
Returns transactional map instance by name.<K,V>
RMap<K,V>name, Codec codec)
Returns transactional map instance by name using provided codec for both map keys and values.<K,V>
RMapCache<K,V>name)
Returns transactional map-based cache instance by name.<K,V>
RMapCache<K,V>name, Codec codec)
Returns transactional map-based cache instance byname
using providedcodec
for both cache keys and values.<TransactionalOperation>
getOperations()
<V> RSet<V>
name)
Returns transactional set instance by name.<V> RSet<V>
name, Codec codec)
Returns transactional set instance by name using provided codec for set objects.<V> RSetCache<V>
name)
Returns transactional set-based cache instance byname
.<V> RSetCache<V>
name, Codec codec)
Returns transactional set-based cache instance byname
.void
rollback()
Rollback all changes made on this transaction.void
<TransactionalOperation> operations)
>
rollbackAsync()
Rollback all changes made on this transaction in async mode.
-
-
-
Constructor Detail
-
RedissonTransaction
public RedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options)
-
RedissonTransaction
public RedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options, <TransactionalOperation> operations, <> localCaches)
-
-
Method Detail
-
getLocalCachedMap
public <K,V> RLocalCachedMap<K,V> getLocalCachedMap(RLocalCachedMap<K,V> fromInstance)
Description copied from interface:RTransaction
Returns transactional local cached map proxy for specified local cached map instance.- Specified by:
getLocalCachedMap
in interfaceRTransaction
- Type Parameters:
K
- type of keyV
- type of value- Parameters:
fromInstance
- - local cache map instance- Returns:
- LocalCachedMap object
-
getBucket
public <V> name)
Description copied from interface:RTransaction
Returns transactional object holder instance by name.- Specified by:
getBucket
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of object- Returns:
- Bucket object
-
getBucket
public <V> name, Codec codec)
Description copied from interface:RTransaction
Returns transactional object holder instance by name using provided codec for object.- Specified by:
getBucket
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of objectcodec
- - codec for values- Returns:
- Bucket object
-
getBuckets
public RBuckets getBuckets()
Description copied from interface:RTransaction
Returns transactional interface for mass operations with Bucket objects.- Specified by:
getBuckets
in interfaceRTransaction
- Returns:
- Buckets
-
getBuckets
public RBuckets getBuckets(Codec codec)
Description copied from interface:RTransaction
Returns transactional interface for mass operations with Bucket objects using provided codec for object.- Specified by:
getBuckets
in interfaceRTransaction
- Parameters:
codec
- - codec for bucket objects- Returns:
- Buckets
-
getSet
public <V> name)
Description copied from interface:RTransaction
Returns transactional set instance by name.- Specified by:
getSet
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of object- Returns:
- Set object
-
getSet
public <V> name, Codec codec)
Description copied from interface:RTransaction
Returns transactional set instance by name using provided codec for set objects.- Specified by:
getSet
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of objectcodec
- - codec for values- Returns:
- Set object
-
getSetCache
public <V> name)
Description copied from interface:RTransaction
Returns transactional set-based cache instance byname
. Supports value eviction with a given TTL value.If eviction is not required then it's better to use regular map
RTransaction.getSet(String)
.- Specified by:
getSetCache
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of object- Returns:
- SetCache object
-
getSetCache
public <V> name, Codec codec)
Description copied from interface:RTransaction
Returns transactional set-based cache instance byname
. Supports value eviction with a given TTL value.If eviction is not required then it's better to use regular map
RTransaction.getSet(String, Codec)
.- Specified by:
getSetCache
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of objectcodec
- - codec for values- Returns:
- SetCache object
-
getMap
public <K,V> name)
Description copied from interface:RTransaction
Returns transactional map instance by name.- Specified by:
getMap
in interfaceRTransaction
- Type Parameters:
K
- type of keyV
- type of value- Parameters:
name
- - name of object- Returns:
- Map object
-
getMap
public <K,V> name, Codec codec)
Description copied from interface:RTransaction
Returns transactional map instance by name using provided codec for both map keys and values.- Specified by:
getMap
in interfaceRTransaction
- Type Parameters:
K
- type of keyV
- type of value- Parameters:
name
- - name of objectcodec
- - codec for keys and values- Returns:
- Map object
-
getMapCache
public <K,V> name)
Description copied from interface:RTransaction
Returns transactional map-based cache instance by name. Supports entry eviction with a given MaxIdleTime and TTL settings.If eviction is not required then it's better to use regular map
RTransaction.getMap(String)
.- Specified by:
getMapCache
in interfaceRTransaction
- Type Parameters:
K
- type of keyV
- type of value- Parameters:
name
- - name of object- Returns:
- MapCache object
-
getMapCache
public <K,V> name, Codec codec)
Description copied from interface:RTransaction
Returns transactional map-based cache instance byname
using providedcodec
for both cache keys and values. Supports entry eviction with a given MaxIdleTime and TTL settings.If eviction is not required then it's better to use regular map
RTransaction.getMap(String, Codec)
.- Specified by:
getMapCache
in interfaceRTransaction
- Type Parameters:
K
- type of keyV
- type of value- Parameters:
name
- - object namecodec
- - codec for keys and values- Returns:
- MapCache object
-
commitAsync
public > commitAsync()
Description copied from interface:RTransaction
Commits all changes made on this transaction in async mode.- Specified by:
commitAsync
in interfaceRTransaction
- Returns:
- void
-
commit
public void commit()
Description copied from interface:RTransaction
Commits all changes made on this transaction.- Specified by:
commit
in interfaceRTransaction
-
commit
public void commit(<> localCaches, <TransactionalOperation> operations)
-
generateId
protected static generateId()
-
rollback
public void rollback()
Description copied from interface:RTransaction
Rollback all changes made on this transaction.- Specified by:
rollback
in interfaceRTransaction
-
rollback
public void rollback(<TransactionalOperation> operations)
-
rollbackAsync
public > rollbackAsync()
Description copied from interface:RTransaction
Rollback all changes made on this transaction in async mode.- Specified by:
rollbackAsync
in interfaceRTransaction
- Returns:
- void
-
getLocalCaches
public <> getLocalCaches()
-
getOperations
public <TransactionalOperation> getOperations()
-
checkState
protected void checkState()
-
-