Class CuratorTransactionResult
java.lang.Object
org.apache.curator.framework.api.transaction.CuratorTransactionResult
Holds the result of one transactional operation
-
Constructor Summary
ConstructorDescriptionCuratorTransactionResult
(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
Modifier and TypeMethodDescriptionint
getError()
Returns the operation generated error or0
i.e.Returns the path that was passed to the operation when addedReturns the operation generated path ornull
.org.apache.zookeeper.data.Stat
Returns the operation generated stat ornull
.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 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 typeforPath
- path- Returns:
- predicate
-
getType
Returns the operation type- Returns:
- operation type
-
getForPath
Returns the path that was passed to the operation when added- Returns:
- operation input path
-
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
-