|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.system.communication.net.CommunicationAddress
public class CommunicationAddress
Field Summary | |
---|---|
java.net.InetAddress |
externalAddress
The address of the host that is a public external IP. |
java.net.InetAddress |
host
|
(package private) static org.apache.log4j.Logger |
logger
|
int |
port
|
private static long |
serialVersionUID
|
private static java.lang.String |
TO_STRING_PREFIX
|
Constructor Summary | |
---|---|
CommunicationAddress()
|
|
CommunicationAddress(CommunicationAddress address)
|
|
CommunicationAddress(java.net.InetAddress host,
int port)
|
|
CommunicationAddress(java.net.InetAddress localAddress,
int port,
java.net.InetAddress extAddress)
|
|
CommunicationAddress(java.lang.String host,
int port)
|
Method Summary | |
---|---|
boolean |
equals(CommunicationAddress other)
|
boolean |
equals(java.lang.Object arg0)
|
java.lang.String |
getAdd()
|
CommunicationAddress |
getExternalAddress()
Composes an instance of CommunicationAddress that points to the external address of an xosd machine. |
static CommunicationAddress |
getFromHostPort(java.lang.String hostport)
Parse the address from a string. |
java.net.InetAddress |
getHost()
|
int |
getPort()
|
java.lang.String |
getStringHost()
|
int |
hashCode()
|
static boolean |
isMyAddress(java.net.InetAddress addressToCheck)
Check whether the given address is an address used by one of the local network interfaces. |
boolean |
isSame(CommunicationAddress address)
Checks whether the two CommunicationAddress instances point to the same address. |
protected boolean |
isSameHostPort(CommunicationAddress address)
Check the equality of the port numbers and the host IPs. |
boolean |
isSameLAN(CommunicationAddress arg0)
Checks whether the two communication addresses share the same LAN. |
static java.net.InetAddress |
localNetAddress()
A helper class that polls the local network interfaces and selects the IPv4 address used by one of the interfaces. |
static java.net.InetAddress |
localNetAddress(java.lang.String interfaceName)
A helper class that polls the network interface with the given name, and returns its IPv4 address. |
static CommunicationAddress |
parse(java.lang.String text)
Convert a String formatted as the communication address. |
void |
setHost(java.net.InetAddress host)
|
void |
setPort(int port)
|
void |
setStringHost(java.lang.String stringHost)
|
java.lang.String |
toString()
|
java.lang.String |
toWholeAddress()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final java.lang.String TO_STRING_PREFIX
static org.apache.log4j.Logger logger
public java.net.InetAddress externalAddress
public java.net.InetAddress host
public int port
Constructor Detail |
---|
public CommunicationAddress()
public CommunicationAddress(java.lang.String host, int port) throws java.net.UnknownHostException
java.net.UnknownHostException
public CommunicationAddress(java.net.InetAddress host, int port)
public CommunicationAddress(java.net.InetAddress localAddress, int port, java.net.InetAddress extAddress)
public CommunicationAddress(CommunicationAddress address)
Method Detail |
---|
public boolean equals(CommunicationAddress other)
public java.lang.String getAdd()
public static CommunicationAddress getFromHostPort(java.lang.String hostport)
hostport
- The string formatted as the CommunicationAddress.
public boolean isSame(CommunicationAddress address)
address
- The argument to check the equality with.
protected boolean isSameHostPort(CommunicationAddress address)
address
-
public java.net.InetAddress getHost()
public void setHost(java.net.InetAddress host)
host
- the host to setpublic int getPort()
public void setPort(int port)
port
- the port to setpublic java.lang.String toWholeAddress()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.net.InetAddress localNetAddress()
public static java.net.InetAddress localNetAddress(java.lang.String interfaceName)
interfaceName
- The name of the network interface we would like the
address off.
public static boolean isMyAddress(java.net.InetAddress addressToCheck)
addressToCheck
- The address we would like to check.
public CommunicationAddress getExternalAddress()
public boolean isSameLAN(CommunicationAddress arg0)
public java.lang.String getStringHost()
public void setStringHost(java.lang.String stringHost)
public static CommunicationAddress parse(java.lang.String text) throws java.lang.Exception
text
- The formatted string input.
java.lang.Exception
- When the string is badly formed.public boolean equals(java.lang.Object arg0)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |