public class DeviceController
extends java.lang.Object
Constructor and Description |
---|
DeviceController(java.lang.String hostname,
java.lang.String address,
int port,
int device_id,
int connectPort,
int filePort)
Create a controller based on ip address and port it wants to receive messages on
|
Modifier and Type | Method and Description |
---|---|
static int |
buildHashCode(java.lang.String address,
int port,
int connectPort,
int filePort)
Create a hash code we can use to compare that we are equal
|
void |
controllerSeen()
Set the last time controller seen as now
|
java.net.InetSocketAddress |
getAddress()
The socket address we use to send messages t this controller
|
static UDPCachedMessage |
getCachedMessage()
Get the cached message we are going to send
|
java.lang.String |
getHostname()
The hostname of the controller
|
int |
hashCode()
Has code based on i[ address and port
|
static void |
setDeviceId(int new_id)
Sets the new device ID and rebuilds cached message for it if required
|
void |
setHostname(java.lang.String hostname) |
public DeviceController(java.lang.String hostname, java.lang.String address, int port, int device_id, int connectPort, int filePort)
hostname
- hostname provided by controlleraddress
- ip address that we send messages to this controllerport
- the port we send messages ondevice_id
- the device id we were when were madeconnectPort
- the Port we need to connect to TCP serverfilePort
- the port we receive non-class files onpublic void controllerSeen()
public static UDPCachedMessage getCachedMessage()
public static int buildHashCode(java.lang.String address, int port, int connectPort, int filePort)
address
- ip address of controllerport
- port the controller UDP portconnectPort
- the Port we need to connect to TCP serverfilePort
- the port we receive non class files onpublic static void setDeviceId(int new_id)
new_id
- the new IDpublic int hashCode()
hashCode
in class java.lang.Object
public java.net.InetSocketAddress getAddress()
public java.lang.String getHostname()
public void setHostname(java.lang.String hostname)