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

net.rubyeye.xmemcached.command.binary.BinaryGetAndTouchCommand Maven / Gradle / Ivy

There is a newer version: 2.4.8
Show newest version
package net.rubyeye.xmemcached.command.binary;

import java.util.concurrent.CountDownLatch;

import net.rubyeye.xmemcached.command.CommandType;
import net.rubyeye.xmemcached.transcoders.CachedData;

/**
 * Binary GAT/GATQ command
 * 
 * @author dennis
 * 
 */
public class BinaryGetAndTouchCommand extends BinaryGetCommand {

	public BinaryGetAndTouchCommand(String key, byte[] keyBytes,
			CommandType cmdType, CountDownLatch latch, int exp, boolean noreply) {
		super(key, keyBytes, cmdType, latch, null, noreply);
		this.expTime = exp;
		switch (cmdType) {
		case GAT:
			this.opCode = OpCode.GAT;
			break;
		case GATQ:
			this.opCode = OpCode.GATQ;
			break;
		default:
			throw new IllegalArgumentException("Invalid GAT command type:"
					+ cmdType);
		}
	}

	@Override
	protected void fillExtras(CachedData data) {
		this.ioBuffer.putInt(this.expTime);
	}

	@Override
	protected byte getExtrasLength() {
		return 4;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy