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.data.update
Class Updateable

    java.lang.Object
      org.owasp.dependencycheck.data.update.Updateable

All Implemented Interfaces:
  Iterable<NvdCveInfo>, Iterator<NvdCveInfo>

    public class Updateable

extends Object
implements Iterable<NvdCveInfo>, Iterator<NvdCveInfo>

Contains a collection of updateable NvdCveInfo objects. This is used to determine which files need to be downloaded and processed.

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

Constructor Summary
`Updateable()`

Method Summary
`void` | `add(String id, String url, String oldUrl)` Adds a new entry of updateable information to the contained collection.
`void` | `add(String id, String url, String oldUrl, boolean needsUpdate)` Adds a new entry of updateable information to the contained collection.
`void` | `clear()` Clears the contained collection of NvdCveInfo entries.
`protected Map<String,NvdCveInfo>` | `getCollection()` Returns the collection of NvdCveInfo objects.
`long` | `getTimeStamp(String key)` Returns the timestamp for the given entry.
`boolean` | `hasNext()` Returns whether or not there is another item in the collection.
`boolean` | `isUpdateNeeded()` Gets whether or not an update is needed.
`Iterator<NvdCveInfo>` | `iterator()` Returns an iterator for the NvdCveInfo contained.
`NvdCveInfo` | `next()` Returns the next item in the collection.
`void` | `remove()` Removes the current NvdCveInfo object from the collection.
`String` | `toString()`

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

Constructor Detail

### Updateable

    public Updateable()

Method Detail

### getCollection

    protected Map<String,NvdCveInfo> getCollection()

  Returns the collection of NvdCveInfo objects. This method is mainly used for testing.

  Returns:
    the collection of NvdCveInfo objects

### isUpdateNeeded

    public boolean isUpdateNeeded()

  Gets whether or not an update is needed.

  Returns:
    true or false depending on whether an update is needed

### add

    public void add(String id,
                    String url,
                    String oldUrl)
             throws MalformedURLException,
                    DownloadFailedException

  Adds a new entry of updateable information to the contained collection.

  Parameters:
    `id` - the key for the item to be added
    `url` - the URL to download the item
    `oldUrl` - the URL for the old version of the item (the NVD CVE old schema still contains useful data we need).
  Throws:
    `MalformedURLException` - thrown if the URL provided is invalid
    `DownloadFailedException` - thrown if the download fails.

### add

    public void add(String id,
                    String url,
                    String oldUrl,
                    boolean needsUpdate)
             throws MalformedURLException,
                    DownloadFailedException

  Adds a new entry of updateable information to the contained collection.

  Parameters:
    `id` - the key for the item to be added
    `url` - the URL to download the item
    `oldUrl` - the URL for the old version of the item (the NVD CVE old schema still contains useful data we need).
    `needsUpdate` - whether or not the data needs to be updated
  Throws:
    `MalformedURLException` - thrown if the URL provided is invalid
    `DownloadFailedException` - thrown if the download fails.

### clear

    public void clear()

  Clears the contained collection of NvdCveInfo entries.

### getTimeStamp

    public long getTimeStamp(String key)

  Returns the timestamp for the given entry.

  Parameters:
    `key` - the key to lookup in the collection of NvdCveInfo items
  Returns:
    the timestamp for the given entry

### iterator

    public Iterator<NvdCveInfo> iterator()

  Returns an iterator for the NvdCveInfo contained.

  This method is not thread safe.

  Specified by:
    `iterator` in interface `Iterable<NvdCveInfo>`
  Returns:
    an NvdCveInfo Iterator

### hasNext

    public boolean hasNext()

  Returns whether or not there is another item in the collection.

  This method is not thread safe.

  Specified by:
    `hasNext` in interface `Iterator<NvdCveInfo>`
  Returns:
    true or false depending on whether or not another item exists in the collection

### next

    public NvdCveInfo next()

  Returns the next item in the collection.

  This method is not thread safe.

  Specified by:
    `next` in interface `Iterator<NvdCveInfo>`
  Returns:
    the next NvdCveInfo item in the collection

### remove

    public void remove()

  Removes the current NvdCveInfo object from the collection.

  This method is not thread safe.

  Specified by:
    `remove` in interface `Iterator<NvdCveInfo>`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

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.