View Javadoc

1   package com.atlassian.config.bootstrap;
2   
3   import com.atlassian.config.ApplicationConfiguration;
4   import com.atlassian.config.ConfigurationException;
5   import com.atlassian.config.db.DatabaseDetails;
6   import com.atlassian.config.db.HibernateConfig;
7   import com.atlassian.config.db.HibernateConfigurator;
8   import com.atlassian.config.setup.SetupPersister;
9   
10  import java.util.Collection;
11  import java.util.Map;
12  import java.util.Properties;
13  import java.sql.Connection;
14  
15  /**
16   * Parent BootstrapManaager
17   */
18  public interface AtlassianBootstrapManager
19  {
20      /**
21       * @return boolean indicating whether Confluence is bootstrapped.
22       */
23      boolean isBootstrapped();
24  
25      Object getProperty(String key);
26  
27      void setProperty(String key, Object value);
28  
29      boolean isPropertyTrue(String prop);
30  
31      void removeProperty(String key);
32  
33      String getString(String key);
34  
35      String getFilePathProperty(String key);
36  
37      Collection getPropertyKeys();
38  
39      Map getPropertiesWithPrefix(String prefix);
40  
41      /**
42       * This is the build number of the current version that the user is running under.
43       * This version is stored in their confluence home confluence.cfg.xml file
44       */
45      String getBuildNumber();
46  
47      void setBuildNumber(String buildNumber);
48  
49      boolean isApplicationHomeValid();
50  
51      Properties getHibernateProperties();
52  
53      void save() throws ConfigurationException;
54  
55      boolean isSetupComplete();
56  
57      String getOperation();
58  
59      void setOperation(String operation);
60  
61      void setSetupComplete(boolean complete);
62  
63  
64      void bootstrapDatasource(String datasourceName, String hibernateDialect)
65         throws BootstrapException;
66  
67  
68      SetupPersister getSetupPersister();
69  
70      ApplicationConfiguration getApplicationConfig();
71  
72      String getApplicationHome();
73      String getConfiguredApplicationHome();
74  
75      String getBootstrapFailureReason();
76  
77      /**
78       * Does final initialisation of the BootstrapManager, including looking up the confluence home
79       *
80       * (Previously was the afterPropertiesSet method)
81       *
82       * @throws BootstrapException
83       */
84      void init() throws BootstrapException;
85  
86      void publishConfiguration();
87  
88      // -------------------------------------------------------------------------------------------------------------- Db
89      void bootstrapDatabase(DatabaseDetails dbDetails, boolean embedded) throws BootstrapException;
90  
91      HibernateConfigurator getHibernateConfigurator();
92  
93      void setHibernateConfigurator(HibernateConfigurator hibernateConfigurator);
94  
95      HibernateConfig getHibernateConfig();
96  
97      Connection getTestDatasourceConnection(String datasourceName) throws BootstrapException;
98  
99      boolean databaseContainsExistingData(Connection connection);
100 
101     Connection getTestDatabaseConnection(DatabaseDetails databaseDetails) throws BootstrapException;
102 }