00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 package fr.dyade.aaa.agent.conf;
00020
00021 import java.io.*;
00022
00027 public class A3CMLNat implements Serializable {
00031 private static final long serialVersionUID = 1L;
00033 public short sid = -1;
00035 public String host = null;
00037 public int port = -1;
00038
00039 public A3CMLNat(short sid,
00040 String host,
00041 int port) {
00042 this.sid = sid;
00043 this.host = host;
00044 this.port = port;
00045 }
00046
00047 public A3CMLNat duplicate() throws Exception {
00048 A3CMLNat clone = new A3CMLNat(sid, host, port);
00049 return clone;
00050 }
00051
00052 public String toString() {
00053 StringBuffer strBuf = new StringBuffer();
00054 strBuf.append("(");
00055 strBuf.append(super.toString());
00056 strBuf.append(",sid=").append(sid);
00057 strBuf.append(",host=").append(host);
00058 strBuf.append(",port=").append(port);
00059 strBuf.append(")");
00060 return strBuf.toString();
00061 }
00062
00063 public boolean equals(Object obj) {
00064 if (obj == null) return false;
00065
00066 if (obj instanceof A3CMLNat) {
00067 A3CMLNat nat = (A3CMLNat) obj;
00068 if ((sid == nat.sid) &&
00069 ((host == nat.host) ||
00070 ((host != null) && host.equals(nat.host))) &&
00071 (port == nat.port))
00072 return true;
00073 }
00074 return false;
00075 }
00076 }