Interface RTransaction

  • All Known Implementing Classes:
    RedissonTransaction

    public interface RTransaction
    Transaction object allows to execute transactions over Redisson objects. Uses locks for write operations and maintains data modification operations list till the commit/rollback operation.

    Transaction isolation level: READ_COMMITTED

    Author:
    Nikita Koksharov
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void commit()
      Commits all changes made on this transaction.
      > commitAsync()
      Commits all changes made on this transaction in async mode.
      <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.
      <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 by name using provided codec for both cache keys and values.
      <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 by name.
      <V> RSetCache<V>  name, Codec codec)
      Returns transactional set-based cache instance by name.
      void rollback()
      Rollback all changes made on this transaction.
      > rollbackAsync()
      Rollback all changes made on this transaction in async mode.
    • Method Detail

      • getBucket

        <V>  name)
        Returns transactional object holder instance by name.
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Bucket object
      • getBucket

        <V>  name,
                                 Codec codec)
        Returns transactional object holder instance by name using provided codec for object.
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for values
        Returns:
        Bucket object
      • getBuckets

        RBuckets getBuckets()
        Returns transactional interface for mass operations with Bucket objects.
        Returns:
        Buckets
      • getBuckets

        RBuckets getBuckets​(Codec codec)
        Returns transactional interface for mass operations with Bucket objects using provided codec for object.
        Parameters:
        codec - - codec for bucket objects
        Returns:
        Buckets
      • getMap

        <K,​V>  name)
        Returns transactional map instance by name.
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Map object
      • getMap

        <K,​V>  name,
                                           Codec codec)
        Returns transactional map instance by name using provided codec for both map keys and values.
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for keys and values
        Returns:
        Map object
      • getSet

        <V>  name)
        Returns transactional set instance by name.
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Set object
      • getSet

        <V>  name,
                           Codec codec)
        Returns transactional set instance by name using provided codec for set objects.
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for values
        Returns:
        Set object
      • getSetCache

        <V>  name)
        Returns transactional set-based cache instance by name. Supports value eviction with a given TTL value.

        If eviction is not required then it's better to use regular map getSet(String).

        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        SetCache object
      • getSetCache

        <V>  name,
                                     Codec codec)
        Returns transactional set-based cache instance by name. Supports value eviction with a given TTL value.

        If eviction is not required then it's better to use regular map getSet(String, Codec).

        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for values
        Returns:
        SetCache object
      • getMapCache

        <K,​V>  name)
        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 getMap(String).

        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        MapCache object
      • getMapCache

        <K,​V>  name,
                                                     Codec codec)
        Returns transactional map-based cache instance by name using provided codec 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 getMap(String, Codec).

        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - object name
        codec - - codec for keys and values
        Returns:
        MapCache object
      • getLocalCachedMap

        <K,​V> RLocalCachedMap<K,​V> getLocalCachedMap​(RLocalCachedMap<K,​V> fromInstance)
        Returns transactional local cached map proxy for specified local cached map instance.
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        fromInstance - - local cache map instance
        Returns:
        LocalCachedMap object
      • commit

        void commit()
        Commits all changes made on this transaction.
      • commitAsync

        > commitAsync()
        Commits all changes made on this transaction in async mode.
        Returns:
        void
      • rollback

        void rollback()
        Rollback all changes made on this transaction.
      • rollbackAsync

        > rollbackAsync()
        Rollback all changes made on this transaction in async mode.
        Returns:
        void