public class RestConnection extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FAILURE |
static int |
NO_AUTH |
static int |
SUCCESS |
Constructor and Description |
---|
RestConnection(String restUri,
String token) |
Modifier and Type | Method and Description |
---|---|
boolean |
createReport(String applicationName,
String reportConfigName,
String reportName) |
int |
estimateApplication(String name,
String rootPath,
String artifactPath,
String language,
boolean estimate) |
org.json.JSONObject |
fromInputStream(InputStream inputStream)
Reads the incoming bytes of an
InputStream
and attempts to build a JSONObject . |
ApplicationStats |
getApplicationStatistics(String name) |
EstimateSummary |
getLastEstimateSummary(Long appId) |
org.json.JSONObject |
getReportConfigs()
Gets a list of report configuration names from a REST end point.
|
static boolean |
validateRestUri(String restUri) |
static boolean |
validateToken(String token) |
public static final int SUCCESS
public static final int FAILURE
public static final int NO_AUTH
public int estimateApplication(String name, String rootPath, String artifactPath, String language, boolean estimate)
public ApplicationStats getApplicationStatistics(String name)
public EstimateSummary getLastEstimateSummary(Long appId)
public boolean createReport(String applicationName, String reportConfigName, String reportName)
public static boolean validateRestUri(String restUri)
public static boolean validateToken(String token)
public org.json.JSONObject fromInputStream(InputStream inputStream) throws IOException, org.json.JSONException
InputStream
and attempts to build a JSONObject
.inputStream
- The input stream to read the object from.JSONObject
; or null
.NullPointerException
- when the input is null
.IOException
- when the input stream cannot be read.org.json.JSONException
- when the stream contents are malformed.public org.json.JSONObject getReportConfigs() throws IOException, org.json.JSONException
GET /restapi/reportconfig/
.JSONObject
; or null
.IOException
- when the entity input stream cannot be read.org.json.JSONException
- when the entity input stream contents are malformed.Copyright © 2004-2015. All Rights Reserved.