public class RestClient extends Object
| Constructor and Description |
|---|
RestClient() |
RestClient(String endPoint,
String userName,
String password) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEntity(String filePath,
String resourcePath,
String entityName) |
boolean |
deployEntity(String resourcePath,
String entityName) |
HttpResponse |
doDelete(URI resourcePath) |
HttpResponse |
doGet(URI resourcePath)
Handle http get request.
|
HttpResponse |
doPost(URI resourcePath,
String jsonParamString)
Handle http post request.
|
HttpResponse |
doPut(URI resourcePath,
String jsonParamString) |
Object |
getEntity(String resourcePath,
String identifier,
Class responseJsonClass,
String entityName) |
String |
getJsonStringFromFile(String filePath)
Get the json string from the artifacts directory
|
Object |
listEntity(String resourcePath,
Type type,
String entityName) |
boolean |
removeEntity(String resourcePath,
String identifier,
String entityName) |
boolean |
undeployEntity(String resourcePath,
String entityName) |
boolean |
updateEntity(String filePath,
String resourcePath,
String entityName) |
public HttpResponse doPost(URI resourcePath, String jsonParamString) throws Exception
resourcePath - This should be REST endpointjsonParamString - The json string which should be executed from the post requestException - if any errors occur when executing the requestpublic HttpResponse doGet(URI resourcePath) throws Exception
resourcePath - This should be REST endpointorg.apache.http.client.ClientProtocolException - and IOException
if any errors occur when executing the requestExceptionpublic HttpResponse doDelete(URI resourcePath) throws Exception
Exceptionpublic HttpResponse doPut(URI resourcePath, String jsonParamString) throws Exception
Exceptionpublic Object getEntity(String resourcePath, String identifier, Class responseJsonClass, String entityName)
public boolean removeEntity(String resourcePath, String identifier, String entityName) throws Exception
Exceptionpublic String getJsonStringFromFile(String filePath) throws FileNotFoundException
filePath - path of the artifactsFileNotFoundExceptionCopyright © 2012–2015 WSO2 Inc. All rights reserved.