public class

JenkinsConnector

extends Object
java.lang.Object
   ↳ org.mule.module.JenkinsConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Provides the ability to interact with Jenkins API REST.

Summary

Public Constructors
JenkinsConnector()
Public Methods
void build(String jobName)
Perform a job build
void buildWithParameters(String jobName, Map<String, String> params)
Perform a parametrized job build using a map
void connect(String connectionName, String jenkinsUrl, String username, String password)
Connect
String connectionId()
connection id
JobInfo copyJob(String newJobName, String fromJobName)
Create new job using another job as a copy
JobInfo createJob(String jobName)
Create new job using basic configuration
void deleteJob(String jobName)
Delete job
void disableJob(String jobName)
Disable job
void disconnect()
Disconnect
void enableJob(String jobName)
Enable job
JenkinsInfo getJenkinsNodeInfo()
Retrieve jenkins server node information
BuildInfo getJobBuildInfo(String jobName, int buildNumber)
Get job build info
String getJobBuildLog(String jobName, String buildNumber)
Get job build console log text
JobInfo getJobInfo(String jobName)
Retrieves Jenkins job information using job name to find it
JenkinsQueueInfo getQueueInfo()
Retrieves Jenkins Queue information, is the current build activity
boolean isConnected()
Connected if http client info is set properly
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public JenkinsConnector ()

Public Methods

public void build (String jobName)

Perform a job build

Parameters
jobName Name of the job to retrieve info
Throws
JenkinsDeploymentException exception

public void buildWithParameters (String jobName, Map<String, String> params)

Perform a parametrized job build using a map

Parameters
jobName Name of the job to retrieve info
params Build parameters map
Throws
JenkinsDeploymentException exception

public void connect (String connectionName, String jenkinsUrl, String username, String password)

Connect

Parameters
connectionName A String identification for the connection
jenkinsUrl A Jenkins server URL
username Optional
password Optional
Throws
ConnectionException

public String connectionId ()

connection id

public JobInfo copyJob (String newJobName, String fromJobName)

Create new job using another job as a copy

Parameters
newJobName Name of the job to create
fromJobName Name of the job to copy
Returns
  • The created Jenkins job info if exits, an empty object if creation failed
Throws
JenkinsConnectorException exception

public JobInfo createJob (String jobName)

Create new job using basic configuration

Parameters
jobName Name of the job to create
Returns
  • The created Jenkins job info if exits, an empty object if creation failed
Throws
JenkinsConnectorException exception

public void deleteJob (String jobName)

Delete job

Parameters
jobName Name of the job to delete
Throws
JenkinsConnectorException exception

public void disableJob (String jobName)

Disable job

Parameters
jobName Name of the job to disable
Throws
JenkinsConnectorException exception

public void disconnect ()

Disconnect

public void enableJob (String jobName)

Enable job

Parameters
jobName Name of the job to enable
Throws
JenkinsConnectorException exception

public JenkinsInfo getJenkinsNodeInfo ()

Retrieve jenkins server node information

Returns
  • Jenkins node info
Throws
JenkinsConnectorException exception

public BuildInfo getJobBuildInfo (String jobName, int buildNumber)

Get job build info

Parameters
jobName Job name
buildNumber Build number
Returns
  • Build info representation object
Throws
JenkinsConnectorException exception

public String getJobBuildLog (String jobName, String buildNumber)

Get job build console log text

Parameters
jobName Job name
buildNumber Build number
Returns
  • String with the log output for the requested Job
Throws
JenkinsConnectorException exception

public JobInfo getJobInfo (String jobName)

Retrieves Jenkins job information using job name to find it

Parameters
jobName Name of the job to retrieve info
Returns
  • Jenkins job info
Throws
JenkinsConnectorException exception

public JenkinsQueueInfo getQueueInfo ()

Retrieves Jenkins Queue information, is the current build activity

Returns
  • Jenkins queue job info
Throws
JenkinsConnectorException exception

public boolean isConnected ()

Connected if http client info is set properly