DescriptorCollector
.public interface DescriptorDownloader
Downloading descriptors is done in a batch which starts after setting any configuration options and initiating the download process.
Modifier and Type | Method and Description |
---|---|
void |
addDirectoryAuthority(java.lang.String nickname,
java.lang.String ip,
int dirPort)
Deprecated.
Add a directory authority to download descriptors from, which is
only required for downloading network status votes and will be used
when no directory mirrors are available.
|
void |
addDirectoryMirror(java.lang.String nickname,
java.lang.String ip,
int dirPort)
Deprecated.
Add a directory mirror to download descriptors from, which is
preferred for downloading descriptors, except for network status
votes which are only available on directory authorities.
|
java.util.Iterator<DescriptorRequest> |
downloadDescriptors()
Deprecated.
Download the previously configured relay descriptors and make them
available via the returned blocking iterator.
|
void |
setConnectTimeout(long connectTimeoutMillis)
Deprecated.
Define a connect timeout for a single request.
|
void |
setExcludeExtraInfoDescriptor(java.lang.String identifier)
Deprecated.
Exclude the extra-info descriptor with the given identifier from the
downloads even if it's referenced from a server descriptor and we're
supposed to download all referenced extra-info descriptors.
|
void |
setExcludeExtraInfoDescriptors(java.util.Set<java.lang.String> identifiers)
Deprecated.
Exclude the extra-info descriptors with the given identifiers from
the downloads even if they are referenced from server descriptors
and we're supposed to download all referenced extra-info
descriptors.
|
void |
setExcludeServerDescriptor(java.lang.String identifier)
Deprecated.
Exclude the server descriptor with the given identifier from the
downloads even if it's referenced from a consensus and we're supposed
to download all referenced server descriptors.
|
void |
setExcludeServerDescriptors(java.util.Set<java.lang.String> identifier)
Deprecated.
Exclude the server descriptors with the given identifiers from the
downloads even if they are referenced from a consensus and we're
supposed to download all referenced server descriptors.
|
void |
setFailUnrecognizedDescriptorLines()
Deprecated.
Fail descriptor parsing when encountering an unrecognized line.
|
void |
setGlobalTimeout(long globalTimeoutMillis)
Deprecated.
Define a global timeout for all requests.
|
void |
setIncludeCurrentConsensus()
Deprecated.
Include the current network status consensus in the downloads.
|
void |
setIncludeCurrentConsensusFromAllDirectoryAuthorities()
Deprecated.
Include the current network status consensus in the downloads, and
attempt to download it from all directory authorities.
|
void |
setIncludeCurrentReferencedVotes()
Deprecated.
Include the current network status votes referenced from a
previously downloaded consensus in the downloads, which requires
downloading the current consensus from at least one directory mirror
or authority.
|
void |
setIncludeCurrentVote(java.lang.String fingerprint)
Deprecated.
Include the current network status vote published by the given
directory authority in the downloads, which requires downloading from
at least one directory authority.
|
void |
setIncludeCurrentVotes(java.util.Set<java.lang.String> fingerprints)
Deprecated.
Include the current network status votes published by the given
directory authorities in the downloads, which requires downloading
from at least one directory authority.
|
void |
setIncludeReferencedExtraInfoDescriptors()
Deprecated.
Include all extra-info descriptors referenced from previously
downloaded server descriptors in the downloads.
|
void |
setIncludeReferencedServerDescriptors()
Deprecated.
Include all server descriptors referenced from a previously
downloaded network status consensus in the downloads.
|
void |
setReadTimeout(long readTimeoutMillis)
Deprecated.
Define a read timeout for a single request.
|
void addDirectoryAuthority(java.lang.String nickname, java.lang.String ip, int dirPort)
void addDirectoryMirror(java.lang.String nickname, java.lang.String ip, int dirPort)
void setIncludeCurrentConsensus()
void setIncludeCurrentConsensusFromAllDirectoryAuthorities()
The primary purpose of doing this is to compare different consensuses and download characteristics to each other. Typically, downloading from a single directory mirror or authority is sufficient.
void setIncludeCurrentReferencedVotes()
void setIncludeCurrentVote(java.lang.String fingerprint)
void setIncludeCurrentVotes(java.util.Set<java.lang.String> fingerprints)
void setIncludeReferencedServerDescriptors()
void setExcludeServerDescriptor(java.lang.String identifier)
void setExcludeServerDescriptors(java.util.Set<java.lang.String> identifier)
void setIncludeReferencedExtraInfoDescriptors()
void setExcludeExtraInfoDescriptor(java.lang.String identifier)
void setExcludeExtraInfoDescriptors(java.util.Set<java.lang.String> identifiers)
void setConnectTimeout(long connectTimeoutMillis)
If a timeout expires, no further requests will be sent to the directory authority or mirror. Setting this value to 0 disables the connect timeout. Default value is 1 minute (60 * 1000).
void setReadTimeout(long readTimeoutMillis)
If a timeout expires, no further requests will be sent to the directory authority or mirror. Setting this value to 0 disables the read timeout. Default value is 1 minute (60 * 1000).
void setGlobalTimeout(long globalTimeoutMillis)
Once this timeout expires, all running requests are aborted and no further requests are made. Setting this value to 0 disables the global timeout. Default is 1 hour (60 * 60 * 1000).
void setFailUnrecognizedDescriptorLines()
This option is not set by default, because the Tor specifications allow for new lines to be added that shall be ignored by older Tor versions. But some applications may want to handle unrecognized descriptor lines explicitly.
java.util.Iterator<DescriptorRequest> downloadDescriptors()
Whenever the downloader runs out of descriptors and expects to provide more shortly after, it blocks the caller. This method can only be run once.