public final class Communication
extends java.lang.Object
Constructor and Description |
---|
Communication() |
Modifier and Type | Method and Description |
---|---|
static boolean |
sendGET(Client client,
Server server,
java.lang.String order)
sendGET: This method send a GET request with the order to the server specified.
|
static Response |
sendGET(Client client,
java.lang.String urlAddress)
sendGET: This method send a GET request to the url specified.
|
static Response |
sendPOST(Client client,
java.lang.String urlAddress,
Request objRequest)
sendPOST: This method send through POST, a Request object to server specified by URL
|
static Response |
sendPOST(Client client,
java.lang.String strServer,
java.lang.String strCommand,
java.lang.String strParameter)
sendPOST: This method send a POST request with the command + parameters to the server specified.
|
static boolean |
testOnline(Client client,
int i)
testOnLine: Test if server number "i" are online.
|
static boolean |
testOnline(Client client,
Server server)
testOnLine: Check if the server specified are online
|
static void |
waitForAllServersOnline(Client client)
waitForAllServersOnline: wait for all servers go online.
|
public static Response sendGET(Client client, java.lang.String urlAddress)
client
- Object client with all the information.urlAddress
- String with url: http://address/resourcepublic static boolean sendGET(Client client, Server server, java.lang.String order)
client
- Object client with all the infoserver
- Destination serverorder
- Message to sendpublic static Response sendPOST(Client client, java.lang.String strServer, java.lang.String strCommand, java.lang.String strParameter)
client
- Object client with all the infostrServer
- Name of the destination serverstrCommand
- Command to send to the serverstrParameter
- Parameters to send to the serverpublic static Response sendPOST(Client client, java.lang.String urlAddress, Request objRequest)
client
- Object client with all the infourlAddress
- URL Address of the serverobjRequest
- Object with the request.public static boolean testOnline(Client client, int i)
client
- Client with all the information.i
- Number of server to testpublic static boolean testOnline(Client client, Server server)
client
- Client with all the information.server
- Server to testpublic static void waitForAllServersOnline(Client client)
client
- client with all the info.