Interface DataConflictOperation
- All Superinterfaces:
DataSyncOperation
- All Known Implementing Classes:
AbstractLocalClusterOperationData,AbstractLocalClusterWriteOperationData,LocalClusterChangeOperationData,LocalClusterPartialUpdateOperationData,LocalClusterRemoveByUIDOperationData,LocalClusterRemoveOperationData,LocalClusterUpdateOperationData,LocalClusterWriteOperationData
Provides an interface for handling a conflicting data operation.
Conflicting operations can
be resolved using the abort() and override() methods.
It is important to understand that override() acts differently for each DataConflictOperation.OperationType (refer to
ConflictCause implementations for more information).
- Since:
- 8.0.3
- Author:
- eitany, idan
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Determines that the operation will be aborted.Deprecated.since 9.0.1 - useDataSyncOperation.getDataAsDocument()orDataSyncOperation.getDataAsObject()instead.Deprecated.since 9.0.1 - useDataSyncOperation.getDataSyncOperationType()instead.intbooleanvoidoverride()Determines that the operation will be overridden.booleanbooleanMethods inherited from interface com.gigaspaces.sync.DataSyncOperation
getDataAsDocument, getDataAsObject, getDataSyncOperationType, getSpaceId, getTypeDescriptor, getUid, supportsDataAsDocument, supportsDataAsObject, supportsGetSpaceId, supportsGetTypeDescriptor
-
Method Details
-
getOperationType
Deprecated.since 9.0.1 - useDataSyncOperation.getDataSyncOperationType()instead.- Returns:
- The operation type.
-
getConflictCause
ConflictCause getConflictCause()- Returns:
- The
ConflictCauseinstance representing the conflict.
-
hasConflict
boolean hasConflict()- Returns:
- true if that operation had a conflict, otherwise false.
-
getOperationEntry
Deprecated.since 9.0.1 - useDataSyncOperation.getDataAsDocument()orDataSyncOperation.getDataAsObject()instead.- Returns:
- The user entry the operation had a conflict for.
-
abort
void abort()Determines that the operation will be aborted. This can only be used if thesupportsAbort()returns true. -
override
void override()Determines that the operation will be overridden. This can only be used if thesupportsOverride()returns true.It is possible to change the operation's entry data using the
DataSyncOperation.getDataAsObject()orDataSyncOperation.getDataAsDocument()methods.- Write operation with an
EntryAlreadyInSpaceConflictwill turn to an update operation. - Update operation with an
EntryNotInSpaceConflictwill turn to a write operation. - Update operation with an
EntryVersionConflictwill overwrite the entry in the target space. - Update operation with an
EntryLockedUnderTransactionConflictwill be retried.
- Write operation with an
-
supportsOverride
boolean supportsOverride()- Returns:
- true if overriding the operation is supported, otherwise false.
-
supportsAbort
boolean supportsAbort()- Returns:
- true of aborting the operation is supported, otherwise false.
-
getResolveAttempt
int getResolveAttempt()- Returns:
- The current resolve attempt number for the operation.
-
DataSyncOperationType.