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

net.wicp.tams.commons.binlog.replication.up.command.SingleCommand Maven / Gradle / Ivy

There is a newer version: 2.3.4
Show newest version
package net.wicp.tams.commons.binlog.replication.up.command;

import net.wicp.tams.commons.Result;
import net.wicp.tams.commons.apiext.ByteUtil.AssitWrite;
import net.wicp.tams.commons.binlog.constant.Command;

/***
 * 适合的命令有 Command.COM_RESET_CONNECTION
 * 
 * @author andy.zhou
 *
 */
public class SingleCommand extends AbsCommand {
	private static final long serialVersionUID = 1L;

	public SingleCommand(Command command) {
		super(command);
	}

	@Override
	public void packPacket(AssitWrite assit) {
		assit.write(command.getValue(), 1);
	}

	@Override
	protected Result check() {
		if (command == null || !command.isSingle()) {
			return Result.getError("此命令[" + command.name() + "]不适合");
		}
		return Result.getSuc();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy