View Javadoc

1   package com.atlassian.johnson.setup;
2   
3   /**
4    * Allows Johnson to interrogate the application to determine whether it has been setup, and whether a given URI relates
5    * to its setup process (for those applications which offer web-based configuration).
6    */
7   public interface SetupConfig
8   {
9       /**
10       * Retrieves a flag indicating whether the application has been setup.
11       * 
12       * @return {@code true} if the application has been setup; otherwise, {@code false}
13       */
14      boolean isSetup();
15  
16      /**
17       * Retrieves a flag indicating whether the provided {@code uri} is a setup-related page.
18       * <p/>
19       * Applications which require complex setup with multiple pages can implement this method to allow access to all
20       * of their pages when {@link #isSetup()} returns {@code false}.
21       * <p/>
22       * Note: This method is related, but not identical, to
23       * {@link com.atlassian.johnson.config.JohnsonConfig#getSetupPath() JohnsonConfig.getSetupPath()}. That property
24       * provides the URL to which a user should be redirected when the application is not setup. It defines the entry
25       * point for setup. After the initial redirection, this method is used to determine whether a page being accessed
26       * is part of the setup process.
27       * 
28       * @param uri the URI of a web page
29       * @return {@code true} if the URI references a setup page; otherwise, {@code false}
30       */
31      boolean isSetupPage(String uri);
32  }