adding vulnerable software

Former-commit-id: 2fbc588a90c8d11f2fa0f806fb14f6b31fddcbea
This commit is contained in:
Jeremy Long
2012-12-30 09:46:21 -05:00
parent 3c62f8501c
commit 7a4ba451ad

View File

@@ -103,4 +103,63 @@ public class Vulnerability {
public void addReference(Reference ref) {
this.references.add(ref);
}
/**
* Adds a reference
* @param referenceSource the source of the referece
* @param referenceName the referenceName of the reference
* @param referenceUrl the url of the reference
*/
public void addReference(String referenceSource, String referenceName, String referenceUrl) {
Reference ref = new Reference();
ref.setSource(referenceSource);
ref.setName(referenceName);
ref.setUrl(referenceUrl);
this.references.add(ref);
}
/**
* a list of vulnerable software
*/
protected List<VulnerableSoftware> vulnerableSoftware;
/**
* Get the value of vulnerableSoftware
*
* @return the value of vulnerableSoftware
*/
public List<VulnerableSoftware> getVulnerableSoftware() {
return vulnerableSoftware;
}
/**
* Set the value of vulnerableSoftware
*
* @param vulnerableSoftware new value of vulnerableSoftware
*/
public void setVulnerableSoftware(List<VulnerableSoftware> vulnerableSoftware) {
this.vulnerableSoftware = vulnerableSoftware;
}
/**
* Adds an entry for vulnerable software
* @param cpe string representation of a cpe
* @param previousVersion the previous version (previousVersion - cpe would be considered vulnerable)
*/
public void addVulnerableSoftware(String cpe, String previousVersion) {
VulnerableSoftware vs = new VulnerableSoftware();
vs.setCpe(cpe);
if (previousVersion != null) {
vs.setPreviousVersion(previousVersion);
}
}
/**
* Adds an entry for vulnerable software
* @param cpe string representation of a CPE entry
*/
public void addVulnerableSoftware(String cpe) {
addVulnerableSoftware(cpe, null);
}
}