public class Client extends Server
Constructor and Description |
---|
Client()
Client(): constructor for class Client.
|
Modifier and Type | Method and Description |
---|---|
void |
addServer(Server server)
addServer: add a server to the array list of servers.
|
void |
addTempExt(double tempExt)
addTempExterior: add a value to the exterior temperature sum
|
void |
addTempSolar(double tempSolar)
addTempSolar: add a value to the solar temperature sum.
|
Automatic |
getAutomatic()
getAutomatic: return the automatic object with all the rules
|
int |
getConfigNumErrorsBeforeEmail()
getNumErrorsBeforeEmail: return the number of errors that the system must count before sending a warning email.
|
double |
getConfigOptimalTemp()
getConfigOptimalTemp: get the optimal temperature for the system.
|
int |
getConfigRetries()
getRetries: get the number of configRetries to try send the messages.
|
int |
getConfigTemperatureCounter()
getTemperatureCounter: get the number of temperatures to obtain the average of temperatures.
|
int |
getConfigTimeOnlineWait()
getTimeOnlineWait: get the time for wait between connections when a server is offline.
|
int |
getConfigTimeoutConnectValue()
getTimeoutConnectValue: get the time to wait connection before timeout error.
|
int |
getConfigTimeoutReadValue()
getTimeoutReadValue: get the time for wait a response before timeout error.
|
int |
getConfigTimeWait()
getTimeWait: get the time for wait between connections.
|
int |
getCountErrors()
getCountErrors: return the number of counting errors trying connecting with servers.
|
int |
getCountTemp()
getCountTemp: return the number of temperatures counted
|
java.util.ArrayList<Server> |
getListServers()
getListServers: return the list of servers in the network.
|
int |
getNumServers()
genNumServers: return the number of servers in the network.
|
int |
getNumServersOnline()
getNumServersOnline: return the number of servers that are online.
|
boolean |
getSendEmailOnError()
getSendEmailOnError: return if we want send a email on error case.
|
Server |
getServer(int pos)
getServer: return the server in the specified position
|
Server |
getServer(java.lang.String serverName)
getServer: return the server whit the specified name
|
int |
getServerPos(java.lang.String serverName)
getServerPos: return the position in the array list of servers, of server whit the specified name.
|
Status |
getStatus()
getStatus: return the current status
|
double |
getSumTempExt()
getSumTempExt: get the sum of the exterior temperature
|
double |
getSumTempSolar()
getSumTempSolar: return the sum of solar temperatures.
|
void |
incCountErrors()
incCountErrors: increment the number of errors.
|
void |
incCountTemp()
incCountTemp: increments the counter
|
void |
initStatus()
initStatus: This class set the initial status of the client
|
void |
setAutomatic(Automatic automatic)
setAutomatic: set the automatic object with all the rules
|
void |
setConfigNumErrorsBeforeEmail(int configNumErrorsBeforeEmail)
setNumErrorsBeforeEmail: set the number of errors that the system must count before sending a warning email.
|
void |
setConfigOptimalTemp(double configOptimalTemp)
setConfigOptimalTemp: set the optimal temperature for the system.
|
void |
setConfigRetries(int configRetries) |
void |
setConfigSendEmailOnError(boolean configSendEmailOnError)
setSendEmailOnError: set if we want send a email on error case.
|
void |
setConfigTemperatureCounter(int configTemperatureCounter)
setTemperatureCounter: set the number of temperatures to obtain the average of temperatures.
|
void |
setConfigTimeOnlineWait(int configTimeOnlineWait)
setTimeOnlineWait: set the time for wait between connections when a server is offline.
|
void |
setConfigTimeoutConnectValue(int configTimeoutConnectValue)
setTimeoutConnectValue: get the time to wait connection before timeout error.
|
void |
setConfigTimeoutReadValue(int configTimeoutReadValue)
setTimeoutReadValue: set the time for wait a response before timeout error.
|
void |
setConfigTimeWait(int configTimeWait)
setTimeWait: set the time for wait between connections.
|
void |
setCountErrors(int countErrors)
setCountErrors: set the number of errors.
|
void |
setCountTemp(int count)
setCountTemp: set the counter to a value
|
void |
setListServers(java.util.ArrayList<Server> listServers)
setListServers: set the array list with the servers in the network.
|
void |
setNumServers(int numServers)
setNumServers: Set the number of servers in the network.
|
void |
setStatus(Status status)
setStatus: set the status
|
void |
setSumTempExt(double sTempExt)
setSumTempExt: set the sum of the exterior temperature to a specified value
|
void |
setSumTempSolar(double sTempSolar)
setSumTempSolar: set the sum of solar temperatures to a value.
|
java.lang.String |
toString()
toString: return the string with the client information
|
void |
updateServer(Server server,
int pos)
updateServer: This method update the data of devices connected to a RPi.
|
addDevice, getDevice, getDevice, getIdentifier, getIpAddress, getLastCommand, getLastConnDate, getLastResponse, getListDevices, getNumDevices, getOnline, getPort, setIdentifier, setIpAddress, setLastCommand, setLastConnDate, setLastConnDate, setLastResponse, setOnline, setPort, updateDevice
public void initStatus()
public int getNumServers()
public void setNumServers(int numServers)
numServers
- the numServers to setpublic java.util.ArrayList<Server> getListServers()
public void setListServers(java.util.ArrayList<Server> listServers)
listServers
- the listServers to setpublic void addServer(Server server)
server
- server object to addpublic void updateServer(Server server, int pos)
server
- server object to updatepos
- position in the listpublic Server getServer(int pos)
pos
- position in the list of serverspublic Server getServer(java.lang.String serverName)
serverName
- name of the server to locate.public int getServerPos(java.lang.String serverName)
serverName
- name of the server to searchpublic int getNumServersOnline()
public int getCountErrors()
public void setCountErrors(int countErrors)
countErrors
- the countErrors to set.public void incCountErrors()
public Status getStatus()
public void setStatus(Status status)
status
- the status to setpublic Automatic getAutomatic()
public void setAutomatic(Automatic automatic)
automatic
- the automatic to setpublic int getCountTemp()
public void setCountTemp(int count)
count
- value to set the counter of temperatures.public void incCountTemp()
public double getSumTempSolar()
public void setSumTempSolar(double sTempSolar)
sTempSolar
- Value of sum of temperatures to set.public void addTempSolar(double tempSolar)
tempSolar
- value of temperature to set.public double getSumTempExt()
public void setSumTempExt(double sTempExt)
sTempExt
- value to setpublic void addTempExt(double tempExt)
tempExt
- temperature to addpublic int getConfigNumErrorsBeforeEmail()
public void setConfigNumErrorsBeforeEmail(int configNumErrorsBeforeEmail)
configNumErrorsBeforeEmail
- the configNumErrorsBeforeEmail to setpublic boolean getSendEmailOnError()
public void setConfigSendEmailOnError(boolean configSendEmailOnError)
configSendEmailOnError
- the configSendEmailOnError to setpublic int getConfigTemperatureCounter()
public void setConfigTemperatureCounter(int configTemperatureCounter)
configTemperatureCounter
- the configTemperatureCounter to setpublic int getConfigTimeoutConnectValue()
public void setConfigTimeoutConnectValue(int configTimeoutConnectValue)
configTimeoutConnectValue
- the configTimeoutConnectValue to setpublic int getConfigTimeoutReadValue()
public void setConfigTimeoutReadValue(int configTimeoutReadValue)
configTimeoutReadValue
- the configTimeoutReadValue to setpublic int getConfigTimeWait()
public void setConfigTimeWait(int configTimeWait)
configTimeWait
- the configTimeWait to setpublic int getConfigTimeOnlineWait()
public void setConfigTimeOnlineWait(int configTimeOnlineWait)
configTimeOnlineWait
- the configTimeOnlineWait to setpublic double getConfigOptimalTemp()
public void setConfigOptimalTemp(double configOptimalTemp)
configOptimalTemp
- the configOptimalTemp to setpublic int getConfigRetries()
public void setConfigRetries(int configRetries)
configRetries
- the configRetries to set