public abstract class DescriptorPersistence<T extends org.torproject.descriptor.Descriptor>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
annotationBytes |
protected static java.lang.String |
BRIDGEDBSTATS |
protected static java.lang.String |
BRIDGEDESCS |
protected static java.lang.String |
BRIDGEPOOLASSIGNMENTS |
protected static java.lang.String |
DASH |
protected T |
desc |
protected byte[] |
descriptorBytes |
protected static java.lang.String |
DOT |
protected static byte[] |
EMPTY_ANNOTATION |
protected static java.lang.String |
EXTRA_INFO |
protected static java.lang.String |
EXTRA_INFOS |
protected static java.lang.String |
MICRODESC |
protected static java.lang.String |
MICRODESCS |
protected java.lang.String |
recentPath |
protected static java.lang.String |
RELAYDESCS |
protected static java.lang.String |
SERVERDESC |
protected static java.lang.String |
SERVERDESCS |
protected java.lang.String |
storagePath |
protected static java.lang.String |
WEBSTATS |
Modifier | Constructor and Description |
---|---|
protected |
DescriptorPersistence(byte[] descriptorBytes) |
protected |
DescriptorPersistence(T descriptor,
byte[] defaultAnnotationBytes)
Initializes the paths for storing descriptors of type
T . |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getRecentPath()
Return the final location for 'recent' descriptors.
|
java.lang.String |
getStoragePath()
Return the final storage location inside storage.
|
boolean |
storeAll(java.nio.file.Path recentRoot,
java.nio.file.Path outRoot)
Stores the descriptor to all locations.
|
boolean |
storeAll(java.lang.String recentRoot,
java.lang.String outRoot)
Stores the descriptor to all locations.
|
boolean |
storeAll(java.lang.String recentRoot,
java.lang.String outRoot,
java.nio.file.StandardOpenOption optionRecent,
java.nio.file.StandardOpenOption optionOut)
Stores the descriptor to all locations.
|
boolean |
storeOut(java.lang.String outRoot)
Stores the descriptor in out (i.e.
|
boolean |
storeOut(java.lang.String outRoot,
java.nio.file.StandardOpenOption option)
Stores the descriptor in out (i.e.
|
boolean |
storeRecent(java.lang.String recentRoot)
Stores the descriptor in recent.
|
boolean |
storeRecent(java.lang.String recentRoot,
java.nio.file.StandardOpenOption option)
Stores the descriptor in recent.
|
protected static final java.lang.String BRIDGEDESCS
protected static final java.lang.String BRIDGEPOOLASSIGNMENTS
protected static final java.lang.String BRIDGEDBSTATS
protected static final java.lang.String DASH
protected static final java.lang.String DOT
protected static final java.lang.String MICRODESC
protected static final java.lang.String MICRODESCS
protected static final java.lang.String RELAYDESCS
protected static final java.lang.String EXTRA_INFO
protected static final java.lang.String EXTRA_INFOS
protected static final java.lang.String SERVERDESC
protected static final java.lang.String SERVERDESCS
protected static final java.lang.String WEBSTATS
protected T extends org.torproject.descriptor.Descriptor desc
protected final byte[] annotationBytes
protected final byte[] descriptorBytes
protected java.lang.String storagePath
protected java.lang.String recentPath
protected static final byte[] EMPTY_ANNOTATION
protected DescriptorPersistence(T descriptor, byte[] defaultAnnotationBytes)
T
.protected DescriptorPersistence(byte[] descriptorBytes)
public boolean storeAll(java.nio.file.Path recentRoot, java.nio.file.Path outRoot)
true
, if both were written.public boolean storeAll(java.lang.String recentRoot, java.lang.String outRoot)
true
, if both were written.public boolean storeAll(java.lang.String recentRoot, java.lang.String outRoot, java.nio.file.StandardOpenOption optionRecent, java.nio.file.StandardOpenOption optionOut)
true
, if both were written.public boolean storeRecent(java.lang.String recentRoot)
public boolean storeRecent(java.lang.String recentRoot, java.nio.file.StandardOpenOption option)
true
, if the file was written.public boolean storeOut(java.lang.String outRoot)
true
, if the file was written.public boolean storeOut(java.lang.String outRoot, java.nio.file.StandardOpenOption option)
true
, if the file was written.public java.lang.String getStoragePath()
public java.lang.String getRecentPath()