public abstract class DescriptorPersistence<T extends org.torproject.descriptor.Descriptor>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
annotation |
protected static java.lang.String |
BRIDGEDESCS |
protected static java.lang.String |
DASH |
protected T |
desc |
protected static java.lang.String |
EXTRA_INFO |
protected static java.lang.String |
EXTRA_INFOS |
protected static org.slf4j.Logger |
log |
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 |
Modifier | Constructor and Description |
---|---|
protected |
DescriptorPersistence(T desc,
byte[] defaultAnnotation)
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.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 org.slf4j.Logger log
protected static final java.lang.String BRIDGEDESCS
protected static final java.lang.String DASH
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 final T extends org.torproject.descriptor.Descriptor desc
protected final byte[] annotation
protected java.lang.String storagePath
protected java.lang.String recentPath
protected DescriptorPersistence(T desc, byte[] defaultAnnotation)
T
.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()