Class CpeEcosystemCache


  • public final class CpeEcosystemCache
    extends java.lang.Object
    Author:
    Jeremy Long
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<Pair<java.lang.String,​java.lang.String>,​java.lang.String> getChanged()
      Returns the map of changed CPE to ecosystem mappings.
      static java.lang.String getEcosystem​(java.lang.String vendor, java.lang.String product, java.lang.String identifiedEcosystem)
      Returns the ecosystem for the given CPE (vendor, product).
      static boolean isEmpty()
      Returns true if the ecosystem cache is empty; otherwise false.
      static void setCache​(java.util.Map<Pair<java.lang.String,​java.lang.String>,​java.lang.String> cache)
      Sets the ecosystem cache and resets the changed map.
      • Methods inherited from class java.lang.Object

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

      • getEcosystem

        public static java.lang.String getEcosystem​(java.lang.String vendor,
                                                    java.lang.String product,
                                                    java.lang.String identifiedEcosystem)
        Returns the ecosystem for the given CPE (vendor, product). If the CPE has a different ecosystem previously identified the ecosystem will be updated to Multiple; otherwise, if an ecosystem is provided it will be cached for future matching.
        Parameters:
        vendor - the vendor for the CPE
        product - the product for the CPE
        identifiedEcosystem - the ecosystem identified for a CVE.
        Returns:
        the ecosystem
      • setCache

        public static void setCache​(java.util.Map<Pair<java.lang.String,​java.lang.String>,​java.lang.String> cache)
        Sets the ecosystem cache and resets the changed map.
        Parameters:
        cache - the new CPE to ecosystem mapping
      • getChanged

        public static java.util.Map<Pair<java.lang.String,​java.lang.String>,​java.lang.String> getChanged()
        Returns the map of changed CPE to ecosystem mappings.
        Returns:
        the map of changed CPE to ecosystem mappings
      • isEmpty

        public static boolean isEmpty()
        Returns true if the ecosystem cache is empty; otherwise false.
        Returns:
        true if the ecosystem cache is empty; otherwise false