Package com.atlassian.jira.config.util
Class SecondaryJiraHome
java.lang.Object
com.atlassian.jira.config.util.AbstractJiraHome
com.atlassian.jira.config.util.SecondaryJiraHome
- All Implemented Interfaces:
JiraHome,InitializingComponent
Secondary JIRA Home to allow replication
of everything to a different location for disaster recovery
- Since:
- 6.4
-
Field Summary
Fields inherited from interface com.atlassian.jira.config.util.JiraHome
CACHES, DATA, EXPORT, EXPORT_BACKUPS, IMPORT, IMPORT_ATTACHMENTS, INDEX_SNAPSHOTS, INDEXES_DIR, localsubdirs, LOG, PLUGINS, sharedsubdirs, subdirs -
Constructor Summary
ConstructorsConstructorDescriptionSecondaryJiraHome(JiraHome jirahome, ApplicationProperties applicationProperties, ClusterManager clusterManager, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.voidapplySettings(boolean attachments, boolean plugins, boolean indexSnapshots, boolean avatars) Applies all the settings for the replication homeWe map the second default path inside the Jira Home because if you are in a cluster this is the shared home and it is already mapped in all the instances We also keep the same structure as the default Jira Home to be able to use this location as primary in disaster recoveryGet theFileobject representing the JIRA local home directory.booleanprotected voidrefreshLocation(boolean isEnabled) We refresh the location, we do this to only enable this if the feature is enabled.voidsetEnabled(boolean value) Methods inherited from class com.atlassian.jira.config.util.AbstractJiraHome
getCachesDirectory, getDataDirectory, getExportBackupsDirectory, getExportDirectory, getHome, getHomePath, getImportAttachmentsDirectory, getImportDirectory, getIndexSnapshotsDirectory, getLocalHomePath, getLogDirectory, getPluginsDirectory, getSharedCachesDirectory
-
Constructor Details
-
SecondaryJiraHome
public SecondaryJiraHome(JiraHome jirahome, ApplicationProperties applicationProperties, ClusterManager clusterManager, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
getLocalHome
Description copied from interface:JiraHomeGet theFileobject representing the JIRA local home directory. In a clustered or HA deployment this will be different from jira.home, but in a standalone installation will generally be the same as jira.home.- Specified by:
getLocalHomein interfaceJiraHome- Returns:
- the file path, must be a directory
-
getDefaultPath
We map the second default path inside the Jira Home because if you are in a cluster this is the shared home and it is already mapped in all the instances We also keep the same structure as the default Jira Home to be able to use this location as primary in disaster recovery- Returns:
- the default attachment path for the secondary
-
setEnabled
public void setEnabled(boolean value) -
isEnabled
public boolean isEnabled() -
applySettings
public void applySettings(boolean attachments, boolean plugins, boolean indexSnapshots, boolean avatars) Applies all the settings for the replication home- Parameters:
attachments- attachments enabledplugins- plugins enabledindexSnapshots- index snapshot enabledavatars- avatars enabled
-
refreshLocation
protected void refreshLocation(boolean isEnabled) We refresh the location, we do this to only enable this if the feature is enabled. If someone tries to use the secondary home the location will be null, if it is not enabled by this API
-