public class FileBasedPersister extends Object implements Persister
It uses a decorator chain of BuildPersisterDecorator
s to handle caching, and actually saving.
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_CONFIG_FILE |
static String |
DEFAULT_BUILD_DIRECTORY |
static String |
DEFAULT_CONFIG_DIRECTORY |
Constructor and Description |
---|
FileBasedPersister(BootstrapManager bootstrapManager,
XStreamFactory xStreamFactory) |
FileBasedPersister(XStreamFactory xStreamFactory) |
Modifier and Type | Method and Description |
---|---|
void |
addBuildResults(PlanKey planKey,
BuildResults buildResults)
Associate the given buildResults with the given build.
|
void |
clear()
Clears all interal caches the persister may have
|
void |
deleteBuildResults(PlanKey planKey,
long buildNumber)
Remove a specific build result MXL
|
AdministrationConfiguration |
getAdministrationConfiguration()
Reload the persisted admin configuration data
|
AdministrationConfiguration |
getAdministrationConfiguration(FeatureManager featureManager)
Reload the persisted admin configuration data
|
BuildResults |
getBuildResults(Key planKey,
int buildNumber)
Get the Nth build for a given build.
|
String |
getConfigurationDirectory()
Provide the UI with the current configuration directory
|
File |
getConfigurationDirectoryFile()
Return the directory containing the administration.xml file.
|
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?
|
boolean |
isActive()
Indicates whether this is currently active.
|
boolean |
isInitialised()
Does the persister reference valid admin configuration data?
|
void |
reload()
Restart with the latest configurations...
|
void |
reloadAdministrationConfiguration()
Reloads the administration configuration from the xml.
|
void |
saveAdministrationConfiguration(AdministrationConfiguration administrationConfiguration)
Save the given administrationConfiguration in the persister's configuration data directory
|
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 |
start()
Make the persister available for use.
|
void |
stop()
Stop the component and clean up any resources
|
public static final String ADMIN_CONFIG_FILE
public static final String DEFAULT_BUILD_DIRECTORY
public static final String DEFAULT_CONFIG_DIRECTORY
public FileBasedPersister(XStreamFactory xStreamFactory)
public FileBasedPersister(@Nullable BootstrapManager bootstrapManager, @NotNull XStreamFactory xStreamFactory)
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 void setConfigurationDirectory(String configurationDataDirectory)
configurationDataDirectory
- The server configuration data directorypublic String getConfigurationDirectory()
public File getConfigurationDirectoryFile()
Persister
getConfigurationDirectoryFile
in interface Persister
public void start() throws Exception
public void stop() throws Exception
Startable
public boolean isActive()
Startable
Indicates whether this is currently active.
public void reload()
public void clear()
Persister
public boolean isInitialised()
isInitialised
in interface Persister
public void reloadAdministrationConfiguration()
Persister
reloadAdministrationConfiguration
in interface Persister
public AdministrationConfiguration getAdministrationConfiguration()
Persister
getAdministrationConfiguration
in interface Persister
public AdministrationConfiguration getAdministrationConfiguration(@Nullable FeatureManager featureManager)
Persister
getAdministrationConfiguration
in interface Persister
public void saveAdministrationConfiguration(AdministrationConfiguration administrationConfiguration)
saveAdministrationConfiguration
in interface Persister
administrationConfiguration
- The object to savepublic void deleteBuildResults(PlanKey planKey, long buildNumber)
Persister
deleteBuildResults
in interface Persister
buildNumber
- The build to removepublic void addBuildResults(PlanKey planKey, BuildResults buildResults)
Persister
addBuildResults
in interface Persister
buildResults
- The build results we are adding@Nullable public BuildResults getBuildResults(Key planKey, int buildNumber)
Persister
getBuildResults
in interface Persister
buildNumber
- The build's build numberCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.