public class ReseedChecker extends Object
context.netDb().reseedChecker(), others should not instantiate this class directly.| Modifier and Type | Field and Description |
|---|---|
static int |
MINIMUM
Minimum number of router infos before automatic reseed attempted
|
| Constructor and Description |
|---|
ReseedChecker(RouterContext context)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkReseed(int known)
Checks if a reseed is needed based on peers, uptime, downtime, and system flags.
|
(package private) void |
done()
Marks reseed complete, resetting internal state and scheduling status clearance.
|
String |
getError()
Gets the error message from the last or current reseed attempt.
|
String |
getStatus()
Gets the status message from the current reseed attempt.
|
boolean |
inProgress()
Checks whether a reseed is currently in progress.
|
boolean |
requestReseed()
Starts a reseed if one is not already in progress.
|
int |
requestReseed(InputStream in)
Performs a blocking reseed from a zip or su3 InputStream.
|
boolean |
requestReseed(URI url)
Starts a reseed from a zip or su3 URI if one is not already in progress.
|
(package private) void |
setError(String s)
Sets the error message for the last or current reseed attempt.
|
(package private) void |
setStatus(String s)
Sets the status message for the current reseed attempt.
|
public static final int MINIMUM
public ReseedChecker(RouterContext context)
context - the router contextpublic boolean checkReseed(int known)
known - current number of known routers (includes this router)void done()
public String getError()
public String getStatus()
public boolean inProgress()
public boolean requestReseed()
public int requestReseed(InputStream in) throws IOException
in - InputStream of reseed dataIOException - if reseed is already in progress or an IO error occurspublic boolean requestReseed(URI url) throws IllegalArgumentException
url - URI to the reseed data file (zip/su3)IllegalArgumentException - if URI is invalid or unsupported formatvoid setError(String s)
s - error message, non-null but may be emptyvoid setStatus(String s)
s - status message, non-null but may be empty