1 7 8 package com.sun.corba.se.impl.legacy.connection; 9 10 import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; 11 import com.sun.corba.se.spi.transport.SocketInfo; 12 13 public class EndPointInfoImpl 14 implements 15 SocketInfo, 16 LegacyServerSocketEndPointInfo 17 { 18 19 protected String type; 20 protected String hostname; 21 protected int port; 22 protected int locatorPort; 23 protected String name; 24 25 public EndPointInfoImpl(String type, int port, String hostname) { 26 this.type = type; 27 this.port = port; 28 this.hostname = hostname; 29 this.locatorPort = -1; 30 this.name = LegacyServerSocketEndPointInfo.NO_NAME; 31 } 32 33 public String getType() { 34 return type; 35 } 36 37 public String getHost() { 38 return hostname; 39 } 40 41 public String getHostName() { 42 return hostname; 43 } 44 45 public int getPort() { 46 return port; 47 } 48 49 public int getLocatorPort () 50 { 51 return locatorPort; 52 } 53 54 public void setLocatorPort (int port) 55 { 56 locatorPort = port; 57 } 58 59 public String getName() 60 { 61 return name; 62 } 63 64 public int hashCode() { 65 return type.hashCode() ^ hostname.hashCode() ^ port; 66 } 67 68 public boolean equals(Object obj) { 69 if (!(obj instanceof EndPointInfoImpl)) { 70 return false; 71 } 72 EndPointInfoImpl other = (EndPointInfoImpl)obj; 73 if (type == null) { 74 if (other.type != null) { 75 return false; 76 } 77 } else if (!type.equals(other.type)) { 78 return false; 79 } 80 if (port != other.port) { 81 return false; 82 } 83 if (!hostname.equals(other.hostname)) { 84 return false; 85 } 86 return true; 87 } 88 89 public String toString () 90 { 91 return 92 type + " " + 93 name + " " + 94 hostname + " " + 95 port; 96 } 97 } 98 99 | Popular Tags |