|
||||||||||
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>
T
- the concrete type of the command.
public abstract class AbstractCommand<T extends Command<T>>
Abstract command that combines all every command needs.
Field Summary | |
---|---|
protected static int |
ERROR_CATEGORY_DESTINGUISHER Using the modulo operator this constant is used to calculate the main status code of a http response e.g 202 % 100 = 2. |
protected LogLevel |
logLevel The log level for this command. |
Constructor Summary | |
---|---|
AbstractCommand() |
Method Summary | |
---|---|
protected void |
addRequestHeaders(HttpMethodBase method) Add request headers to the method. |
protected String |
buildQueryString(Map<String,String> parameter) Build the query string using the given parameter. |
protected void |
checkParameterNotBlank(String... params) Checks if the parameters are blank. |
protected void |
checkResult(int statusCode) Checks the result statusCode of a request. |
protected void |
checkResultRegardingRedirect(int statusCode) Checks the result statusCode of a request. |
protected String |
fetchDelimiter(boolean isFirstParameter) Fetch the delimiter between two parameters of a query string for a get command. |
void |
setLogLevel(LogLevel logLevel) Sets the log level for this command. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.smartics.ci.comm.command.Command |
---|
execute |
Field Detail |
---|
protected static final int ERROR_CATEGORY_DESTINGUISHER
100
protected LogLevel logLevel
Constructor Detail |
---|
public AbstractCommand()
Method Detail |
---|
public final void setLogLevel(LogLevel logLevel)
logLevel
- the log level for this command.
protected void checkParameterNotBlank(String... params) throws CommandException
params
- the String parameters to check.
CommandException
- when at leas one parameter is blan.
protected void checkResult(int statusCode) throws InvalidRequestException
statusCode
- the status code returned from the ci system.
InvalidRequestException
- when the status code indicates an error.
protected void checkResultRegardingRedirect(int statusCode) throws InvalidRequestException
statusCode
- the status code returned from the ci system.
InvalidRequestException
- when the status code indicates an error.
protected String buildQueryString(Map<String,String> parameter)
parameter
- the parameter for the query string.
protected String fetchDelimiter(boolean isFirstParameter)
isFirstParameter
- wether or not this is the first call.
protected void addRequestHeaders(HttpMethodBase method)
method
- the http method used to add request headers.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |