@Test public void testEnqueueUpdate() { fail("Not yet implemented"); }
public void enqueueUpdate(TOMMessage up) { ReconfigureRequest request = (ReconfigureRequest) TOMUtil.getObject(up.getContent()); if (TOMUtil.verifySignature(getStaticConf().getPublicKey(request.getSender()), request.toString().getBytes(), request.getSignature())) { if (request.getSender() == getStaticConf().getTTPId()) { this.updates.add(up); } else { boolean add = true; Iterator<Integer> it = request.getProperties().keySet().iterator(); while (it.hasNext()) { int key = it.next(); String value = request.getProperties().get(key); if (key == ADD_SERVER) { StringTokenizer str = new StringTokenizer(value, ":"); if (str.countTokens() > 2) { int id = Integer.parseInt(str.nextToken()); if (id != request.getSender()) { add = false; } } else { add = false; } } else if (key == REMOVE_SERVER) { if (isCurrentViewMember(Integer.parseInt(value))) { if (Integer.parseInt(value) != request.getSender()) { add = false; } } else { add = false; } } else if (key == CHANGE_F) { add = false; } } if (add) { this.updates.add(up); } } } }
ServerViewController extends ViewController { public void enqueueUpdate(TOMMessage up) { ReconfigureRequest request = (ReconfigureRequest) TOMUtil.getObject(up.getContent()); if (TOMUtil.verifySignature(getStaticConf().getPublicKey(request.getSender()), request.toString().getBytes(), request.getSignature())) { if (request.getSender() == getStaticConf().getTTPId()) { this.updates.add(up); } else { boolean add = true; Iterator<Integer> it = request.getProperties().keySet().iterator(); while (it.hasNext()) { int key = it.next(); String value = request.getProperties().get(key); if (key == ADD_SERVER) { StringTokenizer str = new StringTokenizer(value, ":"); if (str.countTokens() > 2) { int id = Integer.parseInt(str.nextToken()); if (id != request.getSender()) { add = false; } } else { add = false; } } else if (key == REMOVE_SERVER) { if (isCurrentViewMember(Integer.parseInt(value))) { if (Integer.parseInt(value) != request.getSender()) { add = false; } } else { add = false; } } else if (key == CHANGE_F) { add = false; } } if (add) { this.updates.add(up); } } } } }
ServerViewController extends ViewController { public void enqueueUpdate(TOMMessage up) { ReconfigureRequest request = (ReconfigureRequest) TOMUtil.getObject(up.getContent()); if (TOMUtil.verifySignature(getStaticConf().getPublicKey(request.getSender()), request.toString().getBytes(), request.getSignature())) { if (request.getSender() == getStaticConf().getTTPId()) { this.updates.add(up); } else { boolean add = true; Iterator<Integer> it = request.getProperties().keySet().iterator(); while (it.hasNext()) { int key = it.next(); String value = request.getProperties().get(key); if (key == ADD_SERVER) { StringTokenizer str = new StringTokenizer(value, ":"); if (str.countTokens() > 2) { int id = Integer.parseInt(str.nextToken()); if (id != request.getSender()) { add = false; } } else { add = false; } } else if (key == REMOVE_SERVER) { if (isCurrentViewMember(Integer.parseInt(value))) { if (Integer.parseInt(value) != request.getSender()) { add = false; } } else { add = false; } } else if (key == CHANGE_F) { add = false; } } if (add) { this.updates.add(up); } } } } ServerViewController(int procId);  ServerViewController(int procId, String configHome); }
ServerViewController extends ViewController { public void enqueueUpdate(TOMMessage up) { ReconfigureRequest request = (ReconfigureRequest) TOMUtil.getObject(up.getContent()); if (TOMUtil.verifySignature(getStaticConf().getPublicKey(request.getSender()), request.toString().getBytes(), request.getSignature())) { if (request.getSender() == getStaticConf().getTTPId()) { this.updates.add(up); } else { boolean add = true; Iterator<Integer> it = request.getProperties().keySet().iterator(); while (it.hasNext()) { int key = it.next(); String value = request.getProperties().get(key); if (key == ADD_SERVER) { StringTokenizer str = new StringTokenizer(value, ":"); if (str.countTokens() > 2) { int id = Integer.parseInt(str.nextToken()); if (id != request.getSender()) { add = false; } } else { add = false; } } else if (key == REMOVE_SERVER) { if (isCurrentViewMember(Integer.parseInt(value))) { if (Integer.parseInt(value) != request.getSender()) { add = false; } } else { add = false; } } else if (key == CHANGE_F) { add = false; } } if (add) { this.updates.add(up); } } } } ServerViewController(int procId);  ServerViewController(int procId, String configHome); void setTomLayer(TOMLayer tomLayer); boolean isInCurrentView(); int[] getCurrentViewOtherAcceptors(); int[] getCurrentViewAcceptors(); boolean hasUpdates(); void enqueueUpdate(TOMMessage up); byte[] executeUpdates(int cid); TOMMessage[] clearUpdates(); boolean isInLastJoinSet(int id); void processJoinResult(ReconfigureReply r); @Override final void reconfigureTo(View newView); int getQuorum(); }
ServerViewController extends ViewController { public void enqueueUpdate(TOMMessage up) { ReconfigureRequest request = (ReconfigureRequest) TOMUtil.getObject(up.getContent()); if (TOMUtil.verifySignature(getStaticConf().getPublicKey(request.getSender()), request.toString().getBytes(), request.getSignature())) { if (request.getSender() == getStaticConf().getTTPId()) { this.updates.add(up); } else { boolean add = true; Iterator<Integer> it = request.getProperties().keySet().iterator(); while (it.hasNext()) { int key = it.next(); String value = request.getProperties().get(key); if (key == ADD_SERVER) { StringTokenizer str = new StringTokenizer(value, ":"); if (str.countTokens() > 2) { int id = Integer.parseInt(str.nextToken()); if (id != request.getSender()) { add = false; } } else { add = false; } } else if (key == REMOVE_SERVER) { if (isCurrentViewMember(Integer.parseInt(value))) { if (Integer.parseInt(value) != request.getSender()) { add = false; } } else { add = false; } } else if (key == CHANGE_F) { add = false; } } if (add) { this.updates.add(up); } } } } ServerViewController(int procId);  ServerViewController(int procId, String configHome); void setTomLayer(TOMLayer tomLayer); boolean isInCurrentView(); int[] getCurrentViewOtherAcceptors(); int[] getCurrentViewAcceptors(); boolean hasUpdates(); void enqueueUpdate(TOMMessage up); byte[] executeUpdates(int cid); TOMMessage[] clearUpdates(); boolean isInLastJoinSet(int id); void processJoinResult(ReconfigureReply r); @Override final void reconfigureTo(View newView); int getQuorum(); static final int ADD_SERVER; static final int REMOVE_SERVER; static final int CHANGE_F; }