View Javadoc

1   package com.atlassian.plugin.webresource;
2   
3   import com.atlassian.util.concurrent.NotNull;
4   
5   import java.util.Set;
6   
7   interface ResourceDependencyResolver
8   {
9       /**
10       * Returns an ordered set of the super batch resources and its dependencies.
11       * If no super batch resources are defined an empty set is returned.
12       * Implementations are expected to use the {@link ResourceBatchingConfiguration} provided.
13       * @return an ordered set of the super batch resources and its dependencies.
14       */
15      public Iterable<WebResourceModuleDescriptor> getSuperBatchDependencies();
16  
17      /**
18       * Returns an ordered set of the given resource and its dependencies. To exclude resource dependencies
19       * in the super batch, pass excludeSuperBatchedResources as true.
20       * If the resources cannot be resolved an empty set is returned.
21       * @param moduleKey the complete module key of the web resource to retrieve dependencies for
22       * @param excludeSuperBatchedResources whether or not to exclude resources that are part of the super batch.
23       * @return an ordered set of the given resource and its dependencies
24       */
25      public Iterable<WebResourceModuleDescriptor> getDependencies(String moduleKey, boolean excludeSuperBatchedResources);
26  
27      /**
28       * Returns an ordered list of the resources in a given context and its dependencies.
29       * Dependencies with conditions are not included.
30       * If no resources are defined for the given context an empty set is returned.
31       * @param context - the context to retrieve dependencies from.
32       * @return an ordered list of the resources in a given context and its dependencies.
33       * @since 2.9.0
34       */
35      public Iterable<WebResourceModuleDescriptor> getDependenciesInContext(@NotNull String context);
36  
37      /**
38       * Returns an ordered list of the resources in a given context and its dependencies.
39       * Dependencies with conditions are not included and are added to the parameter skippedResources
40       * If no resources are defined for the given context an empty set is returned.
41       * @param context - the context to retrieve dependencies from.
42       * @param skippedResources - a list that all the resources that are skipped are added to.
43       * @return an ordered list of the resources in a given context and its dependencies.
44       * @since 2.9.0
45       */
46      public Iterable<WebResourceModuleDescriptor> getDependenciesInContext(@NotNull String context, @NotNull Set<String> skippedResources);
47  }