All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alachisoft.ncache.client.internal.command.CollectionClearCommand Maven / Gradle / Ivy

package com.alachisoft.ncache.client.internal.command;

import Alachisoft.NCache.Common.DataTypes.CollectionOperation;
import com.alachisoft.ncache.common.protobuf.CollectionCommandProtocol;
import com.alachisoft.ncache.runtime.caching.DistributedDataStructure;

public final class CollectionClearCommand extends CollectionCommandBase
{
    private DistributedDataStructure _collectionType;

    public CollectionClearCommand(CollectionOperation operation)
    {
        super.name = "CollectionClear";
        super.key = operation.getName();

        _lockId = (String)operation.getLockId();
        _lockTimeout = operation.getLockTimeout();
        _collectionType = operation.getType();
        _writeThruOption = operation.getWriteThruOptions();
    }

    @Override
    public RequestType getCommandRequestType()
    {
        return RequestType.AtomicRead;
    }

    @Override
    public CommandType getCommandType()
    {
        return CommandType.DATA_TYPE;
    }

    @Override
    protected void createCommand()
    {
        super.createCommand();

        _collectionCommandBuilder.setMethod(CollectionCommandProtocol.CollectionCommand.Method.COLLECTION_CLEAR);
        _collectionCommandBuilder.setType(getCollectionType(_collectionType));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy