public class SonarDBClient extends Object
| Modifier and Type | Field and Description |
|---|---|
Connection |
connection |
| Constructor and Description |
|---|
SonarDBClient(String url,
String dbName,
String user,
String password) |
| Modifier and Type | Method and Description |
|---|---|
Integer |
addGlobalPermission(User user,
GlobalRoles role) |
Integer |
addProjectPermission(User user,
Project project,
ProjectRoles role) |
Integer |
createUser(String name,
String lastname,
String email) |
ResultSet |
executeQuery(String query) |
Integer |
executeUpdate(String query) |
ResultSet |
getProjectPermission(User user,
Project project,
ProjectRoles role) |
List<Project> |
getProjects() |
List<Project> |
getProjects(Project project) |
List<Project> |
getProjectsByGroupAndArtifact(String groupAndArtifact)
Retieves a Project list by providing its group and artifact id.
|
String |
getSonarUserName(String name,
String lastname) |
List<User> |
getUser(String email) |
List<User> |
getUsers() |
List<User> |
getUsers(User user) |
boolean |
ping() |
boolean |
userHasProjectPermission(User user,
Project project,
ProjectRoles role) |
public Connection connection
public SonarDBClient(String url, String dbName, String user, String password) throws SQLException
SQLExceptionpublic boolean ping()
throws SQLException
SQLExceptionpublic List<User> getUsers() throws SQLException
SQLExceptionpublic List<User> getUsers(User user) throws SQLException
SQLExceptionpublic List<User> getUser(String email) throws SQLException
SQLExceptionpublic List<Project> getProjects() throws SQLException
SQLExceptionpublic List<Project> getProjects(Project project) throws SQLException
SQLExceptionpublic List<Project> getProjectsByGroupAndArtifact(String groupAndArtifact) throws SQLException
groupAndArtifact - a String containing the group and artifact id separated by a colon such as "org.mule.tools.ci.automation:sonar-permissions-tools".SQLException - on a server error.public Integer createUser(String name, String lastname, String email) throws SQLException
SQLExceptionpublic Integer addGlobalPermission(User user, GlobalRoles role) throws SQLException
SQLExceptionpublic Integer addProjectPermission(User user, Project project, ProjectRoles role) throws SQLException
SQLExceptionpublic ResultSet getProjectPermission(User user, Project project, ProjectRoles role) throws SQLException
SQLExceptionpublic boolean userHasProjectPermission(User user, Project project, ProjectRoles role) throws SQLException
SQLExceptionpublic ResultSet executeQuery(String query) throws SQLException
SQLExceptionpublic Integer executeUpdate(String query) throws SQLException
SQLExceptionCopyright © 2017. All rights reserved.