|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.bamboo.upgrader.LegacyPersister
public class LegacyPersister
This persister is only used in upgrade code. It reads build results from the old file locations & uses the legacy objects instead How dated! :) This then became redundant as of build 110 (0.7)
Nested Class Summary | |
---|---|
static class |
LegacyPersister.AntBuilderMap
|
static class |
LegacyPersister.MavenBuilderMap
|
static class |
LegacyPersister.ScriptBuilderMap
|
Field Summary | |
---|---|
static String |
BUILD_MAP_XML_FILE
|
static String |
BUILD_XML_FILE
|
protected BuilderManager |
builderManager
|
protected XStream |
myXstream
|
Constructor Summary | |
---|---|
LegacyPersister(File buildDirectory,
BuilderManager builderManager)
Initialised XStream to use aliases for classes to tidy up the resulting XML. |
Method Summary | |
---|---|
File |
createBuildDirectory(File buildDir,
Date buildDate)
Create a build subdirectory based on the build date. |
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. |
Object |
fromXML(String xml)
Convert the xml into a java Object instance |
FastBuildDefinitionDirectoryMapper |
getBuildDirectoryMapper()
Used in testing |
String |
getBuildFileName(long buildNumber)
Create the build number xml file name. |
Iterator |
getBuildNames()
Obtain an iterator of the names of the currently persisted builds |
File |
getBuildResultsFile(Build build,
long buildNumber)
|
File |
getBuildResultsFileInDatedFormat(Build build,
long buildNumber)
|
protected void |
init()
|
BuildResults |
loadBuildResults(Build build,
long buildNumber)
Load the build buildresults for the given build number |
Collection |
loadBuilds()
Get all the persisted builds |
Build |
loadBuilds(String buildName)
Load the given build from an xml file. |
void |
registerClassAlias(String xmlTag,
Class tagClass)
Register an the given xmlTag as an alias for persisting the given tagClass. |
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! |
String |
toXML(Object object)
Convert the java object into its XML form |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected XStream myXstream
protected final BuilderManager builderManager
public static final String BUILD_MAP_XML_FILE
public static final String BUILD_XML_FILE
Constructor Detail |
---|
public LegacyPersister(File buildDirectory, BuilderManager builderManager)
buildDirectory
- Method Detail |
---|
protected void init()
public void registerClassAlias(String xmlTag, Class tagClass)
xmlTag
- The xml tag nametagClass
- The class represented by the tagpublic File getBuildResultsFileInDatedFormat(Build build, long buildNumber) throws PersisterException
PersisterException
public Object fromXML(String xml)
xml
- The xml representation of the object
public String toXML(Object object)
object
- The object
public void start() throws Exception
start
in interface Startable
Exception
- A generic errorpublic void stop() throws Exception
stop
in interface Startable
Exception
- A generic error.public void saveBuild(Build build) throws PersisterException
saveBuild
in interface BuildPersisterDecorator
build
- The build to persist as XML
PersisterException
- Failed to persistpublic Build loadBuilds(String buildName) throws PersisterException
loadBuilds
in interface BuildPersisterDecorator
buildName
- The build to load
PersisterException
- An error.public void saveBuildResults(Build build, BuildResults buildResults) throws PersisterException
saveBuildResults
in interface BuildPersisterDecorator
build
- Associate the build with this buildbuildResults
- The results to save
PersisterException
- An errorpublic BuildResults loadBuildResults(Build build, long buildNumber) throws PersisterException
loadBuildResults
in interface BuildPersisterDecorator
build
- The buildbuildNumber
- The build top load
PersisterException
- An errorpublic File getBuildResultsFile(Build build, long buildNumber) throws PersisterException
PersisterException
public Iterator getBuildNames()
getBuildNames
in interface BuildPersisterDecorator
public void deleteBuild(Build build) throws PersisterException
deleteBuild
in interface BuildPersisterDecorator
build
- The build to zap
PersisterException
- Failed to persistpublic void deleteBuildResults(Build build, long buildNumber) throws PersisterException
deleteBuildResults
in interface BuildPersisterDecorator
build
- The build the build belongs tobuildNumber
- The number of the build to delete
PersisterException
- A generic failurepublic String getBuildFileName(long buildNumber)
buildNumber
- The number of the build
public File createBuildDirectory(File buildDir, Date buildDate)
public Collection loadBuilds() throws PersisterException
BuildPersisterDecorator
loadBuilds
in interface BuildPersisterDecorator
PersisterException
- Failed to loadpublic FastBuildDefinitionDirectoryMapper getBuildDirectoryMapper()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |