Class CuratorTransactionResult


  • public class CuratorTransactionResult
    extends java.lang.Object
    Holds the result of one transactional operation
    • Constructor Summary

      Constructors 
      Constructor Description
      CuratorTransactionResult​(OperationType type, java.lang.String forPath, java.lang.String resultPath, org.apache.zookeeper.data.Stat resultStat)  
      CuratorTransactionResult​(OperationType type, java.lang.String forPath, java.lang.String resultPath, org.apache.zookeeper.data.Stat resultStat, int error)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getError()
      Returns the operation generated error or 0 i.e.
      java.lang.String getForPath()
      Returns the path that was passed to the operation when added
      java.lang.String getResultPath()
      Returns the operation generated path or null.
      org.apache.zookeeper.data.Stat getResultStat()
      Returns the operation generated stat or null.
      OperationType getType()
      Returns the operation type
      static com.google.common.base.Predicate<CuratorTransactionResult> ofTypeAndPath​(OperationType type, java.lang.String forPath)
      Utility that can be passed to Google Guava to find a particular result.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CuratorTransactionResult

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

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

      • ofTypeAndPath

        public static com.google.common.base.Predicate<CuratorTransactionResult> ofTypeAndPath​(OperationType type,
                                                                                               java.lang.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 java.lang.String getForPath()
        Returns the path that was passed to the operation when added
        Returns:
        operation input path
      • getResultPath

        public java.lang.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