Class RelayDescriptorParser
- java.lang.Object
-
- org.torproject.metrics.collector.relaydescs.RelayDescriptorParser
-
public class RelayDescriptorParser extends java.lang.Object
Parses relay descriptors including network status consensuses and votes, server and extra-info descriptors, and passes the results to the stats handlers, to the archive writer, or to the relay descriptor downloader.
-
-
Constructor Summary
Constructors Constructor Description RelayDescriptorParser(ArchiveWriter aw)
Initializes this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
parse(byte[] data, java.io.File containingFile)
Parses the given bytes to find out the contained descriptor type, forwards them to the archive writer to store them to disk, and tells the relay descriptor downloader and archive reader about the contained descriptor and all referenced descriptors.void
setArchiveReader(ArchiveReader ar)
void
setRelayDescriptorDownloader(RelayDescriptorDownloader rdd)
void
storeMicrodescriptor(byte[] data, java.lang.String digest256Hex, java.lang.String digest256Base64, long validAfter)
Forwards the given microdescriptor to the archive writer to store it to disk and tells the relay descriptor downloader that this microdescriptor is not missing anymore.
-
-
-
Constructor Detail
-
RelayDescriptorParser
public RelayDescriptorParser(ArchiveWriter aw)
Initializes this class.
-
-
Method Detail
-
setRelayDescriptorDownloader
public void setRelayDescriptorDownloader(RelayDescriptorDownloader rdd)
-
setArchiveReader
public void setArchiveReader(ArchiveReader ar)
-
parse
public boolean parse(byte[] data, java.io.File containingFile)
Parses the given bytes to find out the contained descriptor type, forwards them to the archive writer to store them to disk, and tells the relay descriptor downloader and archive reader about the contained descriptor and all referenced descriptors.
-
storeMicrodescriptor
public void storeMicrodescriptor(byte[] data, java.lang.String digest256Hex, java.lang.String digest256Base64, long validAfter)
Forwards the given microdescriptor to the archive writer to store it to disk and tells the relay descriptor downloader that this microdescriptor is not missing anymore.
-
-