Getting Started

Continuum has a SOAP API which makes it easy to add, remove, view and manipulate builds from within your applications. Continuum includes a client to access this API. Alternatively, you may generate a client from favorite SOAP toolkit (such as the toolkits for PERL or .NET) using the WSDL found at http://localhost:8080/continuum/services/Continuum?wsdl. If you are using a client other than the one mentioned below, the code should be roughly the same.

The API provides the following operations:

  • addProject
  • getProject
  • remoteProject
  • updateProject
  • checkoutProject
  • removeProject
  • getLatestBuild
  • getCheckOutScmResult

Using the Bundled Java Client

Creating a Client

import org.apache.maven.continuum.xfire.ContinuumWebService;
import org.apache.maven.continuum.xfire.ContinuumClientFactory;
import org.apache.maven.continuum.xfire.Project;
import org.apache.maven.continuum.xfire.Build;
import org.apache.maven.continuum.project.ContinuumProjectState;

...

String url = "http://localhost:8080/continuum/services/Continuum";
ContinuumWebService continuum = ContinuumClientFactory.createClient( url );

Adding A Project

Project project = new Project();
project.setType("maven2");
project.setScmUrl("scm:svn....");

continuum.addProject(project);

The project type tells Continuum what type of project to expect. Valid values are "ant", "shell", "maven-1", and "maven2".

Getting the latest build

Build build = continuum.getLatestBuild(project.getId());

if ( build.getState() == ContinuumProjectState.OK )
{
    doSomething();
}
else if ( build.getState() == ContinuumProjectState.FAILED )
{
    punishDevelopers();
}

Notes for other Toolkits

Project State

In one of the above code snippets, you see that we can check the build state. The build state can be one of several values:

1New Build
2Successful Build
3Failed Build
4Error building
6Build in process
7Checking out from SCM
8Updating from SCM