1 24 package org.objectweb.joram.shared.client; 25 26 import java.io.Externalizable ; 27 import java.io.InputStream ; 28 import java.io.OutputStream ; 29 import java.io.IOException ; 30 31 import java.util.Vector ; 32 33 import org.objectweb.joram.shared.stream.Streamable; 34 import org.objectweb.joram.shared.stream.StreamUtil; 35 36 40 public final class SessDenyRequest extends AbstractJmsRequest { 41 42 private Vector ids; 43 44 45 public void setIds(Vector ids) { 46 this.ids = ids; 47 } 48 49 public void addId(String id) { 50 if (ids == null) 51 ids = new Vector (); 52 ids.addElement(id); 53 } 54 55 56 public Vector getIds() { 57 return ids; 58 } 59 60 61 private boolean queueMode; 62 63 64 public void setQueueMode(boolean queueMode) { 65 this.queueMode = queueMode; 66 } 67 68 69 public boolean getQueueMode() { 70 return queueMode; 71 } 72 73 74 private boolean doNotAck = false; 75 76 77 public void setDoNotAck(boolean doNotAck) { 78 this.doNotAck = doNotAck; 79 } 80 81 85 public boolean getDoNotAck() { 86 return doNotAck; 87 } 88 89 protected int getClassId() { 90 return SESS_DENY_REQUEST; 91 } 92 93 101 public SessDenyRequest(String targetName, Vector ids, boolean queueMode) { 102 super(targetName); 103 this.ids = ids; 104 this.queueMode = queueMode; 105 } 106 107 117 public SessDenyRequest(String targetName, Vector ids, boolean queueMode, 118 boolean doNotAck) { 119 super(targetName); 120 this.ids = ids; 121 this.queueMode = queueMode; 122 this.doNotAck = doNotAck; 123 } 124 125 128 public SessDenyRequest() {} 129 130 133 134 140 public void writeTo(OutputStream os) throws IOException { 141 super.writeTo(os); 142 StreamUtil.writeVectorOfStringTo(ids, os); 143 StreamUtil.writeTo(queueMode, os); 144 StreamUtil.writeTo(doNotAck, os); 145 } 146 147 153 public void readFrom(InputStream is) throws IOException { 154 super.readFrom(is); 155 ids = StreamUtil.readVectorOfStringFrom(is); 156 queueMode = StreamUtil.readBooleanFrom(is); 157 doNotAck = StreamUtil.readBooleanFrom(is); 158 } 159 } 160 | Popular Tags |