Class DatabaseProperties
java.lang.Object
org.owasp.dependencycheck.data.nvdcve.DatabaseProperties
This is a wrapper around a set of properties that are stored in the database.
This class is safe to be accessed from multiple threads in parallel.
- Author:
- Jeremy Long
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key for the last check time for the Known Exploited Vulnerabilities.static final StringThe key for the version the Known Exploited Vulnerabilities.static final StringThe key for the last time the CPE data was updated.static final StringThe date the NVD API was last checked for an update.static final StringThe last modified request data for the NVD API.static final StringThe date the NVD cache was last checked for an update.static final StringThe date the NVD cache data was last modified/updated.static final StringThe key for the database schema version. -
Method Summary
Modifier and TypeMethodDescriptionstatic ZonedDateTimegetIsoTimestamp(Properties properties, String key) Retrieves a zoned date time.Returns a map of the meta data from the database properties.Returns the collection of Database Properties as a properties collection.getProperty(String key) Returns the property value for the given key.getProperty(String key, String defaultValue) Returns the property value for the given key.longReturns the database property value in seconds.getTimestamp(String key) Retrieves a zoned date time.static ZonedDateTimegetTimestamp(Properties properties, String key) Retrieves a zoned date time.booleanisEmpty()Returns whether or not any properties are set.voidSaves the key value pair to the properties store.voidsave(String key, ZonedDateTime timestamp) Stores a timestamp.static voidsetTimestamp(Properties properties, String key, ZonedDateTime timestamp) Stores a timestamp in the properties file.
-
Field Details
-
NVD_API_LAST_MODIFIED
The last modified request data for the NVD API.- See Also:
-
NVD_API_LAST_CHECKED
The date the NVD API was last checked for an update.- See Also:
-
NVD_CACHE_LAST_CHECKED
The date the NVD cache was last checked for an update.- See Also:
-
NVD_CACHE_LAST_MODIFIED
The date the NVD cache data was last modified/updated.- See Also:
-
LAST_CPE_UPDATE
The key for the last time the CPE data was updated.- See Also:
-
VERSION
-
KEV_LAST_CHECKED
The key for the last check time for the Known Exploited Vulnerabilities.- See Also:
-
KEV_VERSION
The key for the version the Known Exploited Vulnerabilities.- See Also:
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns whether or not any properties are set.- Returns:
- whether or not any properties are set
-
save
-
getProperty
-
getProperty
-
getProperties
Returns the collection of Database Properties as a properties collection.- Returns:
- the collection of Database Properties
-
getMetaData
-
getTimestamp
Retrieves a zoned date time.- Parameters:
key- the property key- Returns:
- the zoned date time
-
save
Stores a timestamp.- Parameters:
key- the property keytimestamp- the zoned date time
-
setTimestamp
Stores a timestamp in the properties file.- Parameters:
properties- the properties to store the timestampkey- the property keytimestamp- the zoned date time
-
getTimestamp
Retrieves a zoned date time.- Parameters:
properties- the properties file containing the date timekey- the property key- Returns:
- the zoned date time
-
getIsoTimestamp
Retrieves a zoned date time.- Parameters:
properties- the properties file containing the date timekey- the property key- Returns:
- the zoned date time
-
getPropertyInSeconds
Returns the database property value in seconds.- Parameters:
key- the key to the property- Returns:
- the property value in seconds
-