Package org.torproject.descriptor
Interface RelayNetworkStatusConsensus
-
- All Superinterfaces:
Descriptor
,java.io.Serializable
public interface RelayNetworkStatusConsensus extends Descriptor
Contains a network status consensus in the version 3 directory protocol.Directory authorities in the version 3 of the directory protocol periodically generate a view of the current descriptors and status for known relays and send a signed summary of this view to the other authorities (
RelayNetworkStatusVote
). The authorities compute the result of this vote and sign a network status consensus containing the result of the vote, which is this document.Clients use consensus documents to find out when their list of relays is out-of-date by looking at the contained network status entries (
NetworkStatusEntry
). If it is, they download any missing server descriptors (ServerDescriptor
).- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
containsStatusEntry(java.lang.String fingerprint)
Return whether a status entry with the given relay fingerprint (SHA-1 digest of the server's public identity key, encoded as 40 upper-case hexadecimal characters) exists; convenience method forgetStatusEntries().containsKey(fingerprint)
.java.util.SortedMap<java.lang.String,java.lang.Integer>
getBandwidthWeights()
Return optional weights to be applied to router bandwidths during path selection with map keys being case-sensitive weight identifiers and map values being weight values, or null if the consensus doesn't contain such weights.java.lang.String
getConsensusFlavor()
Return the consensus flavor name, which denotes the variant of the original, unflavored consensus, encoded as a string of alphanumeric characters and dashes, or null if this descriptor is the unflavored consensus.int
getConsensusMethod()
Return the consensus method number of this descriptor, which is the highest consensus method supported by more than 2/3 of voting authorities, or 0 if no consensus method is contained in the descriptor.java.util.SortedMap<java.lang.String,java.lang.Integer>
getConsensusParams()
Return consensus parameters contained in this descriptor with map keys being case-sensitive parameter identifiers and map values being parameter values, or null if the consensus doesn't contain consensus parameters.java.lang.String
getDigestSha1Hex()
Return the SHA-1 digest of this consensus, encoded as 40 lower-case hexadecimal characters that directory authorities use to sign the consensus.java.util.SortedMap<java.lang.String,DirSourceEntry>
getDirSourceEntries()
Return directory source entries for each directory authority that contributed to the consensus, with map keys being SHA-1 digests of the authorities' identity keys in the version 3 directory protocol, encoded as 40 upper-case hexadecimal characters.long
getDistSeconds()
Return the number of seconds that the directory authorities will allow to collect signatures from the other authorities when producing the next consensus.long
getFreshUntilMillis()
Return the time in milliseconds since the epoch until which this descriptor is the freshest that is available.java.util.SortedSet<java.lang.String>
getKnownFlags()
Return known relay flags in this descriptor that were contained in enough votes for this consensus to be an authoritative opinion for these relay flags.int
getNetworkStatusVersion()
Return the document format version of this descriptor which is 3 or higher.java.util.List<java.lang.String>
getPackageLines()
Return a list of software packages and their versions together with a URL and one or more digests in the formatPackageName Version URL DIGESTS
that are known by at least three directory authorities and agreed upon by the majority of directory authorities, or null if the consensus does not contain package information.java.util.SortedMap<java.lang.String,java.util.SortedSet<java.lang.Long>>
getRecommendedClientProtocols()
Return the version numbers of all protocols that clients should support, or null if the consensus does not contain an opinion about protocol versions.java.util.List<java.lang.String>
getRecommendedClientVersions()
Return recommended Tor versions for client usage, or null if the consensus does not contain an opinion about client versions.java.util.SortedMap<java.lang.String,java.util.SortedSet<java.lang.Long>>
getRecommendedRelayProtocols()
Return the version numbers of all protocols that relays should support, or null if the consensus does not contain an opinion about protocol versions.java.util.List<java.lang.String>
getRecommendedServerVersions()
Return recommended Tor versions for server usage, or null if the consensus does not contain an opinion about server versions.java.util.SortedMap<java.lang.String,java.util.SortedSet<java.lang.Long>>
getRequiredClientProtocols()
Return the version numbers of all protocols that clients must support, or null if the consensus does not contain an opinion about protocol versions.java.util.SortedMap<java.lang.String,java.util.SortedSet<java.lang.Long>>
getRequiredRelayProtocols()
Return the version numbers of all protocols that relays must support, or null if the consensus does not contain an opinion about protocol versions.int
getSharedRandCurrentNumReveals()
Return the number of commits used to generate the latest shared random value, or -1 if the consensus does not contain the latest shared random value.java.lang.String
getSharedRandCurrentValue()
Return the latest shared random value, encoded in base64, or null if the consensus does not contain the latest shared random value.int
getSharedRandPreviousNumReveals()
Return the number of commits used to generate the second-to-last shared random value, or -1 if the consensus does not contain a second-to-last shared random value.java.lang.String
getSharedRandPreviousValue()
Return the second-to-last shared random value, encoded in base64, or null if the consensus does not contain a second-to-last shared random value.java.util.List<DirectorySignature>
getSignatures()
Return the list of signatures contained in this consensus.java.util.SortedMap<java.lang.String,NetworkStatusEntry>
getStatusEntries()
Return status entries for each contained server, with map keys being SHA-1 digests of the servers' public identity keys, encoded as 40 upper-case hexadecimal characters.NetworkStatusEntry
getStatusEntry(java.lang.String fingerprint)
Return a status entry by relay fingerprint (SHA-1 digest of the server's public identity key, encoded as 40 upper-case hexadecimal characters), or null if no such status entry exists; convenience method forgetStatusEntries().get(fingerprint)
.long
getValidAfterMillis()
Return the time in milliseconds since the epoch at which this descriptor became valid.long
getValidUntilMillis()
Return the time in milliseconds since the epoch until which this descriptor was valid.long
getVoteSeconds()
Return the number of seconds that the directory authorities will allow to collect votes from the other authorities when producing the next consensus.-
Methods inherited from interface org.torproject.descriptor.Descriptor
getAnnotations, getDescriptorFile, getRawDescriptorBytes, getRawDescriptorLength, getUnrecognizedLines
-
-
-
-
Method Detail
-
getNetworkStatusVersion
int getNetworkStatusVersion()
Return the document format version of this descriptor which is 3 or higher.- Since:
- 1.0.0
-
getConsensusFlavor
java.lang.String getConsensusFlavor()
Return the consensus flavor name, which denotes the variant of the original, unflavored consensus, encoded as a string of alphanumeric characters and dashes, or null if this descriptor is the unflavored consensus.- Since:
- 1.0.0
-
getConsensusMethod
int getConsensusMethod()
Return the consensus method number of this descriptor, which is the highest consensus method supported by more than 2/3 of voting authorities, or 0 if no consensus method is contained in the descriptor.- Since:
- 1.0.0
-
getValidAfterMillis
long getValidAfterMillis()
Return the time in milliseconds since the epoch at which this descriptor became valid.- Since:
- 1.0.0
-
getFreshUntilMillis
long getFreshUntilMillis()
Return the time in milliseconds since the epoch until which this descriptor is the freshest that is available.- Since:
- 1.0.0
-
getValidUntilMillis
long getValidUntilMillis()
Return the time in milliseconds since the epoch until which this descriptor was valid.- Since:
- 1.0.0
-
getVoteSeconds
long getVoteSeconds()
Return the number of seconds that the directory authorities will allow to collect votes from the other authorities when producing the next consensus.- Since:
- 1.0.0
-
getDistSeconds
long getDistSeconds()
Return the number of seconds that the directory authorities will allow to collect signatures from the other authorities when producing the next consensus.- Since:
- 1.0.0
-
getRecommendedServerVersions
java.util.List<java.lang.String> getRecommendedServerVersions()
Return recommended Tor versions for server usage, or null if the consensus does not contain an opinion about server versions.- Since:
- 1.0.0
-
getRecommendedClientVersions
java.util.List<java.lang.String> getRecommendedClientVersions()
Return recommended Tor versions for client usage, or null if the consensus does not contain an opinion about client versions.- Since:
- 1.0.0
-
getRecommendedClientProtocols
java.util.SortedMap<java.lang.String,java.util.SortedSet<java.lang.Long>> getRecommendedClientProtocols()
Return the version numbers of all protocols that clients should support, or null if the consensus does not contain an opinion about protocol versions.- Since:
- 1.6.0
-
getRecommendedRelayProtocols
java.util.SortedMap<java.lang.String,java.util.SortedSet<java.lang.Long>> getRecommendedRelayProtocols()
Return the version numbers of all protocols that relays should support, or null if the consensus does not contain an opinion about protocol versions.- Since:
- 1.6.0
-
getRequiredClientProtocols
java.util.SortedMap<java.lang.String,java.util.SortedSet<java.lang.Long>> getRequiredClientProtocols()
Return the version numbers of all protocols that clients must support, or null if the consensus does not contain an opinion about protocol versions.- Since:
- 1.6.0
-
getRequiredRelayProtocols
java.util.SortedMap<java.lang.String,java.util.SortedSet<java.lang.Long>> getRequiredRelayProtocols()
Return the version numbers of all protocols that relays must support, or null if the consensus does not contain an opinion about protocol versions.- Since:
- 1.6.0
-
getPackageLines
java.util.List<java.lang.String> getPackageLines()
Return a list of software packages and their versions together with a URL and one or more digests in the formatPackageName Version URL DIGESTS
that are known by at least three directory authorities and agreed upon by the majority of directory authorities, or null if the consensus does not contain package information.- Since:
- 1.3.0
-
getKnownFlags
java.util.SortedSet<java.lang.String> getKnownFlags()
Return known relay flags in this descriptor that were contained in enough votes for this consensus to be an authoritative opinion for these relay flags.- Since:
- 1.0.0
-
getConsensusParams
java.util.SortedMap<java.lang.String,java.lang.Integer> getConsensusParams()
Return consensus parameters contained in this descriptor with map keys being case-sensitive parameter identifiers and map values being parameter values, or null if the consensus doesn't contain consensus parameters.- Since:
- 1.0.0
-
getSharedRandPreviousNumReveals
int getSharedRandPreviousNumReveals()
Return the number of commits used to generate the second-to-last shared random value, or -1 if the consensus does not contain a second-to-last shared random value.- Since:
- 1.6.0
-
getSharedRandPreviousValue
java.lang.String getSharedRandPreviousValue()
Return the second-to-last shared random value, encoded in base64, or null if the consensus does not contain a second-to-last shared random value.- Since:
- 1.6.0
-
getSharedRandCurrentNumReveals
int getSharedRandCurrentNumReveals()
Return the number of commits used to generate the latest shared random value, or -1 if the consensus does not contain the latest shared random value.- Since:
- 1.6.0
-
getSharedRandCurrentValue
java.lang.String getSharedRandCurrentValue()
Return the latest shared random value, encoded in base64, or null if the consensus does not contain the latest shared random value.- Since:
- 1.6.0
-
getDirSourceEntries
java.util.SortedMap<java.lang.String,DirSourceEntry> getDirSourceEntries()
Return directory source entries for each directory authority that contributed to the consensus, with map keys being SHA-1 digests of the authorities' identity keys in the version 3 directory protocol, encoded as 40 upper-case hexadecimal characters.- Since:
- 1.0.0
-
getStatusEntries
java.util.SortedMap<java.lang.String,NetworkStatusEntry> getStatusEntries()
Return status entries for each contained server, with map keys being SHA-1 digests of the servers' public identity keys, encoded as 40 upper-case hexadecimal characters.- Since:
- 1.0.0
-
containsStatusEntry
boolean containsStatusEntry(java.lang.String fingerprint)
Return whether a status entry with the given relay fingerprint (SHA-1 digest of the server's public identity key, encoded as 40 upper-case hexadecimal characters) exists; convenience method forgetStatusEntries().containsKey(fingerprint)
.- Since:
- 1.0.0
-
getStatusEntry
NetworkStatusEntry getStatusEntry(java.lang.String fingerprint)
Return a status entry by relay fingerprint (SHA-1 digest of the server's public identity key, encoded as 40 upper-case hexadecimal characters), or null if no such status entry exists; convenience method forgetStatusEntries().get(fingerprint)
.- Since:
- 1.0.0
-
getSignatures
java.util.List<DirectorySignature> getSignatures()
Return the list of signatures contained in this consensus.- Since:
- 1.3.0
-
getBandwidthWeights
java.util.SortedMap<java.lang.String,java.lang.Integer> getBandwidthWeights()
Return optional weights to be applied to router bandwidths during path selection with map keys being case-sensitive weight identifiers and map values being weight values, or null if the consensus doesn't contain such weights.- Since:
- 1.0.0
-
getDigestSha1Hex
java.lang.String getDigestSha1Hex()
Return the SHA-1 digest of this consensus, encoded as 40 lower-case hexadecimal characters that directory authorities use to sign the consensus.- Since:
- 1.7.0
-
-