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

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

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

import Alachisoft.NCache.Common.DataTypes.Queue.QueuePeekOperation;
import com.alachisoft.ncache.common.protobuf.QueueCommandProtocol;
import com.alachisoft.ncache.common.protobuf.QueuePeekProtocol;

public class QueuePeekCommand extends QueueCommandBase {
    private QueuePeekProtocol.QueuePeek.Builder _queuePeekBuilder;

    public QueuePeekCommand(QueuePeekOperation operation)
    {
        super.name = "QueuePeek";
        super.key = operation.getName();
        _lockId = (String)operation.getLockId();
        _lockTimeout = operation.getLockTimeout();
    }

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

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

    @Override
    protected void createCommand()
    {
        _queuePeekBuilder = QueuePeekProtocol.QueuePeek.newBuilder();

        super.createCommand();

        _queueCommandBuilder.setType(QueueCommandProtocol.QueueCommand.Type.QUEUE_PEEK);
        _queueCommandBuilder.setQueuePeek(_queuePeekBuilder);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy