@ThreadSafe
public class DatabaseProperties
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HOSTED_SUPPRESSION_LAST_CHECKED
The key for the last check time for the hosted suppression file.
|
static java.lang.String |
KEV_LAST_CHECKED
The key for the last check time for the Known Exploited Vulnerabilities.
|
static java.lang.String |
KEV_VERSION
The key for the version the Known Exploited Vulnerabilities.
|
static java.lang.String |
LAST_CPE_UPDATE
The key for the last time the CPE data was updated.
|
static java.lang.String |
NVD_API_LAST_CHECKED
The date the NVD API was last checked for an update.
|
static java.lang.String |
NVD_API_LAST_MODIFIED
The last modified request data for the NVD API.
|
static java.lang.String |
NVD_CACHE_LAST_CHECKED
The date the NVD cache was last checked for an update.
|
static java.lang.String |
NVD_CACHE_LAST_MODIFIED
The date the NVD cache data was last modified/updated.
|
static java.lang.String |
RETIRE_LAST_CHECKED
The key for the last check time for the Retire JS repository.
|
static java.lang.String |
VERSION
The key for the database schema version.
|
| Modifier and Type | Method and Description |
|---|---|
static java.time.ZonedDateTime |
getIsoTimestamp(java.util.Properties properties,
java.lang.String key)
Retrieves a zoned date time.
|
java.util.Map<java.lang.String,java.lang.String> |
getMetaData()
Returns a map of the meta data from the database properties.
|
java.util.Properties |
getProperties()
Returns the collection of Database Properties as a properties collection.
|
java.lang.String |
getProperty(java.lang.String key)
Returns the property value for the given key.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the property value for the given key.
|
long |
getPropertyInSeconds(java.lang.String key)
Returns the database property value in seconds.
|
static java.time.ZonedDateTime |
getTimestamp(java.util.Properties properties,
java.lang.String key)
Retrieves a zoned date time.
|
java.time.ZonedDateTime |
getTimestamp(java.lang.String key)
Retrieves a zoned date time.
|
boolean |
isEmpty()
Returns whether or not any properties are set.
|
void |
save(java.lang.String key,
java.lang.String value)
Saves the key value pair to the properties store.
|
void |
save(java.lang.String key,
java.time.ZonedDateTime timestamp)
Stores a timestamp.
|
static void |
setTimestamp(java.util.Properties properties,
java.lang.String key,
java.time.ZonedDateTime timestamp)
Stores a timestamp in the properties file.
|
public static final java.lang.String NVD_API_LAST_MODIFIED
public static final java.lang.String NVD_API_LAST_CHECKED
public static final java.lang.String NVD_CACHE_LAST_CHECKED
public static final java.lang.String NVD_CACHE_LAST_MODIFIED
public static final java.lang.String LAST_CPE_UPDATE
public static final java.lang.String VERSION
public static final java.lang.String KEV_LAST_CHECKED
public static final java.lang.String RETIRE_LAST_CHECKED
public static final java.lang.String HOSTED_SUPPRESSION_LAST_CHECKED
public static final java.lang.String KEV_VERSION
public boolean isEmpty()
public void save(java.lang.String key,
java.lang.String value)
throws UpdateException
key - the property keyvalue - the property valueUpdateException - is thrown if there is an update exceptionpublic java.lang.String getProperty(java.lang.String key)
key - the property keypublic java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
key - the property keydefaultValue - the default valuepublic java.util.Properties getProperties()
public java.util.Map<java.lang.String,java.lang.String> getMetaData()
public java.time.ZonedDateTime getTimestamp(java.lang.String key)
key - the property keypublic void save(java.lang.String key,
java.time.ZonedDateTime timestamp)
throws UpdateException
key - the property keytimestamp - the zoned date timeUpdateExceptionpublic static void setTimestamp(java.util.Properties properties,
java.lang.String key,
java.time.ZonedDateTime timestamp)
throws UpdateException
properties - the properties to store the timestampkey - the property keytimestamp - the zoned date timeUpdateExceptionpublic static java.time.ZonedDateTime getTimestamp(java.util.Properties properties,
java.lang.String key)
properties - the properties file containing the date timekey - the property keypublic static java.time.ZonedDateTime getIsoTimestamp(java.util.Properties properties,
java.lang.String key)
properties - the properties file containing the date timekey - the property keypublic long getPropertyInSeconds(java.lang.String key)
key - the key to the propertyCopyright© 2012-21 Jeremy Long. All Rights Reserved.