Class NodeAuditSearch


  • @ThreadSafe
    public class NodeAuditSearch
    extends java.lang.Object
    Class of methods to search via Node Audit API.
    Author:
    Steve Springett
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeAuditSearch​(Settings settings)
      Creates a NodeAuditSearch for the given repository URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Advisory> submitPackage​(javax.json.JsonObject packageJson)
      Submits the package.json file to the Node Audit API and returns a list of zero or more Advisories.
      • Methods inherited from class java.lang.Object

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

      • NodeAuditSearch

        public NodeAuditSearch​(Settings settings)
                        throws java.net.MalformedURLException
        Creates a NodeAuditSearch for the given repository URL.
        Parameters:
        settings - the configured settings
        Throws:
        java.net.MalformedURLException - thrown if the configured URL is invalid
    • Method Detail

      • submitPackage

        public java.util.List<Advisory> submitPackage​(javax.json.JsonObject packageJson)
                                               throws SearchException,
                                                      java.io.IOException
        Submits the package.json file to the Node Audit API and returns a list of zero or more Advisories.
        Parameters:
        packageJson - the package.json file retrieved from the Dependency
        Returns:
        a List of zero or more Advisory object
        Throws:
        SearchException - if Node Audit API is unable to analyze the package
        java.io.IOException - if it's unable to connect to Node Audit API