view rep/REPCommand.java @ 341:a9a740e685fa

remove session using QUIT_2_ACK
author kono
date Mon, 13 Oct 2008 03:05:53 +0900
parents f55843e829d6
children 4b87f89b3afd
line wrap: on
line source

package rep;

import rep.REP;

public class REPCommand {
	public REP cmd;
	public int sid;
	public int eid;
	public int seq;
	public int len;
	public int lineno;
	public boolean stat;
	public boolean throughMaster;

	public  String string;
	String host;
	String port;
	
	public REPCommand(REP cmd,int sid,int eid, int seq, int lineno, String string) {
		this.cmd = cmd;
		this.sid = sid;
		this.eid = eid;
		this.seq = seq;
		this.lineno = lineno;
		this.string = string;
		this.throughMaster = false;
	}
	public REPCommand(REPCommand cmd){
		this(cmd.cmd, cmd.sid, cmd.eid, cmd.seq, cmd.lineno, cmd.string);
	}

	public REPCommand() {
	}
	
	public REPCommand(int cmd, int sid, int eid, int seq, int lineno,
			int textsiz, String string) {
		this.cmd = REP.newREP(cmd);
		this.sid = sid;
		this.eid = eid;
		this.seq = seq;
		this.lineno = lineno;
		this.string = string;
		this.throughMaster = false;
	}
	
	public String toString(){
		String repCmdString = cmd + ",sid=" + sid + ",eid=" + eid + ",seq=" + seq +
				",lineno=" + lineno ;
		if (string!=null) repCmdString += ",sz=" + string.length() +"," + string;
		return repCmdString;
	}

	public void setEID(int eid2) {
		this.eid = eid2;
	}

	public void setCMD(REP cmd2) {
		this.cmd = cmd2;
	}

	public void setSID(int sessionID) {
		this.sid = sessionID;
	}

	public void setString(String string2) {
		string = string2;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public void setPort(String port) {
		this.port = port;
	}
	
	public void setThroughMaster(boolean f){
		this.throughMaster=f;
	}
	public void setSEQID(int i) {
		seq = i;
	}

}