|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.wiki.plugin.randompages.RandomPagesScheduler
public class RandomPagesScheduler
The singleton-per-WikiEngine scheduler that handles updates to the random page list (which it also maintains). When this class is instantiated it adds a listener to the WikiEngine so that it can be gracefully shut down along with the WikiEngine.
This is considered a very low-priority thread.
| Field Summary | |
|---|---|
static int |
DEFAULT_MAXHOURS
Default value for the maximum number of hours between refreshes. |
static int |
DEFAULT_MAXPAGES
Default value for the maximum number of pages to return. |
static int |
DEFAULT_MINPAGES
Default value for the minimum number of pages to return. |
static int |
MIN_PERIOD
Fixed value for the minimum number (in ms) between refreshes. |
| Method Summary | |
|---|---|
protected Set |
getExclusions()
Returns an unmodifiable set of pages to exclude. |
static RandomPagesScheduler |
getInstance(WikiEngine engine,
int minpages,
int maxpages,
int maxperiod,
String exclude)
Returns the RandomPagesScheduler for the WikiEngine engine on a per-engine basis. |
int[] |
getLimits()
Return the currently-set limits as an int array. |
long |
getNextScheduledUpdate()
Returns the Date (in ms) after which the next update is scheduled to occur. |
String |
getNextScheduledUpdateDisplay(boolean includeTimeRemaining)
Returns a readable display of the Date after which the next update is scheduled to occur. |
int |
getRandomPageCount()
Returns a random page count within the pre-specified range. |
Set |
getRandomPages()
Returns a Set of random pages. |
protected void |
setExclusions(String exclude)
Set the list of pages to exclude. |
protected void |
setLimits(WikiEngine engine,
int minpages,
int maxpages,
int maxhours)
Sanity check and set limits. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MINPAGES
public static final int DEFAULT_MAXPAGES
public static final int DEFAULT_MAXHOURS
public static final int MIN_PERIOD
| Method Detail |
|---|
public static RandomPagesScheduler getInstance(WikiEngine engine,
int minpages,
int maxpages,
int maxperiod,
String exclude)
engine - The WikiEngine used as a source of page information.minpages - The minimum number of pages to return.maxpages - The maximum number of pages to return.maxperiod - The maximum period (in hours) between refreshes. See
the note on setLimits(WikiEngine,int,int,int).exclude - The space- or comma-delimited list of pages to exclude.public int getRandomPageCount()
public Set getRandomPages()
public long getNextScheduledUpdate()
public String getNextScheduledUpdateDisplay(boolean includeTimeRemaining)
includeTimeRemaining - if true includes the time remaining in secondsprotected Set getExclusions()
protected void setExclusions(String exclude)
public int[] getLimits()
protected void setLimits(WikiEngine engine,
int minpages,
int maxpages,
int maxhours)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||