|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.ci.comm.command.AbstractCommand<T> de.smartics.ci.comm.command.AbstractJobCommand<T> de.smartics.ci.comm.command.AbstractGenericJobCommand<T> de.smartics.ci.comm.hudson.command.AbstractHudsonApiJob<T>
T
- the concrete type of the command.
public abstract class AbstractHudsonApiJob<T extends Command<T>>
This abstract class contains the functionality to handle jobs calling an api. It handles the replacement of variables in the api call and handles methods to handle the response.
Field Summary | |
---|---|
protected CommandResult<T> |
commandResult The result of this command. |
protected Properties |
properties Key value pairs / properties used to replace variables (the keys) in the xml query string with the values. |
protected String |
xmlQueryString The xmlQuery string to execute against the xml api. |
Fields inherited from class de.smartics.ci.comm.command.AbstractJobCommand |
---|
jobName |
Fields inherited from class de.smartics.ci.comm.command.AbstractCommand |
---|
ERROR_CATEGORY_DESTINGUISHER, logLevel |
Constructor Summary | |
---|---|
AbstractHudsonApiJob(String jobName) Default constructor. |
Method Summary | |
---|---|
protected void |
checkResponseString(String response) Check the response. |
protected void |
createResult(int statusCode, PostMethod method) Create the command result and provide the result object in this command object. |
CommandResult<T> |
getResult() Returns the result of the execution of this command. |
protected void |
logResponse(String response) Log the response of this command. |
protected String |
resolve(String queryString) Resolve the query string, resolve all variables in the query string with the given values. |
void |
setKeyValuePairs(Properties properties) Sets the value for keyValuePairs. |
void |
setXmlQueryString(String xmlQueryString) Sets the xmlQuery string to execute against the xml api. |
Methods inherited from class de.smartics.ci.comm.command.AbstractGenericJobCommand |
---|
execute |
Methods inherited from class de.smartics.ci.comm.command.AbstractJobCommand |
---|
buildCiJobApiUrl, setJobName |
Methods inherited from class de.smartics.ci.comm.command.AbstractCommand |
---|
addRequestHeaders, buildQueryString, checkParameterNotBlank, checkResult, checkResultRegardingRedirect, fetchDelimiter, setLogLevel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String xmlQueryString
protected Properties properties
protected CommandResult<T extends Command<T>> commandResult
Constructor Detail |
---|
public AbstractHudsonApiJob(String jobName)
jobName
- the name of the job.
Method Detail |
---|
public final void setXmlQueryString(String xmlQueryString)
xmlQueryString
- the xmlQuery string to execute against the xml api.
public final void setKeyValuePairs(Properties properties)
Key value pairs used to replace variables (the keys) in the xml query string with the values.
properties
- the value for keyValuePairs.
protected final void createResult(int statusCode, PostMethod method) throws IOException, CommandException
statusCode
- the status code of the response.
method
- the method used to execute the command.
IOException
- when the communication fails and the response could not be retrieved.
CommandException
- when command fails.
protected void checkResponseString(String response) throws CommandException
response
- the response.
CommandException
- when check fails.
protected final void logResponse(String response) throws IOException
response
- the response as String.
IOException
- when the response can not be retrieved from the method.
protected final String resolve(String queryString)
queryString
- the query string containing variables.
public final CommandResult<T> getResult()
AbstractGenericJobCommand
null
is returned.
getResult
in class
AbstractGenericJobCommand<T extends Command<T>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |