Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.owasp.dependencycheck.analyzer
Class NvdCveAnalyzer

    java.lang.Object
      org.owasp.dependencycheck.analyzer.NvdCveAnalyzer

All Implemented Interfaces:
  Analyzer

    public class NvdCveAnalyzer

extends Object
implements Analyzer

NvdCveAnalyzer is a utility class that takes a project dependency and attempts to discern if there is an associated CVEs. It uses the the identifiers found by other analyzers to lookup the CVE data.

Author:
  Jeremy Long (jeremy.long@owasp.org)

Constructor Summary
`NvdCveAnalyzer()`

Method Summary
`void` | `analyze(Dependency dependency, Engine engine)` Analyzes a dependency and attempts to determine if there are any CPE identifiers for this dependency.
`void` | `close()` Closes the data source.
`protected void` | `finalize()` Ensures that the CVE Database is closed.
`AnalysisPhase` | `getAnalysisPhase()` Returns the analysis phase that this analyzer should run in.
`String` | `getName()` Returns the name of this analyzer.
`Set<String>` | `getSupportedExtensions()` Returns true because this analyzer supports all dependency types.
`void` | `initialize()` Opens the NVD CVE Lucene Index.
`boolean` | `isOpen()` Returns the status of the data source - is the database open.
`void` | `open()` Opens the data source.
`boolean` | `supportsExtension(String extension)` Returns true because this analyzer supports all dependency types.

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### NvdCveAnalyzer

    public NvdCveAnalyzer()

Method Detail

### open

    public void open()
              throws SQLException,
                     IOException,
                     DatabaseException,
                     ClassNotFoundException

  Opens the data source.

  Throws:
    `SQLException` - thrown when there is a SQL Exception
    `IOException` - thrown when there is an IO Exception
    `DatabaseException` - thrown when there is a database exceptions
    `ClassNotFoundException` - thrown if the h2 database driver cannot be loaded

### close

    public void close()

  Closes the data source.

  Specified by:
    `close` in interface `Analyzer`

### isOpen

    public boolean isOpen()

  Returns the status of the data source - is the database open.

  Returns:
    true or false.

### finalize

    protected void finalize()
                     throws Throwable

  Ensures that the CVE Database is closed.

  Overrides:
    `finalize` in class `Object`
  Throws:
    `Throwable` - when a throwable is thrown.

### analyze

    public void analyze(Dependency dependency,
                        Engine engine)
                 throws AnalysisException

  Analyzes a dependency and attempts to determine if there are any CPE identifiers for this dependency.

  Specified by:
    `analyze` in interface `Analyzer`
  Parameters:
    `dependency` - The Dependency to analyze
    `engine` - The analysis engine
  Throws:
    `AnalysisException` - is thrown if there is an issue analyzing the dependency

### getSupportedExtensions

    public Set<String> getSupportedExtensions()

  Returns true because this analyzer supports all dependency types.

  Specified by:
    `getSupportedExtensions` in interface `Analyzer`
  Returns:
    true.

### getName

    public String getName()

  Returns the name of this analyzer.

  Specified by:
    `getName` in interface `Analyzer`
  Returns:
    the name of this analyzer.

### supportsExtension

    public boolean supportsExtension(String extension)

  Returns true because this analyzer supports all dependency types.

  Specified by:
    `supportsExtension` in interface `Analyzer`
  Parameters:
    `extension` - the file extension of the dependency being analyzed.
  Returns:
    true.

### getAnalysisPhase

    public AnalysisPhase getAnalysisPhase()

  Returns the analysis phase that this analyzer should run in.

  Specified by:
    `getAnalysisPhase` in interface `Analyzer`
  Returns:
    the analysis phase that this analyzer should run in.

### initialize

    public void initialize()
                    throws Exception

  Opens the NVD CVE Lucene Index.

  Specified by:
    `initialize` in interface `Analyzer`
  Throws:
    `Exception` - is thrown if there is an issue opening the index.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012-2013 OWASP. All Rights Reserved.