Class CuratorTransactionResult

java.lang.Object
org.apache.curator.framework.api.transaction.CuratorTransactionResult

public class CuratorTransactionResult extends Object
Holds the result of one transactional operation
  • Constructor Details

    • CuratorTransactionResult

      public CuratorTransactionResult(OperationType type, String forPath, String resultPath, org.apache.zookeeper.data.Stat resultStat)
    • CuratorTransactionResult

      public CuratorTransactionResult(OperationType type, String forPath, String resultPath, org.apache.zookeeper.data.Stat resultStat, int error)
  • Method Details

    • ofTypeAndPath

      public static com.google.common.base.Predicate<CuratorTransactionResult> ofTypeAndPath(OperationType type, String forPath)
      Utility that can be passed to Google Guava to find a particular result. E.g.
       Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, path))
       
      Parameters:
      type - operation type
      forPath - path
      Returns:
      predicate
    • getType

      public OperationType getType()
      Returns the operation type
      Returns:
      operation type
    • getForPath

      public String getForPath()
      Returns the path that was passed to the operation when added
      Returns:
      operation input path
    • getResultPath

      public String getResultPath()
      Returns the operation generated path or null. i.e. CuratorTransaction.create() using an EPHEMERAL mode generates the created path plus its sequence number.
      Returns:
      generated path or null
    • getResultStat

      public org.apache.zookeeper.data.Stat getResultStat()
      Returns the operation generated stat or null. i.e. CuratorTransaction.setData() generates a stat object.
      Returns:
      generated stat or null
    • getError

      public int getError()
      Returns the operation generated error or 0 i.e. OpResult.ErrorResult.getErr()
      Returns:
      error or 0