1 22 package org.jboss.mq.il.uil2.msgs; 23 24 import java.io.IOException ; 25 import java.io.ObjectInputStream ; 26 import java.io.ObjectOutputStream ; 27 28 32 public class CheckIDMsg extends BaseMsg 33 { 34 private String id; 35 36 public CheckIDMsg() 37 { 38 this(null); 39 } 40 public CheckIDMsg(String id) 41 { 42 super(MsgTypes.m_checkID); 43 this.id = id; 44 } 45 46 public String getID() 47 { 48 return id; 49 } 50 51 public void trimReply() 52 { 53 id = null; 54 } 55 56 public void write(ObjectOutputStream out) throws IOException 57 { 58 super.write(out); 59 int hasId = id != null ? 1 : 0; 60 out.writeByte(hasId); 61 if (hasId == 1) 62 out.writeObject(id); 63 } 64 65 public void read(ObjectInputStream in) throws IOException , ClassNotFoundException 66 { 67 super.read(in); 68 int hasId = in.readByte(); 69 if (hasId == 1) 70 id = (String ) in.readObject(); 71 } 72 } 73 | Popular Tags |