de.smartics.ci.comm
Class CiController

Package class diagram package CiController
java.lang.Object
  extended by de.smartics.ci.comm.CiController

public final class CiController
     
     
extends Object

Controls the ci server. Right now only hudson.


Constructor Summary
CiController(CiSystem system)
          Default constructor.
 
Method Summary
 CommandResult<?> checkStatusJob(String jobName, String xmlQueryString, Properties properties)
          Check status of a job on the target system and return the result.
 void createJob(String jobName, String configString)
          Create a job on the target system.
 void deleteJob(String jobName)
          Delete a job on the target system.
 void disableJob(String jobName)
          Disable a job on the target system.
 void enableJob(String jobName)
          Enable a job on the target system.
 CommandResult<?> executeGenericJobCommand(String jobName, String apiUrl, String xmlQueryString, String regexp, Properties properties)
          Check status of a job on the target system and return the result.
 void login()
          Login to the target.
 void setCreateJobCommand(HudsonCreateJobCommand createJobCommand)
          Sets the command to create a job.
 void setDeleteJobCommand(HudsonDeleteJobCommand deleteJobCommand)
          Sets the command to delete a job.
 void setDisableJobCommand(HudsonDisableJobCommand disableJobCommand)
          Sets the command to disable a job.
 void setEnableJobCommand(HudsonEnableJobCommand enableJobCommand)
          Sets the command to enable a job.
 void setGenericJobCommand(HudsonGenericJobCommand genericJobCommand)
          Sets the generic job command.
 void setLoginCommand(HudsonLoginCommand loginCommand)
          Sets the login command to use to login to the ci system.
 void setLoginCredentials(Credentials loginCredentials)
          Sets the credentials used to login to the ci server.
 void setLogLevel(LogLevel logLevel)
          Set the log level for this controller.
 void setProxyInformation(ProxyInformation proxy)
          Sets the proxy information used to connect to the network using a proxy.
 void setStatusJobCommand(HudsonCheckStatusJobCommand statusJobCommand)
          Sets the command to check the status of a job.
 void setUpdateJobCommand(HudsonUpdateJobCommand updateJobCommand)
          Sets the value for updateJobCommand.
 void updateJob(String jobName, String configString)
          Update a job on the target system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CiController

public CiController(CiSystem system)
Default constructor.

Parameters:
system - the system on which the commands are executed.
Method Detail

setLogLevel

public void setLogLevel(LogLevel logLevel)
Set the log level for this controller.

Parameters:
logLevel - the log level to use.

setLoginCredentials

public void setLoginCredentials(Credentials loginCredentials)
Sets the credentials used to login to the ci server.

Parameters:
loginCredentials - the credentials used to login to the ci server.

setProxyInformation

public void setProxyInformation(ProxyInformation proxy)
Sets the proxy information used to connect to the network using a proxy.

Parameters:
proxy - the proxy information used to connect to the network using a proxy.

setLoginCommand

public void setLoginCommand(HudsonLoginCommand loginCommand)
Sets the login command to use to login to the ci system.

Parameters:
loginCommand - the login command to use to login to the ci system.

setDeleteJobCommand

public void setDeleteJobCommand(HudsonDeleteJobCommand deleteJobCommand)
Sets the command to delete a job.

Parameters:
deleteJobCommand - the command to delete a job.

setCreateJobCommand

public void setCreateJobCommand(HudsonCreateJobCommand createJobCommand)
Sets the command to create a job.

Parameters:
createJobCommand - the command to create a job.

setUpdateJobCommand

public void setUpdateJobCommand(HudsonUpdateJobCommand updateJobCommand)
Sets the value for updateJobCommand.

the command to update a job.

Parameters:
updateJobCommand - the value for updateJobCommand.

setEnableJobCommand

public void setEnableJobCommand(HudsonEnableJobCommand enableJobCommand)
Sets the command to enable a job.

Parameters:
enableJobCommand - the command to enable a job.

setDisableJobCommand

public void setDisableJobCommand(HudsonDisableJobCommand disableJobCommand)
Sets the command to disable a job.

Parameters:
disableJobCommand - the command to disable a job.

setStatusJobCommand

public void setStatusJobCommand(HudsonCheckStatusJobCommand statusJobCommand)
Sets the command to check the status of a job.

Parameters:
statusJobCommand - the command to check a job.

setGenericJobCommand

public void setGenericJobCommand(HudsonGenericJobCommand genericJobCommand)
Sets the generic job command.

Parameters:
genericJobCommand - the command to execute on a job.

login

public void login()
           throws LoginCommandException
Login to the target.

Throws:
LoginCommandException - when the login failed.

createJob

public void createJob(String jobName,
                      String configString)
               throws CommandException
Create a job on the target system.

Parameters:
jobName - the name of the job.
configString - the config string.
Throws:
CommandException - when the command failed.

updateJob

public void updateJob(String jobName,
                      String configString)
               throws CommandException
Update a job on the target system.

Parameters:
jobName - the name of the job.
configString - the config string.
Throws:
CommandException - when the command failed.

disableJob

public void disableJob(String jobName)
                throws CommandException
Disable a job on the target system.

Parameters:
jobName - the name of the job.
Throws:
CommandException - when the command failed.

enableJob

public void enableJob(String jobName)
               throws CommandException
Enable a job on the target system.

Parameters:
jobName - the name of the job.
Throws:
CommandException - when the command failed.

deleteJob

public void deleteJob(String jobName)
               throws CommandException
Delete a job on the target system.

Parameters:
jobName - the name of the job.
Throws:
CommandException - when the command failed.

checkStatusJob

public CommandResult<?> checkStatusJob(String jobName,
                                       String xmlQueryString,
                                       Properties properties)
                                throws CommandException
Check status of a job on the target system and return the result.

Parameters:
jobName - the name of the job.
xmlQueryString - the xml api queryString to run at the ci server.
properties - a list of key value pairs used to replace variables in the xml query string.
Returns:
the result of the command or null.
Throws:
CommandException - when the command failed.

executeGenericJobCommand

public CommandResult<?> executeGenericJobCommand(String jobName,
                                                 String apiUrl,
                                                 String xmlQueryString,
                                                 String regexp,
                                                 Properties properties)
                                          throws CommandException
Check status of a job on the target system and return the result.

Parameters:
jobName - the name of the job.
apiUrl - the api url.
xmlQueryString - the xml api queryString to run at the ci server.
regexp - the regexp to check the result.
properties - a list of key value pairs used to replace variables in the xml query string.
Returns:
the result of the command or null.
Throws:
CommandException - when the command failed.


Copyright © 2012 Kronseder & Reiner GmbH - smartics. All Rights Reserved.