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 org.objectweb.joram.shared.stream.Streamable; 32 import org.objectweb.joram.shared.stream.StreamUtil; 33 34 38 public final class ConsumerDenyRequest extends AbstractJmsRequest { 39 40 private String id; 41 42 43 public void setId(String id) { 44 this.id = id; 45 } 46 47 48 public String getId() { 49 return id; 50 } 51 52 53 private boolean queueMode; 54 55 56 public void setQueueMode(boolean queueMode) { 57 this.queueMode = queueMode; 58 } 59 60 61 public boolean getQueueMode() { 62 return queueMode; 63 } 64 65 66 private boolean doNotAck = false; 67 68 69 public void setDoNotAck(boolean doNotAck) { 70 this.doNotAck = doNotAck; 71 } 72 73 77 public boolean getDoNotAck() { 78 return doNotAck; 79 } 80 81 protected int getClassId() { 82 return CONSUMER_DENY_REQUEST; 83 } 84 85 93 public ConsumerDenyRequest(String targetName, String id, boolean queueMode) { 94 super(targetName); 95 this.id = id; 96 this.queueMode = queueMode; 97 } 98 99 109 public ConsumerDenyRequest(String targetName, String id, boolean queueMode, 110 boolean doNotAck) { 111 super(targetName); 112 this.id = id; 113 this.queueMode = queueMode; 114 this.doNotAck = doNotAck; 115 } 116 117 120 public ConsumerDenyRequest() {} 121 122 125 126 132 public void writeTo(OutputStream os) throws IOException { 133 super.writeTo(os); 134 StreamUtil.writeTo(id, os); 135 StreamUtil.writeTo(queueMode, os); 136 StreamUtil.writeTo(doNotAck, os); 137 } 138 139 145 public void readFrom(InputStream is) throws IOException { 146 super.readFrom(is); 147 id = StreamUtil.readStringFrom(is); 148 queueMode = StreamUtil.readBooleanFrom(is); 149 doNotAck = StreamUtil.readBooleanFrom(is); 150 } 151 } 152 | Popular Tags |