View Javadoc
1   package com.atlassian.plugin;
2   
3   import java.util.Optional;
4   
5   import static java.util.Optional.empty;
6   
7   /**
8    * Makes class scope aware.
9    * <p>
10   * Intention of scope is to mark plugin or set of plugins as belonging to subset of product functionality
11   * which could be turned on/off in one go.
12   * <p>
13   * Given interface could be used in conjunction with {@link com.atlassian.plugin.scope.ScopeManager}
14   * which will take care about validating scope for current tenant.
15   * <p>
16   * Making plugin scope aware is done via adding {@code <scope>} element:
17   * <pre>
18   * {@code <plugin-info><scope key = "/license/jira-service-desk"/></plugin-info>}
19   * </pre>
20   * once configured plugin itself and all modules will have that scope assigned.
21   * <p>
22   * Modules can opt out from scope by specifying `scope` attribute:
23   * <pre>
24   * {@code<rest key="key" name="name" scoped="false" ... />"}
25   * </pre>
26   *
27   * @see com.atlassian.plugin.scope.ScopeManager
28   * @since 4.1
29   * @deprecated in 5.0 for removal in 6.0
30   */
31  @Deprecated
32  public interface ScopeAware {
33      /**
34       * @return scope set or {@link Optional#empty()} if not defined
35       */
36      default Optional<String> getScopeKey() {
37          return empty();
38      }
39  }