Package org.lockss.laaws.rs.model
Class CdxRecords
java.lang.Object
org.lockss.laaws.rs.model.CdxRecords
A collection of [Open|Py]Wayback CDX records.
-
Constructor Summary
ConstructorsConstructorDescriptionNo-argument constructor to be used when processing PyWayBack requests.CdxRecords(Map<String, String> openWayBackQuery, String charsetName) Constructor to be used when processing OpenWayBack requests. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCdxRecord(CdxRecord cdxRecord) Adds a CDX record to this object.intProvides the count of CDX records in this object.Provides the CDX records in this object, for testing purposes.toIaText()Provides the representation of this object in Internet Archive format.toJson()Provides the representation of this object in JSON format.Writes the representation of this object in OpenWayback XML format.
-
Constructor Details
-
CdxRecords
public CdxRecords()No-argument constructor to be used when processing PyWayBack requests. -
CdxRecords
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
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
Provides the representation of this object in Internet Archive format.- Returns:
- a String with the representation of this object in Internet Archive format.
-
toXmlText
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
Provides the representation of this object in JSON format.- Returns:
- a String with the representation of this object in JSON format.
-
getCdxRecords
Provides the CDX records in this object, for testing purposes.- Returns:
- a List
with the CDX records in this object.
-