1 23 package org.objectweb.joram.shared.client; 24 25 import java.io.Externalizable ; 26 import java.io.InputStream ; 27 import java.io.OutputStream ; 28 import java.io.IOException ; 29 30 import java.util.Vector ; 31 32 import org.objectweb.joram.shared.stream.Streamable; 33 import org.objectweb.joram.shared.stream.StreamUtil; 34 35 39 public final class ConsumerAckRequest extends AbstractJmsRequest { 40 41 private Vector ids; 42 43 44 public void addId(String id) { 45 ids.addElement(id); 46 } 47 48 49 public Vector getIds() { 50 return ids; 51 } 52 53 54 private boolean queueMode; 55 56 57 public void setQueueMode(boolean queueMode) { 58 this.queueMode = queueMode; 59 } 60 61 62 public boolean getQueueMode() { 63 return queueMode; 64 } 65 66 protected int getClassId() { 67 return CONSUMER_ACK_REQUEST; 68 } 69 70 78 public ConsumerAckRequest(String targetName, boolean queueMode) { 79 super(targetName); 80 ids = new Vector (); 81 this.queueMode = queueMode; 82 } 83 84 87 public ConsumerAckRequest() {} 88 89 92 93 99 public void writeTo(OutputStream os) throws IOException { 100 super.writeTo(os); 101 StreamUtil.writeVectorOfStringTo(ids, os); 102 StreamUtil.writeTo(queueMode, os); 103 } 104 105 111 public void readFrom(InputStream is) throws IOException { 112 super.readFrom(is); 113 ids = StreamUtil.readVectorOfStringFrom(is); 114 queueMode = StreamUtil.readBooleanFrom(is); 115 } 116 } 117 | Popular Tags |