public abstract class CollecTorMain extends SyncManager implements java.util.concurrent.Callable<java.lang.Object>, java.util.Observer, java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected Configuration |
config |
protected java.util.Map<java.lang.String,java.lang.Class<? extends org.torproject.descriptor.Descriptor>> |
mapPathDescriptors |
static java.lang.String |
SOURCES |
SYNCORIGINS
Constructor and Description |
---|
CollecTorMain(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
call()
Wrapper for
run . |
static void |
checkAvailableSpace(java.nio.file.Path location)
Checks the available space for the storage the given path is located on and
logs a warning, if 200 MiB or less are available, and otherwise logs
available space in TRACE level.
|
abstract java.lang.String |
module()
Returns the module name for logging purposes.
|
void |
run()
Log all errors preventing successful completion of the module.
|
protected abstract void |
startProcessing()
Module specific code goes here.
|
java.util.Map<java.lang.String,java.lang.Class<? extends org.torproject.descriptor.Descriptor>> |
syncMapPathsDescriptors()
Returns map of path and descriptor type for download.
|
protected abstract java.lang.String |
syncMarker()
Returns property prefix/infix/postfix for Sync related properties.
|
void |
update(java.util.Observable obs,
java.lang.Object obj) |
merge
public static final java.lang.String SOURCES
protected Configuration config
protected final java.util.Map<java.lang.String,java.lang.Class<? extends org.torproject.descriptor.Descriptor>> mapPathDescriptors
public CollecTorMain(Configuration conf)
public final void run()
run
in interface java.lang.Runnable
public final java.lang.Object call()
run
.call
in interface java.util.concurrent.Callable<java.lang.Object>
public void update(java.util.Observable obs, java.lang.Object obj)
update
in interface java.util.Observer
protected abstract void startProcessing() throws ConfigurationException
ConfigurationException
protected abstract java.lang.String syncMarker()
public abstract java.lang.String module()
public java.util.Map<java.lang.String,java.lang.Class<? extends org.torproject.descriptor.Descriptor>> syncMapPathsDescriptors()
public static void checkAvailableSpace(java.nio.file.Path location)