org.apache.ignite.internal.processors.cache

## Class CacheOperationContext

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.CacheOperationContext

All Implemented Interfaces:
  Serializable

    public class CacheOperationContext
    extends Object
    implements Serializable

Cache operation context.

See Also:
  Serialized Form

### Field Summary

Fields
`static boolean` `DFLT_ALLOW_ATOMIC_OPS_IN_TX`

### Constructor Summary

Constructors
Constructor and Description
`CacheOperationContext()` Constructor with default values.
`CacheOperationContext(boolean skipStore, boolean keepBinary, @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc, boolean noRetries, @Nullable Byte dataCenterId, boolean recovery, @Nullable ReadRepairStrategy readRepairStrategy, boolean allowAtomicOpsInTx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `allowedAtomicOpsInTx()`
`@Nullable Byte` `dataCenterId()` Gets data center ID.
`@Nullable javax.cache.expiry.ExpiryPolicy` `expiry()`
`boolean` `hasDataCenterId()`
`boolean` `isKeepBinary()`
`CacheOperationContext` `keepBinary()` See `IgniteInternalCache.keepBinary()`.
`boolean` `noRetries()`
`ReadRepairStrategy` `readRepairStrategy()`
`boolean` `recovery()`
`CacheOperationContext` `setAllowAtomicOpsInTx()`
`CacheOperationContext` `setDataCenterId(byte dataCenterId)`
`CacheOperationContext` `setNoRetries(boolean noRetries)`
`CacheOperationContext` `setReadRepairStrategy(ReadRepairStrategy readRepairStrategy)`
`CacheOperationContext` `setRecovery(boolean recovery)`
`CacheOperationContext` `setSkipStore(boolean skipStore)` See `IgniteInternalCache.setSkipStore(boolean)`.
`boolean` `skipStore()`
`String` `toString()`
`CacheOperationContext` `withExpiryPolicy(javax.cache.expiry.ExpiryPolicy plc)` See `IgniteInternalCache.withExpiryPolicy(ExpiryPolicy)`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### DFLT_ALLOW_ATOMIC_OPS_IN_TX

    public static final boolean DFLT_ALLOW_ATOMIC_OPS_IN_TX

### Constructor Detail

#### CacheOperationContext

    public CacheOperationContext()

Constructor with default values.

#### CacheOperationContext

    public CacheOperationContext(boolean skipStore,
                                 boolean keepBinary,
                                 @Nullable
                                 @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc,
                                 boolean noRetries,
                                 @Nullable
                                 @Nullable Byte dataCenterId,
                                 boolean recovery,
                                 @Nullable
                                 @Nullable ReadRepairStrategy readRepairStrategy,
                                 boolean allowAtomicOpsInTx)

Parameters:
  `skipStore` - Skip store flag.
  `keepBinary` - Keep binary flag.
  `expiryPlc` - Expiry policy.
  `dataCenterId` - Data center id.
  `readRepairStrategy` - Read-repair strategy.

### Method Detail

#### isKeepBinary

    public boolean isKeepBinary()

Returns:
  Keep binary flag.

#### hasDataCenterId

    public boolean hasDataCenterId()

Returns:
  `True` if data center id is set otherwise `false`.

#### keepBinary

    public CacheOperationContext keepBinary()

See `IgniteInternalCache.keepBinary()`.

Returns:
  New instance of CacheOperationContext with keep binary flag.

#### dataCenterId

    @Nullable
    public @Nullable Byte dataCenterId()

Gets data center ID.

Returns:
  Datacenter ID.

#### skipStore

    public boolean skipStore()

Returns:
  Skip store.

#### setSkipStore

    public CacheOperationContext setSkipStore(boolean skipStore)

See `IgniteInternalCache.setSkipStore(boolean)`.

Parameters:
  `skipStore` - Skip store flag.
Returns:
  New instance of CacheOperationContext with skip store flag.

#### expiry

    @Nullable
    public @Nullable javax.cache.expiry.ExpiryPolicy expiry()

Returns:
  `ExpiryPolicy` associated with this projection.

#### withExpiryPolicy

    public CacheOperationContext withExpiryPolicy(javax.cache.expiry.ExpiryPolicy plc)

See `IgniteInternalCache.withExpiryPolicy(ExpiryPolicy)`.

Parameters:
  `plc` - `ExpiryPolicy` to associate with this projection.
Returns:
  New instance of CacheOperationContext with skip store flag.

#### setNoRetries

    public CacheOperationContext setNoRetries(boolean noRetries)

Parameters:
  `noRetries` - No retries flag.
Returns:
  Operation context.

#### setDataCenterId

    public CacheOperationContext setDataCenterId(byte dataCenterId)

Parameters:
  `dataCenterId` - Data center id.
Returns:
  Operation context.

#### setRecovery

    public CacheOperationContext setRecovery(boolean recovery)

Parameters:
  `recovery` - Recovery flag.
Returns:
  New instance of CacheOperationContext with recovery flag.

#### setReadRepairStrategy

    public CacheOperationContext setReadRepairStrategy(ReadRepairStrategy readRepairStrategy)

Parameters:
  `readRepairStrategy` - Read Repair strategy.
Returns:
  New instance of CacheOperationContext with Read Repair flag.

#### recovery

    public boolean recovery()

Returns:
  Partition recover flag.

#### readRepairStrategy

    public ReadRepairStrategy readRepairStrategy()

Returns:
  Read Repair strategy.

#### noRetries

    public boolean noRetries()

Returns:
  No retries flag.

#### setAllowAtomicOpsInTx

    public CacheOperationContext setAllowAtomicOpsInTx()

Returns:
  Operation context.

#### allowedAtomicOpsInTx

    public boolean allowedAtomicOpsInTx()

Returns:
  Allow in transactions flag.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.14.0
Release Date | : September 29 2022