Class CdxRecords

java.lang.Object
org.lockss.laaws.rs.model.CdxRecords

public class CdxRecords extends Object
A collection of [Open|Py]Wayback CDX records.
  • Constructor Details

    • CdxRecords

      public CdxRecords()
      No-argument constructor to be used when processing PyWayBack requests.
    • CdxRecords

      public CdxRecords(Map<String,String> openWayBackQuery, String charsetName)
      Constructor to be used when processing OpenWayBack requests.
      Parameters:
      openWayBackQuery - A Map<String, String> with the OpenWayBack request query elements.
      charsetName - A String with the character set name to be used for XML generation.
  • Method Details

    • addCdxRecord

      public void addCdxRecord(CdxRecord cdxRecord)
      Adds a CDX record to this object.
      Parameters:
      cdxRecord - A CdxRecord with the CDX record to be added.
    • getCdxRecordCount

      public int getCdxRecordCount()
      Provides the count of CDX records in this object.
      Returns:
      an int with the count of CDX records in this object.
    • toIaText

      public String toIaText()
      Provides the representation of this object in Internet Archive format.
      Returns:
      a String with the representation of this object in Internet Archive format.
    • toXmlText

      public String toXmlText() throws XMLStreamException
      Writes the representation of this object in OpenWayback XML format.
      Returns:
      a String with the representation of this object in OpenWayBack XML format.
      Throws:
      XMLStreamException - if there are problems writing the XML element.
    • toJson

      public String toJson()
      Provides the representation of this object in JSON format.
      Returns:
      a String with the representation of this object in JSON format.
    • getCdxRecords

      public List<CdxRecord> getCdxRecords()
      Provides the CDX records in this object, for testing purposes.
      Returns:
      a List with the CDX records in this object.