public class SonarClient extends Object
SonarClient client = SonarClient.create("http://localhost:9000"); IssueClient issueClient = client.issueClient();
Modifier and Type | Class and Description |
---|---|
static class |
SonarClient.Builder |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECT_TIMEOUT_MILLISECONDS |
static int |
DEFAULT_READ_TIMEOUT_MILLISECONDS |
Modifier and Type | Method and Description |
---|---|
ActionPlanClient |
actionPlanClient()
New client to interact with web services related to issue action plans
|
static SonarClient.Builder |
builder()
Create a builder of
SonarClient s. |
static SonarClient |
create(String serverUrl)
Create a client with default configuration.
|
String |
get(String relativeUrl,
Map<String,Object> params)
Send a GET request on the given relativeUrl, with provided parameters (can be empty).
|
String |
get(String relativeUrl,
Object... params)
Same as
get(String, java.util.Map) but parameters are defined as an array
of even number of elements (key1, value1, key, value2, ...). |
IssueClient |
issueClient()
New client to interact with web services related to issues
|
PermissionClient |
permissionClient()
New client to interact with web services related to users and groups permissions
|
String |
post(String relativeUrl,
Map<String,Object> params)
Send a POST request on the given relativeUrl, with provided parameters (can be empty).
|
String |
post(String relativeUrl,
Object... params)
Same as
post(String, java.util.Map) but parameters are defined as an array
of even number of elements (key1, value1, key, value2, ...). |
ProjectClient |
projectClient()
New client to interact with web services related to projects
|
QProfileClient |
qProfileClient()
New client to interact with web services related to quality profiles
|
QualityGateClient |
qualityGateClient()
New client to interact with web services related to quality gates
|
SystemClient |
systemClient() |
UserClient |
userClient()
New client to interact with web services related to users
|
public static final int DEFAULT_CONNECT_TIMEOUT_MILLISECONDS
public static final int DEFAULT_READ_TIMEOUT_MILLISECONDS
public IssueClient issueClient()
public ActionPlanClient actionPlanClient()
public UserClient userClient()
public PermissionClient permissionClient()
public ProjectClient projectClient()
public QualityGateClient qualityGateClient()
public QProfileClient qProfileClient()
public SystemClient systemClient()
public static SonarClient.Builder builder()
SonarClient
s.public static SonarClient create(String serverUrl)
builder()
to define
a custom configuration (credentials, HTTP proxy, HTTP timeouts).public String post(String relativeUrl, Map<String,Object> params)
Map<String,Object> params = new HashMap<>();
params.put("name", "My Quality Gate");
client.post("api/qualitygates/create", params);
public String post(String relativeUrl, Object... params)
post(String, java.util.Map)
but parameters are defined as an array
of even number of elements (key1, value1, key, value2, ...). Keys must not be null.public String get(String relativeUrl, Map<String,Object> params)
public String get(String relativeUrl, Object... params)
get(String, java.util.Map)
but parameters are defined as an array
of even number of elements (key1, value1, key, value2, ...). Keys must not be null.Copyright © 2009–2015 SonarSource. All rights reserved.