# HG changeset patch # User pin # Date 1194595122 -32400 # Node ID 2b4863af880485d3ad84101409d4e7b5322420ce # Parent 7012a944e58f3cf1891372f55e9a23a58c8997ac *** empty log message *** diff -r 7012a944e58f -r 2b4863af8804 rep/REP.java --- a/rep/REP.java Thu Nov 08 18:51:41 2007 +0900 +++ b/rep/REP.java Fri Nov 09 16:58:42 2007 +0900 @@ -33,5 +33,6 @@ public static final int SMCMD_SM_JOIN_ACK = 63; public static final int SMCMD_UPDATE = 65; public static final int SMCMD_UPDATE_ACK = 66; - + public static final int SMCMD_UPDATE_UP = 67; + public static final int SMCMD_UPDATE_DOWN = 68; } diff -r 7012a944e58f -r 2b4863af8804 rep/REPCommand.java --- a/rep/REPCommand.java Thu Nov 08 18:51:41 2007 +0900 +++ b/rep/REPCommand.java Fri Nov 09 16:58:42 2007 +0900 @@ -25,6 +25,10 @@ this.string = string; } + public REPCommand() { + // TODO Auto-generated constructor stub + } + public String toString(){ String repCmdString = new String(cmd + "," + sid + "," + eid + "," + seq + "," + lineno + "," + textsiz + "," + string); return repCmdString; diff -r 7012a944e58f -r 2b4863af8804 rep/SessionManagerList.java --- a/rep/SessionManagerList.java Thu Nov 08 18:51:41 2007 +0900 +++ b/rep/SessionManagerList.java Fri Nov 09 16:58:42 2007 +0900 @@ -8,6 +8,7 @@ private List list = new LinkedList(); private int mySMID; + private SocketChannel master; public void add(SocketChannel channel) { list.add(channel); @@ -26,5 +27,24 @@ send.send(command); } } + + public void sendUpdateUp(REPCommand command){ + REPPacketSend send = new REPPacketSend(master); + command.setCMD(REP.SMCMD_UPDATE_UP); + send.send(command); + } + + public void sendUpdateDown(REPCommand command){ + command.setCMD(REP.SMCMD_UPDATE_DOWN); + for(SocketChannel channel : list){ + if(channel == master) continue; + REPPacketSend send = new REPPacketSend(channel); + send.send(command); + } + } + + public void setMaster(SocketChannel channel){ + this.master = channel; + } }