org.apache.geode.cache

## Interface TransactionEvent

-     public interface TransactionEvent

  An event that describes the culmination of an entire transaction. It either describes the work done by a committed transaction or the work abandoned by an explicit rollback or failed commit. The actual work is represented by an ordered list of `EntryEvent` instances.

  A `TransactionListener` receives an instance of this class allowing exploration of the resultant operations. The resultant operation is the final result of, potentially, a sequence of operations on a key such that earlier operations might be masked. For example, multiple put operations using the same key will result in only one `EntryEvent` for that key.

  An instance of TransactionEvent for the same transaction on the originating VM may differ from a recipient VM. The amount of variation will depend on the variation of the state of Entries on each VM. One reason for why this might occur is the different Expiration/Eviction settings of the similar Regions on different VMs.

  The event lists are ordered according to the chronological order of the indiviual operations.

  The `EntryEvent` instances always return `null` as their `callback argument`.

  Since:
    GemFire 4.0
  See Also:
    `TransactionListener`, `EntryEvent`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `Cache` | `getCache()` Gets the Cache for this transaction event
    `java.util.List<EntryEvent<?,?>>` | `getCreateEvents()` Deprecated. as of GemFire 5.0, use `getEvents()` instead
    `java.util.List<EntryEvent<?,?>>` | `getDestroyEvents()` Deprecated. as of GemFire 5.0, use `getEvents()` instead
    `java.util.List<CacheEvent<?,?>>` | `getEvents()` Returns an ordered list of every `CacheEvent` for this transaction.
    `java.util.List<EntryEvent<?,?>>` | `getInvalidateEvents()` Deprecated. as of GemFire 5.0, use `getEvents()` instead
    `java.util.List<EntryEvent<?,?>>` | `getPutEvents()` Deprecated. as of GemFire 5.0, use `getEvents()` instead
    `TransactionId` | `getTransactionId()` Gets the `TransactionId` associated this TransactionEvent.

- - ### Method Detail

    - #### getTransactionId

          TransactionId getTransactionId()

      Gets the `TransactionId` associated this TransactionEvent.

    - #### getCreateEvents

          @Deprecated
          java.util.List<EntryEvent<?,?>> getCreateEvents()

      Deprecated. as of GemFire 5.0, use `getEvents()` instead
      Gets all "create" EntryEvents for this transaction; `Region.create` and/or `Region.put`
      Returns:
        `List` of `EntryEvents` or `Collections.EMPTY_LIST`

    - #### getDestroyEvents

          @Deprecated
          java.util.List<EntryEvent<?,?>> getDestroyEvents()

      Deprecated. as of GemFire 5.0, use `getEvents()` instead
      Gets all "destroy" EntryEvents for this transaction; `Region.destroy` and `Region.localDestroy`.
      Returns:
        `List` of `EntryEvents` or `Collections.EMPTY_LIST`

    - #### getPutEvents

          @Deprecated
          java.util.List<EntryEvent<?,?>> getPutEvents()

      Deprecated. as of GemFire 5.0, use `getEvents()` instead
      Gets all `Region.put` EntryEvents for this transaction.
      Returns:
        `List` of `EntryEvents` or `Collections.EMPTY_LIST`

    - #### getInvalidateEvents

          @Deprecated
          java.util.List<EntryEvent<?,?>> getInvalidateEvents()

      Deprecated. as of GemFire 5.0, use `getEvents()` instead
      Gets all "invalidate" EntryEvents for this transaction; `Region.invalidate` and `Region.localInvalidate`.
      Returns:
        `List` of `EntryEvents` or `Collections.EMPTY_LIST`

    - #### getEvents

          java.util.List<CacheEvent<?,?>> getEvents()

      Returns an ordered list of every `CacheEvent` for this transaction. The event order is consistent with the order in which the operations were performed during the transaction.
      Returns:
        an unmodifiable `List` of all the `CacheEvent` instances; one for each operation performed by this transaction.
      Since:
        GemFire 5.0

    - #### getCache

          Cache getCache()

      Gets the Cache for this transaction event
      Returns:
        `Cache`