com.atlassian.bamboo.persister.file
Class XStreamBuildPersister

java.lang.Object
  extended by com.atlassian.bamboo.persister.xstream.AbstractXStreamPersister
      extended by com.atlassian.bamboo.persister.file.XStreamBuildPersister
All Implemented Interfaces:
Startable, BuildPersisterDecorator

public class XStreamBuildPersister
extends AbstractXStreamPersister
implements BuildPersisterDecorator, Startable

This class provides an XStream implementation of the Bamboo BuildPersisterDecorator'er.


Field Summary
static java.lang.String BUILD_MAP_XML_FILE
           
static java.lang.String BUILD_XML_FILE
           
 
Fields inherited from class com.atlassian.bamboo.persister.xstream.AbstractXStreamPersister
myXstream
 
Constructor Summary
XStreamBuildPersister()
           
 
Method Summary
 void deleteBuild(Build build)
          Remove the given build's persisted files
 void deleteBuildResults(Build build, long buildNumber)
          Remove the build files for the given build buildNumber.
 java.util.Iterator getBuildNames()
          Obtain an iterator of the names of the currently persisted builds
 boolean isActive()
          Indicates whether this is currently active.
 BuildResults loadBuildResults(Build build, long buildNumber)
          Load the build buildresults for the given build number
 java.util.Collection loadBuilds()
          Get all the persisted builds
 Build loadBuilds(java.lang.String buildName)
          Load the given build from an xml file.
 void saveBuild(Build build)
          Save the supplied build
 void saveBuildResults(Build build, BuildResults buildResults)
          Save the build results
 void start()
          Load the build data file map.
 void stop()
          Do nothing!
 
Methods inherited from class com.atlassian.bamboo.persister.xstream.AbstractXStreamPersister
fromXML, init, registerClassAlias, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILD_MAP_XML_FILE

public static final java.lang.String BUILD_MAP_XML_FILE
See Also:
Constant Field Values

BUILD_XML_FILE

public static final java.lang.String BUILD_XML_FILE
See Also:
Constant Field Values
Constructor Detail

XStreamBuildPersister

public XStreamBuildPersister()
Method Detail

start

public void start()
           throws java.lang.Exception
Load the build data file map.

Specified by:
start in interface Startable
Throws:
java.lang.Exception - A generic error

stop

public void stop()
          throws java.lang.Exception
Do nothing!

Specified by:
stop in interface Startable
Throws:
java.lang.Exception - A generic error.

isActive

public boolean isActive()
Description copied from interface: Startable

Indicates whether this is currently active.

Specified by:
isActive in interface Startable
Returns:
true if this is active, false otherwise.

saveBuild

public void saveBuild(Build build)
               throws PersisterException
Save the supplied build

Specified by:
saveBuild in interface BuildPersisterDecorator
Parameters:
build - The build to persist as XML
Throws:
PersisterException - Failed to persist

loadBuilds

public Build loadBuilds(java.lang.String buildName)
                 throws PersisterException
Load the given build from an xml file.

Specified by:
loadBuilds in interface BuildPersisterDecorator
Parameters:
buildName - The build to load
Returns:
The build
Throws:
PersisterException - An error.

saveBuildResults

public void saveBuildResults(Build build,
                             BuildResults buildResults)
                      throws PersisterException
Save the build results

Specified by:
saveBuildResults in interface BuildPersisterDecorator
Parameters:
build - Associate the build with this build
buildResults - The results to save
Throws:
PersisterException - An error

loadBuildResults

public BuildResults loadBuildResults(Build build,
                                     long buildNumber)
                              throws PersisterException
Load the build buildresults for the given build number

Specified by:
loadBuildResults in interface BuildPersisterDecorator
Parameters:
build - The build
buildNumber - The build top load
Returns:
The build results
Throws:
PersisterException - An error

getBuildNames

public java.util.Iterator getBuildNames()
Obtain an iterator of the names of the currently persisted builds

Specified by:
getBuildNames in interface BuildPersisterDecorator
Returns:
The iterator of build names

deleteBuild

public void deleteBuild(Build build)
                 throws PersisterException
Remove the given build's persisted files

Specified by:
deleteBuild in interface BuildPersisterDecorator
Parameters:
build - The build to zap
Throws:
PersisterException - Failed to persist

deleteBuildResults

public void deleteBuildResults(Build build,
                               long buildNumber)
                        throws PersisterException
Remove the build files for the given build buildNumber.

Specified by:
deleteBuildResults in interface BuildPersisterDecorator
Parameters:
build - The build the build belongs to
buildNumber - The number of the build to delete
Throws:
PersisterException - A generic failure

loadBuilds

public java.util.Collection loadBuilds()
                                throws PersisterException
Description copied from interface: BuildPersisterDecorator
Get all the persisted builds

Specified by:
loadBuilds in interface BuildPersisterDecorator
Returns:
The builds
Throws:
PersisterException - Failed to load


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.