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 org.objectweb.joram.shared.stream.Streamable; 31 import org.objectweb.joram.shared.stream.StreamUtil; 32 33 37 public final class ConsumerSubRequest extends AbstractJmsRequest { 38 39 private String subName; 40 41 42 public void setSubName(String subName) { 43 this.subName = subName; 44 } 45 46 47 public String getSubName() { 48 return subName; 49 } 50 51 52 private String selector; 53 54 55 public void setSelector(String selector) { 56 this.selector = selector; 57 } 58 59 60 public String getSelector() { 61 return selector; 62 } 63 64 68 private boolean noLocal; 69 70 71 public void setNoLocal(boolean noLocal) { 72 this.noLocal = noLocal; 73 } 74 75 76 public boolean getNoLocal() { 77 return noLocal; 78 } 79 80 81 private boolean durable; 82 83 84 public void setDurable(boolean durable) { 85 this.durable = durable; 86 } 87 88 89 public boolean getDurable() { 90 return durable; 91 } 92 93 protected int getClassId() { 94 return CONSUMER_SUB_REQUEST; 95 } 96 97 106 public ConsumerSubRequest(String topic, String subName, String selector, 107 boolean noLocal, boolean durable) { 108 super(topic); 109 this.subName = subName; 110 this.selector = selector; 111 this.noLocal = noLocal; 112 this.durable = durable; 113 } 114 115 118 public ConsumerSubRequest() {} 119 120 123 124 130 public void writeTo(OutputStream os) throws IOException { 131 super.writeTo(os); 132 StreamUtil.writeTo(subName, os); 133 StreamUtil.writeTo(selector, os); 134 StreamUtil.writeTo(noLocal, os); 135 StreamUtil.writeTo(durable, os); 136 } 137 138 144 public void readFrom(InputStream is) throws IOException { 145 super.readFrom(is); 146 subName = StreamUtil.readStringFrom(is); 147 selector = StreamUtil.readStringFrom(is); 148 noLocal = StreamUtil.readBooleanFrom(is); 149 durable = StreamUtil.readBooleanFrom(is); 150 } 151 } 152 | Popular Tags |