Package com.vmware.vipclient.i18n.base
Class HttpRequester
- java.lang.Object
-
- com.vmware.vipclient.i18n.base.HttpRequester
-
public class HttpRequester extends Object
This class provides methods of requesting a remote server.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpRequester(String vIPServer)get the baseURL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBaseURL()booleanisConnected()protected static booleanping(String ipAddress)Check that the server of the vIP is available.Map<String,Object>request(String url, String method, Object requestData)Send an HTTP request.Map<String,Object>request(String url, String method, Object requestData, Map<String,String> customizedHeaderParams)Send an HTTP request.voidsetBaseURL(String baseURL)voidsetCustomizedHeaderParams(Map<String,String> params)
-
-
-
Constructor Detail
-
HttpRequester
protected HttpRequester(String vIPServer) throws Exception
get the baseURL- Parameters:
vIPServer- The host address of the vIP Server- Throws:
MalformedURLExceptionException
-
-
Method Detail
-
setBaseURL
public void setBaseURL(String baseURL)
-
ping
protected static boolean ping(String ipAddress)
Check that the server of the vIP is available.- Parameters:
ipAddress- the ip address or domain.- Returns:
-
request
public Map<String,Object> request(String url, String method, Object requestData)
Send an HTTP request.- Parameters:
url- The remote server urlmethod- HTTP methodrequestData- HTTP URL parameters- Returns:
- Map
response
-
request
public Map<String,Object> request(String url, String method, Object requestData, Map<String,String> customizedHeaderParams)
Send an HTTP request.- Parameters:
url- The remote server urlmethod- HTTP methodrequestData- HTTP URL parameterscustomizedHeaderParams- customized HTTP request header for this request- Returns:
- Map
response
-
getBaseURL
public String getBaseURL()
-
isConnected
public boolean isConnected()
-
-