Class SecondaryJiraHome

java.lang.Object
com.atlassian.jira.config.util.AbstractJiraHome
com.atlassian.jira.config.util.SecondaryJiraHome
All Implemented Interfaces:
JiraHome, InitializingComponent

public class SecondaryJiraHome extends AbstractJiraHome implements InitializingComponent
Secondary JIRA Home to allow replication of everything to a different location for disaster recovery
Since:
6.4
  • Constructor Details

  • Method Details

    • afterInstantiation

      public void afterInstantiation() throws Exception
      Description copied from interface: InitializingComponent
      Called 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:
      afterInstantiation in interface InitializingComponent
      Throws:
      Exception
    • getLocalHome

      @Nonnull public File getLocalHome()
      Description copied from interface: JiraHome
      Get the File object 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:
      getLocalHome in interface JiraHome
      Returns:
      the file path, must be a directory
    • getDefaultPath

      public String 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 enabled
      plugins - plugins enabled
      indexSnapshots - index snapshot enabled
      avatars - 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