com.ibm.dbb.dependency

Class SearchPathImpactFinder

  • java.lang.Object
    • com.ibm.dbb.dependency.SearchPathImpactFinder


  • public class SearchPathImpactFinder
    extends java.lang.Object
    The SearchPathImpactFinder class is used to search the DBB Web Application repository collections for any programs or intermediate source files that contains a reference to a changed source file. The returned list of impacted files from the resolveImpactedFiles method can then be used to determine which programs should be rebuilt due to a updated build dependency.

    Search path
    The SearchPathImpactFinder constructor requires a searchPath argument that is a simple formatted String used to identify what changed files should impact analysis be performed on. Examples of search paths are listed below.

    // Search path using specific file extensions
    String copybookImpacts = "search:/u/build/repo?path=** /*.cpy;** /*.copy";

    // Targeted search path with specific directories
    String copybookImpacts = "search:/u/build/repo?path=MortgageApplication/copybook/*.cpy";

    • Constructor Summary

      Constructors 
      Constructor and Description
      SearchPathImpactFinder(java.lang.String searchPath, java.util.List<java.lang.String> collections, IRepositoryClient repositoryClient)
      Used to create an instance of the SearchPathImpactFinder
      SearchPathImpactFinder(java.lang.String searchPath, java.util.List<java.lang.String> collections, RepositoryClient repositoryClient, boolean disableCache)
      Used to create an instance of the SearchPathImpactFinder
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.Set<ImpactFile> findImpactedFiles(java.lang.String changedFile, java.lang.String sourceDir)
      This method uses the #getLogicalFile(String, String, boolean) method to retrieve the file's list of {@link LogicalDependency} to resolve.
      java.util.List<java.lang.String> getCollections()
      Returns the list of collections for the impact finder
      IRepositoryClient getRepositoryClient()
      Returns the RepositoryClient for the impact finder
      java.lang.String getSearchPath()
      Returns the dependency search path for the impact finder
      boolean isDisableCache()
      Returns true if the LogicalFile cache is disabled.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SearchPathImpactFinder

        public SearchPathImpactFinder(java.lang.String searchPath,
                                      java.util.List<java.lang.String> collections,
                                      IRepositoryClient repositoryClient)
        Used to create an instance of the SearchPathImpactFinder
        Parameters:
        searchPath - Dependency search path
        collections - A list of DBB collections to run impact queries against
        respositoryClient - An instance of RepositoryClient configured to communicate with the DBB Web Application
      • SearchPathImpactFinder

        public SearchPathImpactFinder(java.lang.String searchPath,
                                      java.util.List<java.lang.String> collections,
                                      RepositoryClient repositoryClient,
                                      boolean disableCache)
        Used to create an instance of the SearchPathImpactFinder
        Parameters:
        searchPath - Dependency search path
        collections - A list of DBB collections to run impact queries against
        respositoryClient - An instance of RepositoryClient configured to communicate with the DBB Web Application
        disableCache - Used to disable the logical file cache.
    • Method Detail

      • findImpactedFiles

        public java.util.Set<ImpactFile> findImpactedFiles(java.lang.String changedFile,
                                                           java.lang.String sourceDir)
                                                    throws BuildException,
                                                           DependencyException,
                                                           java.io.IOException,
                                                           ConnectionException
        This method uses the #getLogicalFile(String, String, boolean) method to retrieve the file's list of {@link LogicalDependency} to resolve.
        Parameters:
        changedFile - The changed source file to do impact analysis on
        sourceDir - The source directory which contains the source file
        Returns:
        a list of ImpactFile for each source file impacted by this file being changed
        Throws:
        BuildException - If no scanner for the source file is not registered
        DependencyException - If an error occurs during dependency resolution
        java.io.IOException - If an IO error occurs during dependency resolution
        ConnectionException - If a connection to the DBB web application cannot be made
      • getSearchPath

        public java.lang.String getSearchPath()
        Returns the dependency search path for the impact finder
      • getCollections

        public java.util.List<java.lang.String> getCollections()
        Returns the list of collections for the impact finder
      • getRepositoryClient

        public IRepositoryClient getRepositoryClient()
        Returns the RepositoryClient for the impact finder
      • isDisableCache

        public boolean isDisableCache()
        Returns true if the LogicalFile cache is disabled.

<IBM Copyright © 2018 IBM Corp. All Rights Reserved.