Class BundleDependencies

java.lang.Object
com.atlassian.new_platform.BundleDependencies

public class BundleDependencies extends Object
  • Constructor Details

    • BundleDependencies

      public BundleDependencies(List<BundleInfo> exports, List<BundleInfo> imports)
      Parameters:
      exports - list of bundles exporting certain packages, their imports won't be examined
      imports - list of bundles whose imports have to be met, their own exports are also used to examine dependencies
  • Method Details

    • findMissingImports

      public Map<String,List<String>> findMissingImports()
      Finds all package imports that are not provided by tested bundles
      Returns:
      Map of bundle names with missing imports followed by the list of those imports
    • findNotUsedExports

      public List<String> findNotUsedExports()
      Finds exported bundles whose export capabilities are not used by the import bundles; It may be an indicator to remove that bundle from dependencies
      Returns:
      list of bundle names of not used exports
    • findDuplicatedExports

      public Map<String,List<BundleInfo>> findDuplicatedExports()
      Finds all the exported packages provided by more than single bundle; Atlassian ecosystem implicitly assumes there is only single source of dependencies (so nobody bothered with proper dependency versioning in OSGi...). Not empty list is a recommendation to look at the bundles - perhaps instead of 2 providers, one bundle should be changed to the importer.
      Returns:
      Map of package names exported by more than one bundle followed with the list of bundle names of those bundles
    • getImportDependencies

      public Map<String,Set<String>> getImportDependencies()
      Discovers all dependencies required by the imports
      Returns:
      Map of imported bundle names followed with the set of bundle names they depend on
    • getAllDependencies

      public Map<String,Set<String>> getAllDependencies()
    • getAllInternalPackages

      public Map<String,List<String>> getAllInternalPackages()
      Presents all the packages included in all the bundles. It can be used to find "generic" libraries which are embedded in couple bundles at once. In most cases a package should be used only by a single bundle (and exported if other bundles would need it).
      Returns:
      Map of all packages within bundles followed by the names of the bundles