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 39 public final class CnxConnectReply extends AbstractJmsReply { 40 41 private int cnxKey; 42 43 44 public void setCnxKey(int cnxKey) { 45 this.cnxKey = cnxKey; 46 } 47 48 49 public int getCnxKey() { 50 return cnxKey; 51 } 52 53 54 private String proxyId; 55 56 57 public void setProxyId(String proxyId) { 58 this.proxyId = proxyId; 59 } 60 61 62 public String getProxyId() { 63 return proxyId; 64 } 65 66 protected int getClassId() { 67 return CNX_CONNECT_REPLY; 68 } 69 70 77 public CnxConnectReply(CnxConnectRequest req, int cnxKey, String proxyId) { 78 super(req.getRequestId()); 79 this.cnxKey = cnxKey; 80 this.proxyId = proxyId; 81 } 82 83 86 public CnxConnectReply() {} 87 88 91 92 98 public void writeTo(OutputStream os) throws IOException { 99 super.writeTo(os); 100 StreamUtil.writeTo(cnxKey, os); 101 StreamUtil.writeTo(proxyId, os); 102 } 103 104 110 public void readFrom(InputStream is) throws IOException { 111 super.readFrom(is); 112 cnxKey = StreamUtil.readIntFrom(is); 113 proxyId = StreamUtil.readStringFrom(is); 114 } 115 } 116 | Popular Tags |