org.apache.ignite.internal.processors.cache.distributed

## Class GridDistributedBaseMessage

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMessage
  - - org.apache.ignite.internal.processors.cache.GridCacheIdMessage
    - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage

All Implemented Interfaces:
  Serializable, GridCacheDeployable, GridCacheVersionable, Message

Direct Known Subclasses:
  GridCacheTxRecoveryRequest, GridCacheTxRecoveryResponse, GridDistributedLockRequest, GridDistributedLockResponse, GridDistributedTxFinishRequest, GridDistributedTxPrepareRequest, GridDistributedTxPrepareResponse, GridDistributedUnlockRequest

    public abstract class GridDistributedBaseMessage
    extends GridCacheIdMessage
    implements GridCacheDeployable, GridCacheVersionable

Base for all messages in replicated cache.

See Also:
  Serialized Form

### Field Summary

Fields
`protected GridCacheVersion` `ver` Lock or transaction version.

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheIdMessage

`cacheId`

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheMessage

`addDepInfo, CACHE_MSG_INDEX_FIELD_NAME, forceAddDepInfo, MAX_CACHE_MSG_LOOKUP_INDEX`

### Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message

`DIRECT_TYPE_SIZE`

### Constructor Summary

Constructors
`protected` `GridDistributedBaseMessage()` Empty constructor required by `Externalizable`
`protected` `GridDistributedBaseMessage(GridCacheVersion ver, int cnt, boolean addDepInfo)`
`protected` `GridDistributedBaseMessage(int cnt, boolean addDepInfo)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `addDeploymentInfo()` Deployment enabled flag indicates whether deployment info has to be added to this message.
`Collection<GridCacheVersion>` `committedVersions()`
`void` `completedVersions(Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledbackVers)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`Collection<GridCacheVersion>` `rolledbackVersions()`
`String` `toString()`
`GridCacheVersion` `version()`
`void` `version(GridCacheVersion ver)`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheIdMessage

`cacheGroupMessage, cacheId, cacheId, fieldsCount, handlerId`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheMessage

`appendFlag, classError, deployInfo, error, finishUnmarshal, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, messageLogger, nextIndexId, onAckReceived, onClassError, partition, partitionExchangeMessage, prepare, prepareMarshal, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, prepareObject, topologyVersion, transferExpiryPolicy, unmarshalCollection, unmarshalInfo, unmarshalInfos, unmarshalInvokeArguments, unmarshalTx`

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

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

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheDeployable

`deployInfo, prepare`

### Methods inherited from interface org.apache.ignite.plugin.extensions.communication.Message

`directType`

### Field Detail

#### ver

    @GridToStringInclude
    protected GridCacheVersion ver

Lock or transaction version.

### Constructor Detail

#### GridDistributedBaseMessage

    protected GridDistributedBaseMessage()

Empty constructor required by `Externalizable`

#### GridDistributedBaseMessage

    protected GridDistributedBaseMessage(int cnt,
                                         boolean addDepInfo)

Parameters:
  `cnt` - Count of keys references in list of candidates.
  `addDepInfo` - Deployment info flag.

#### GridDistributedBaseMessage

    protected GridDistributedBaseMessage(GridCacheVersion ver,
                                         int cnt,
                                         boolean addDepInfo)

Parameters:
  `ver` - Either lock or transaction version.
  `cnt` - Key count.
  `addDepInfo` - Deployment info flag.

### Method Detail

#### addDeploymentInfo

    public boolean addDeploymentInfo()

Deployment enabled flag indicates whether deployment info has to be added to this message.

Specified by:
  `addDeploymentInfo` in class `GridCacheMessage`
Returns:
  `true` or if deployment info must be added to the the message, `false` otherwise.

#### version

    public GridCacheVersion version()

Specified by:
  `version` in interface `GridCacheVersionable`
Returns:
  Version.

#### version

    public void version(GridCacheVersion ver)

Parameters:
  `ver` - Version.

#### completedVersions

    public void completedVersions(Collection<GridCacheVersion> committedVers,
                                  Collection<GridCacheVersion> rolledbackVers)

Parameters:
  `committedVers` - Committed versions.
  `rolledbackVers` - Rolled back versions.

#### committedVersions

    public Collection<GridCacheVersion> committedVersions()

Returns:
  Committed versions.

#### rolledbackVersions

    public Collection<GridCacheVersion> rolledbackVersions()

Returns:
  Rolled back versions.

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                           MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Overrides:
  `writeTo` in class `GridCacheIdMessage`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                            MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Overrides:
  `readFrom` in class `GridCacheIdMessage`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCacheIdMessage`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.5
Release Date | : June 4 2019