public class GerritQueryHandler extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
QUERY_COMMAND
The base of the query ssh command to send to Gerrit.
|
| Constructor and Description |
|---|
GerritQueryHandler(GerritConnectionConfig config)
Creates a GerritQueryHandler with the specified config.
|
GerritQueryHandler(String gerritHostName,
int gerritSshPort,
Authentication authentication)
Creates a GerritQueryHandler with the specified values.
|
| Modifier and Type | Method and Description |
|---|---|
List<net.sf.json.JSONObject> |
queryFiles(String queryString)
Runs the query and returns the result as a list of Java JSONObjects.
|
List<net.sf.json.JSONObject> |
queryJava(String queryString)
Runs the query and returns the result as a list of Java JSONObjects.
|
List<net.sf.json.JSONObject> |
queryJava(String queryString,
boolean getPatchSets,
boolean getCurrentPatchSet,
boolean getFiles)
Runs the query and returns the result as a list of Java JSONObjects.
|
List<String> |
queryJson(String queryString)
Runs the query and returns the result as a list of JSON formatted strings.
|
List<String> |
queryJson(String queryString,
boolean getPatchSets,
boolean getCurrentPatchSet,
boolean getFiles)
Runs the query and returns the result as a list of JSON formatted strings.
|
public static final String QUERY_COMMAND
public GerritQueryHandler(String gerritHostName, int gerritSshPort, Authentication authentication)
gerritHostName - the hostNamegerritSshPort - the ssh port that the gerrit server listens to.authentication - the authentication credentials.public GerritQueryHandler(GerritConnectionConfig config)
config - the config.public List<net.sf.json.JSONObject> queryJava(String queryString) throws SshException, IOException, GerritQueryException
queryString - the query.GerritQueryException - if Gerrit reports an error with the query.SshException - if there is an error in the SSH Connection.IOException - for some other IO problem.public List<net.sf.json.JSONObject> queryJava(String queryString, boolean getPatchSets, boolean getCurrentPatchSet, boolean getFiles) throws SshException, IOException, GerritQueryException
queryString - the query.getPatchSets - getPatchSets if all patch-sets of the projects found should be included in the result.
Meaning if --patch-sets should be appended to the command call.getCurrentPatchSet - if the current patch-set for the projects found should be included in the result.
Meaning if --current-patch-set should be appended to the command call.GerritQueryException - if Gerrit reports an error with the query.SshException - if there is an error in the SSH Connection.IOException - for some other IO problem.public List<net.sf.json.JSONObject> queryFiles(String queryString) throws SshException, IOException, GerritQueryException
queryString - the query.GerritQueryException - if Gerrit reports an error with the query.SshException - if there is an error in the SSH Connection.IOException - for some other IO problem.public List<String> queryJson(String queryString) throws SshException, IOException
queryString - the query.SshException - if there is an error in the SSH Connection.IOException - for some other IO problem.public List<String> queryJson(String queryString, boolean getPatchSets, boolean getCurrentPatchSet, boolean getFiles) throws SshException, IOException
queryString - the query.getPatchSets - if all patch-sets of the projects found should be included in the result.
Meaning if --patch-sets should be appended to the command call.getCurrentPatchSet - if the current patch-set for the projects found should be included in the result.
Meaning if --current-patch-set should be appended to the command call.getFiles - if the files of the patch sets should be included in the result.
Meaning if --files should be appended to the command call.SshException - if there is an error in the SSH Connection.IOException - for some other IO problem.Copyright © 2004-2015 Hudson. All Rights Reserved.