Class RecordDataSource<T>

java.lang.Object
io.github.jeremylong.openvulnerability.client.RecordDataSource<T>
Type Parameters:
T - the data type
All Implemented Interfaces:
AutoCloseable, Iterator<T>

public class RecordDataSource<T> extends Object implements AutoCloseable, Iterator<T>
A simple wrapper around a PagedDataSource that iterates over single objects rather than a page at a time.
  • Field Details

  • Constructor Details

    • RecordDataSource

      public RecordDataSource(PagedDataSource<T> source)
      Constructs a new RecordDataSource wrapping the given paged data source.
      Parameters:
      source - the paged data source to wrap
  • Method Details

    • close

      public void close() throws Exception
      Closes the underlying data source and releases resources.
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception - if an error occurs while closing
    • getLastUpdated

      public ZonedDateTime getLastUpdated()
      Returns the latest updated date.
      Returns:
      the latest updated date
    • getLastStatusCode

      public int getLastStatusCode()
      Returns the last HTTP Status Code received.
      Returns:
      the last HTTP Status Code received.
    • hasNext

      public boolean hasNext()
      Returns true if there are more records available.
      Specified by:
      hasNext in interface Iterator<T>
      Returns:
      true if more records are available, false otherwise
    • next

      public T next()
      Returns the next record.
      Specified by:
      next in interface Iterator<T>
      Returns:
      the next record, or null if no more records are available