|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.bamboo.persister.file.FileBasedPersister
public class FileBasedPersister
This class persists all data as xml data files on the file system.
It uses a decorator chain ofBuildPersisterDecorator
s to handle caching, and actually saving.
Field Summary | |
---|---|
static String |
ADMIN_CONFIG_FILE
|
static String |
DEFALT_BUILD_DIRECTORY
|
static String |
DEFALT_CONFIG_DIRECTORY
|
Constructor Summary | |
---|---|
FileBasedPersister()
|
|
FileBasedPersister(BootstrapManager bootstrapManager)
|
Method Summary | |
---|---|
void |
addBuildResults(Build build,
BuildResults buildResults)
Associate the given buildResults with the given build. |
void |
clear()
Clears all interal caches the persister may have |
void |
deleteBuild(Build build)
Remove a build from the System. |
void |
deleteBuildResults(Build build,
long buildNumber)
Remove a specific build build. |
AdministrationConfiguration |
getAdministrationConfiguration()
Reload the persisted admin configuration data |
Build |
getBuildByKey(String buildKey)
Obtain the build with the given buildKey |
Build |
getBuildByName(String buildName)
Deprecated. |
protected BuildPersisterDecorator |
getBuildDecorator()
Lets us override the default behaviour when testing |
BuildResults |
getBuildResults(Build build,
long buildNumber)
Get the Nth build for a given build. |
Collection |
getBuilds()
Obtain a collection of all the currently persisted builds. |
String |
getConfigurationDirectory()
Provide the UI with the current configuration directory |
File |
getConfigurationDirectoryFile()
|
int |
getCurrentVersion()
Return the version of the persisted data |
String |
getDataDirectory()
Provide the UI with the current build data directory |
File |
getDataDirectoryFile()
|
String |
getName()
What's the name of plugin - used to identify the plugin in the bamboo.xml configuration file. |
String |
getUrl()
Who implemented this plugin? |
VersionUpgrader |
getVersionUpgrader()
Which upgrader does the persister use? |
boolean |
isExistingBuild(String buildName)
Have we persisted a build with the given buildName? |
boolean |
isInitialised()
Does the persister reference valid admin configuration data? |
void |
reload()
Restart with the latest configurations... |
void |
saveAdministrationConfiguration(AdministrationConfiguration administrationConfiguration)
Save the given administrationConfiguration in the persister's configiuration data directory |
void |
saveBuild(Build build)
Persist a build. |
void |
setBuildManager(BuilderManager builderManager)
|
void |
setConfigurationDirectory(String configurationDataDirectory)
Set by the configuration loader from the value in the bamboo.xml data file. |
void |
setDataDirectory(String buildDataDirectory)
Set by the configuration loader from the value in the bamboo.xml data file. |
void |
setPersisterOptions(PersisterOptions persisterOptions)
Let the UI update the persister |
void |
setVersionUpgrader(VersionUpgrader versionUpgrader)
Set by the configuration loader when the persister is first instantiated. |
void |
start()
Make the persister available for use. |
void |
stop()
Stop the component and clean up any resources |
void |
updateBuildResults(Build build,
BuildResults buildResults)
|
void |
updateToCurrentVersion()
The system requests the that the persisted data is upgraded to work with the lasted code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ADMIN_CONFIG_FILE
public static final String DEFALT_BUILD_DIRECTORY
public static final String DEFALT_CONFIG_DIRECTORY
Constructor Detail |
---|
public FileBasedPersister()
public FileBasedPersister(BootstrapManager bootstrapManager)
Method Detail |
---|
public void setPersisterOptions(PersisterOptions persisterOptions)
Persister
setPersisterOptions
in interface Persister
public String getName()
public String getUrl()
public void setDataDirectory(String buildDataDirectory)
buildDataDirectory
- The build data directorypublic String getDataDirectory()
public File getDataDirectoryFile()
getDataDirectoryFile
in interface Persister
public int getCurrentVersion()
Persister
getCurrentVersion
in interface Persister
public VersionUpgrader getVersionUpgrader()
Persister
getVersionUpgrader
in interface Persister
public void setBuildManager(BuilderManager builderManager)
setBuildManager
in interface Persister
public void setConfigurationDirectory(String configurationDataDirectory)
configurationDataDirectory
- The server configuration data directorypublic String getConfigurationDirectory()
public File getConfigurationDirectoryFile()
public void setVersionUpgrader(VersionUpgrader versionUpgrader)
setVersionUpgrader
in interface Persister
public void start() throws Exception
start
in interface Startable
Exception
- A generic exceptionpublic void stop() throws Exception
Startable
stop
in interface Startable
Exception
- A generic failurepublic void reload()
reload
in interface Persister
public void clear()
Persister
clear
in interface Persister
protected BuildPersisterDecorator getBuildDecorator()
public void updateToCurrentVersion()
updateToCurrentVersion
in interface Persister
public boolean isInitialised()
isInitialised
in interface Persister
public AdministrationConfiguration getAdministrationConfiguration()
Persister
getAdministrationConfiguration
in interface Persister
public void saveAdministrationConfiguration(AdministrationConfiguration administrationConfiguration)
saveAdministrationConfiguration
in interface Persister
administrationConfiguration
- The object to savepublic Build getBuildByName(String buildName)
Persister
getBuildByName
in interface Persister
buildName
- The name of the persisted build we require
public Build getBuildByKey(String buildKey)
Persister
getBuildByKey
in interface Persister
buildKey
- The key of the persisted build we require
public boolean isExistingBuild(String buildName)
Persister
isExistingBuild
in interface Persister
buildName
- The name of the build we're checking
public Collection getBuilds()
Persister
getBuilds
in interface Persister
public void saveBuild(Build build)
Persister
saveBuild
in interface Persister
build
- The buildpublic void deleteBuild(Build build)
Persister
deleteBuild
in interface Persister
build
- The build to deletepublic void deleteBuildResults(Build build, long buildNumber)
Persister
deleteBuildResults
in interface Persister
build
- The build it's being removed frombuildNumber
- The build to removepublic void addBuildResults(Build build, BuildResults buildResults)
Persister
addBuildResults
in interface Persister
build
- The build we are adding the new build result tobuildResults
- The build results we are addingpublic void updateBuildResults(Build build, BuildResults buildResults)
public BuildResults getBuildResults(Build build, long buildNumber)
Persister
getBuildResults
in interface Persister
build
- The buildbuildNumber
- The build's build number
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |