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 CheckUserMsg extends BaseMsg 33 { 34 private String username; 35 private String password; 36 private String id; 37 38 public CheckUserMsg(boolean authenticate) 39 { 40 this(null, null, authenticate); 41 } 42 public CheckUserMsg(String username, String password, boolean authenticate) 43 { 44 super(authenticate ? MsgTypes.m_authenticate : MsgTypes.m_checkUser); 45 this.username = username; 46 this.password = password; 47 } 48 49 public String getID() 50 { 51 return id; 52 } 53 public void setID(String id) 54 { 55 this.id = id; 56 } 57 public String getPassword() 58 { 59 return password; 60 } 61 public String getUsername() 62 { 63 return username; 64 } 65 public void clearPassword() 66 { 67 password = null; 68 } 69 70 public void write(ObjectOutputStream out) throws IOException 71 { 72 super.write(out); 73 out.writeObject(username); 74 out.writeObject(password); 75 out.writeObject(id); 76 } 77 public void read(ObjectInputStream in) throws IOException , ClassNotFoundException 78 { 79 super.read(in); 80 username = (String ) in.readObject(); 81 password = (String ) in.readObject(); 82 id = (String ) in.readObject(); 83 } 84 } 85 | Popular Tags |