3 import java.net.Socket;
\r
4 import java.net.ServerSocket;
\r
5 import java.net.InetAddress;
\r
6 import java.net.UnknownHostException;
\r
8 /** Class IoTAddress is a wrapper class to pass
\r
9 * IoTSet of any addresses from master to slave
\r
11 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
\r
15 public class IoTAddress {
\r
18 * IoTDeviceAddress class properties
\r
20 protected final InetAddress inetAddress;
\r
25 * @param sAddress String address
\r
27 public IoTAddress(String sAddress) throws UnknownHostException {
\r
29 inetAddress = InetAddress.getByName(sAddress);
\r
33 * getHostAddress() method
\r
37 public String getHostAddress() {
\r
39 return inetAddress.getHostAddress();
\r
44 * getHostName() method
\r
48 public String getHostName() {
\r
50 return inetAddress.getHostName();
\r
59 public String getURL(String strURLComplete) {
\r
61 //e.g. http:// + inetAddress.getHostAddress() + strURLComplete
\r
62 // http://192.168.2.254/cgi-bin/mjpg/video.cgi?
\r
63 return "http://" + inetAddress.getHostAddress() + strURLComplete;
\r
68 * getCompleteAddress() method
\r
72 public String getCompleteAddress() {
\r
74 return inetAddress.toString();
\r