|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritQueryHandler
public class GerritQueryHandler
This class helps you call gerrit query to search for patch-sets.
| Field Summary | |
|---|---|
static String |
QUERY_COMMAND
The base of the query ssh command to send to Gerrit. |
| Constructor Summary | |
|---|---|
GerritQueryHandler(GerritConnectionConfig config)
Creates a GerritQueryHandler with the specified config. |
|
GerritQueryHandler(String gerritHostName,
int gerritSshPort,
Authentication authentication)
Creates a GerritQueryHandler with the specified values. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String QUERY_COMMAND
| Constructor Detail |
|---|
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.| Method Detail |
|---|
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||