[
http://issues.apache.org/jira/browse/DIRMINA-147?page=comments#action_12360807
]
Donald_liu commented on DIRMINA-147:
------------------------------------
My URI inferface is a empty inteface,just for extend for future,it like this:
public interface URI {
}
and the implement for ipv4
public class SessionURI implements URI {
private String ip;
private int port;
public SessionURI(String ip, int port)
{
this.ip = ip;
this.port = port;
}
public int getPort()
{
return port;
}
public String getIp()
{
return ip;
}
public boolean equals(Object o)
{
if (o == null)
return false;
if (o == this)
return true;
if (!(o instanceof SessionURI))
return false;
SessionURI another = (SessionURI) o;
return another.getIp().equals(ip) && another.getPort() == port;
}
public int hashCode()
{
int result = 17;
result = 37 * result + ip.hashCode();
result = 37 * result + port;
return result;
}
public String toString()
{
return ip + ":" + port;
}
}
I think it's too simple,WDYT?
> Use URI instead of SocketAddress
> --------------------------------
>
> Key: DIRMINA-147
> URL: http://issues.apache.org/jira/browse/DIRMINA-147
> Project: Directory MINA
> Type: Improvement
> Versions: 0.9
> Reporter: Trustin Lee
> Priority: Minor
> Fix For: 0.9.1
>
> We're using SocketAddress to point the address of remote (or local) peers,
> but it would be great if we can have a standardized mean to express the
> address. We're emulating SocketAddress in case of VM pipe, but it would be
> much better if we adopt higher-level concept; URI.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira