Package org.torproject.descriptor
Interface Descriptor
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
BandwidthFile,BridgedbMetrics,BridgeExtraInfoDescriptor,BridgeNetworkStatus,BridgePoolAssignment,BridgeServerDescriptor,BridgestrapStats,DirectoryKeyCertificate,ExitList,ExtraInfoDescriptor,GeoipFile,GeoipNamesFile,LogDescriptor,Microdescriptor,RelayDirectory,RelayExtraInfoDescriptor,RelayNetworkStatus,RelayNetworkStatusConsensus,RelayNetworkStatusVote,RelayServerDescriptor,ServerDescriptor,SnowflakeStats,TorperfResult,UnparseableDescriptor,WebServerAccessLog
public interface Descriptor extends java.io.SerializableSuperinterface for any descriptor with access to generic information about the descriptor.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.lang.String>getAnnotations()Return the (possibly empty) list of annotations in the format"@key( value)*".java.io.FilegetDescriptorFile()Return the file, tarball or plain file, that contained this descriptor, ornullif this descriptor was not read from a file.byte[]getRawDescriptorBytes()Return the raw descriptor bytes.intgetRawDescriptorLength()Return the raw descriptor length in bytes.java.util.List<java.lang.String>getUnrecognizedLines()Return any unrecognized lines when parsing this descriptor, or an empty list if there were no unrecognized lines.
-
-
-
Method Detail
-
getRawDescriptorBytes
byte[] getRawDescriptorBytes()
Return the raw descriptor bytes.This method creates a new copy of raw descriptor bytes from a potentially larger byte array containing multiple descriptors. Applications that only want to learn about raw descriptor length in bytes should instead use
getRawDescriptorLength().- Since:
- 1.0.0
-
getRawDescriptorLength
int getRawDescriptorLength()
Return the raw descriptor length in bytes.Returns the exact same result as
getRawDescriptorBytes().length, but much more efficiently.- Since:
- 1.9.0
-
getAnnotations
java.util.List<java.lang.String> getAnnotations()
Return the (possibly empty) list of annotations in the format"@key( value)*".Some implementations might not support this operation and will throw an
UnsupportedOperationException, e.g.,UnparseableDescriptor.- Since:
- 1.0.0
-
getUnrecognizedLines
java.util.List<java.lang.String> getUnrecognizedLines()
Return any unrecognized lines when parsing this descriptor, or an empty list if there were no unrecognized lines.Some implementations might not support this operation and will throw an
UnsupportedOperationException, e.g.,UnparseableDescriptor.- Since:
- 1.0.0
-
getDescriptorFile
java.io.File getDescriptorFile()
Return the file, tarball or plain file, that contained this descriptor, ornullif this descriptor was not read from a file.- Returns:
- Descriptor file that contained this descriptor.
- Since:
- 1.9.0
-
-