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