|
||||||||||
| 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 ofBuildPersisterDecorators 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 Persisterpublic String getName()
public String getUrl()
public void setDataDirectory(String buildDataDirectory)
buildDataDirectory - The build data directorypublic String getDataDirectory()
public File getDataDirectoryFile()
getDataDirectoryFile in interface Persisterpublic int getCurrentVersion()
Persister
getCurrentVersion in interface Persisterpublic VersionUpgrader getVersionUpgrader()
Persister
getVersionUpgrader in interface Persisterpublic void setBuildManager(BuilderManager builderManager)
setBuildManager in interface Persisterpublic 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 StartableException - A generic exception
public void stop()
throws Exception
Startable
stop in interface StartableException - A generic failurepublic void reload()
reload in interface Persisterpublic void clear()
Persister
clear in interface Persisterprotected BuildPersisterDecorator getBuildDecorator()
public void updateToCurrentVersion()
updateToCurrentVersion in interface Persisterpublic boolean isInitialised()
isInitialised in interface Persisterpublic AdministrationConfiguration getAdministrationConfiguration()
Persister
getAdministrationConfiguration in interface Persisterpublic void saveAdministrationConfiguration(AdministrationConfiguration administrationConfiguration)
saveAdministrationConfiguration in interface PersisteradministrationConfiguration - The object to savepublic Build getBuildByName(String buildName)
Persister
getBuildByName in interface PersisterbuildName - The name of the persisted build we require
public Build getBuildByKey(String buildKey)
Persister
getBuildByKey in interface PersisterbuildKey - The key of the persisted build we require
public boolean isExistingBuild(String buildName)
Persister
isExistingBuild in interface PersisterbuildName - The name of the build we're checking
public Collection getBuilds()
Persister
getBuilds in interface Persisterpublic void saveBuild(Build build)
Persister
saveBuild in interface Persisterbuild - The buildpublic void deleteBuild(Build build)
Persister
deleteBuild in interface Persisterbuild - The build to delete
public void deleteBuildResults(Build build,
long buildNumber)
Persister
deleteBuildResults in interface Persisterbuild - The build it's being removed frombuildNumber - The build to remove
public void addBuildResults(Build build,
BuildResults buildResults)
Persister
addBuildResults in interface Persisterbuild - The build we are adding the new build result tobuildResults - The build results we are adding
public void updateBuildResults(Build build,
BuildResults buildResults)
public BuildResults getBuildResults(Build build,
long buildNumber)
Persister
getBuildResults in interface Persisterbuild - The buildbuildNumber - The build's build number
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||