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 Summary
Constructors Constructor Description CuratorTransactionResult(OperationType type, String forPath, String resultPath, org.apache.zookeeper.data.Stat resultStat)
CuratorTransactionResult(OperationType type, String forPath, 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 or0
i.e.String
getForPath()
Returns the path that was passed to the operation when addedString
getResultPath()
Returns the operation generated path ornull
.org.apache.zookeeper.data.Stat
getResultStat()
Returns the operation generated stat ornull
.OperationType
getType()
Returns the operation typestatic com.google.common.base.Predicate<CuratorTransactionResult>
ofTypeAndPath(OperationType type, String forPath)
Utility that can be passed to Google Guava to find a particular result.
-
-
-
Constructor Detail
-
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 Detail
-
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 typeforPath
- 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 ornull
. 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 ornull
. i.e.CuratorTransaction.setData()
generates a stat object.- Returns:
- generated stat or null
-
getError
public int getError()
Returns the operation generated error or0
i.e.OpResult.ErrorResult.getErr()
- Returns:
- error or 0
-
-