public final class Processing
extends java.lang.Object
Constructor and Description |
---|
Processing() |
Modifier and Type | Method and Description |
---|---|
static boolean |
applyManualMode(Client client,
java.util.ArrayList<ManualOrder> listOrders,
java.sql.Connection sqlConnection)
applyManualMode: Execute the orders specified in manual configuration file.
|
static Constants.WORKING_MODE |
detectMode(java.sql.Connection sqlConnection)
detectMode: This method detect the working mode, depending if exist some
manual instruction in the database.
|
static void |
determineAction(Client client)
determineAction: this method determine the action to execute according to the state.
|
static void |
doAutomaticMode(Client client)
doAutomaticMode: This method do all work to process automatically.
|
static boolean |
doManualMode(Client client,
java.sql.Connection sqlConnection)
doManualMode: Prepare the list with the orders indicated in the database.
|
static void |
execCommandLinux(java.lang.String command)
execCommandLinux: This method execute a linux command passed as parameter.
|
static Client |
getClientConfig(Client client)
getClientConfig Read the configuration file and update the client.
|
static Client |
initServers(Client client)
initServers: this method create the server objects, making a array of n Server with IP address,
etc..
|
static Automatic |
readAutomaticConfig(Client client)
readAutomaticConfig: read the file with the automatic configuration.
|
static java.util.ArrayList<ManualOrder> |
readManualConfig(Client client,
java.sql.Connection sqlConnection)
readManualConfig: Read the manual configuration from the database.
|
static void |
shutdown(java.lang.String opt)
shutdown: This method decide who command to execute: sudo shutdown or
sudo reboot, calling to execCommandLinunx whit the correct command.
|
static void |
updateStatusInServers(Client client)
updateStatusInServers: this method updates the current status in the servers.
|
public static Constants.WORKING_MODE detectMode(java.sql.Connection sqlConnection)
sqlConnection
- Connection with the database.public static java.util.ArrayList<ManualOrder> readManualConfig(Client client, java.sql.Connection sqlConnection)
client
- Object client with all the info.sqlConnection
- Connection with the database.public static void doAutomaticMode(Client client)
client
- Object client with all the info.public static void determineAction(Client client)
client
- Object client with all the info.public static boolean doManualMode(Client client, java.sql.Connection sqlConnection)
client
- Object client with all the info.sqlConnection
- Connection with the database.public static boolean applyManualMode(Client client, java.util.ArrayList<ManualOrder> listOrders, java.sql.Connection sqlConnection)
client
- Object client with all the info.listOrders
- ArrayList with all manuals orders to be processed.sqlConnection
- Connection with the database.public static Client initServers(Client client)
client
- Object client with all the info.public static Automatic readAutomaticConfig(Client client)
client
- Object client with all the info.public static Client getClientConfig(Client client)
client
- Object Client with all the info.public static void updateStatusInServers(Client client)
client
- Object client with all info about system.public static void shutdown(java.lang.String opt)
opt
- String with the option to execute.public static void execCommandLinux(java.lang.String command)
command
- String with the command to execute.