
com.alachisoft.ncache.client.internal.command.CounterGetCommand Maven / Gradle / Ivy
package com.alachisoft.ncache.client.internal.command;
import Alachisoft.NCache.Common.DataTypes.Counter.CounterGetOperation;
import com.alachisoft.ncache.common.protobuf.CounterCommandProtocol;
import com.alachisoft.ncache.common.protobuf.CounterGetOperationProtocol;
public class CounterGetCommand extends CounterCommandBase {
private String _key;
private CounterGetOperationProtocol.CounterGetOperation.Builder _counterGetOperationBuilder;
public CounterGetCommand(CounterGetOperation operation)
{
_key = operation.getName();
super.name = "CounterGet";
super.key = _key;
_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()
{
_counterGetOperationBuilder = CounterGetOperationProtocol.CounterGetOperation.newBuilder();
_counterGetOperationBuilder.setKey(_key);
super.createCommand();
_counterCommand.setType(CounterCommandProtocol.CounterCommand.Type.COUNTER_GET);
_counterCommand.setCounterGetOperation(_counterGetOperationBuilder);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy