org.mmbase.module.builders.vwms
Class Judas
java.lang.Object
|
+--org.mmbase.module.builders.vwms.Vwm
|
+--org.mmbase.module.builders.vwms.Judas
- All Implemented Interfaces:
- MMBaseObserver, java.lang.Runnable, VwmInterface, VwmProbeInterface
- public class Judas
- extends Vwm
- implements MMBaseObserver
A VWM which determines which urls need to be reloaded (i.e. for caching).
Part of the descisionmaking is based on periodic maintenance, part is based on relating
how changes on nodes cause a change in a page.
Both methods are currently heavily stuffed with code specific to the VPRO (hardcoded urls and builders).
- Version:
- 10 Apr 2001
- Author:
- Daniel Ockeloen, Rico Jansen, Pierre van Rooden (javadocs)
|
Constructor Summary |
Judas()
Constructor for Judas |
|
Method Summary |
void |
addURL(java.lang.String url)
Adds a url to be scheduled for reload. |
void |
addURL(java.lang.String url,
int priority)
Adds a url to be scheduled for reload. |
void |
getEpisodes(int number)
|
void |
getItems(int number)
|
void |
getPeople(int number)
|
boolean |
nodeChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
|
boolean |
nodeLocalChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
Called when a remote node is changed. |
boolean |
nodeRemoteChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
Called when a local node is changed. |
boolean |
performTask(MMObjectNode taskNode)
performTask: This method is called when a vwmtask activates. |
boolean |
probeCall()
probeCall: This method is called every x minutes where x is the maintenancetime field of the vwm. |
boolean |
pushReload(java.lang.String url)
Forces a reload and subsequent caching of a page. |
| Methods inherited from class org.mmbase.module.builders.vwms.Vwm |
addClient, claim, debug, failed, getName, getVwmNode, init, parseProperties, performed, putTask, releaseClient, rollback, run, start, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Judas
public Judas()
- Constructor for Judas
performTask
public boolean performTask(MMObjectNode taskNode)
- performTask: This method is called when a vwmtask activates.
The task that needs to be performed is determined by the tasks' name field.
- Overrides:
performTask in class Vwm
- Parameters:
taskNode - The current Vwmtasks node.- Returns:
true when the task can be found and task execution succeeds, false otherwise
probeCall
public boolean probeCall()
- probeCall: This method is called every x minutes where x is the maintenancetime field of the vwm.
The maintanancetime for this bot HAS TO BE 1 hour=3600 sec for the 3voor12 jukeboxes reload.
- Overrides:
probeCall in class Vwm
- Returns:
- Always returns 'true'.
nodeRemoteChanged
public boolean nodeRemoteChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
- Description copied from class:
Vwm
- Called when a local node is changed.
- Specified by:
nodeRemoteChanged in interface MMBaseObserver- Overrides:
nodeRemoteChanged in class Vwm
- Following copied from class:
org.mmbase.module.builders.vwms.Vwm
- Parameters:
machine - Name of the machine that changed the node.number - Number of the changed node as a Stringbuilder - type of the changed nodectype - command type, 'c'=changed, 'd'=deleted', 'r'=relations changed, 'n'=new- Returns:
true if maintenance was performed, false (the default) otherwise
nodeLocalChanged
public boolean nodeLocalChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
- Description copied from class:
Vwm
- Called when a remote node is changed.
- Specified by:
nodeLocalChanged in interface MMBaseObserver- Overrides:
nodeLocalChanged in class Vwm
- Following copied from class:
org.mmbase.module.builders.vwms.Vwm
- Parameters:
machine - Name of the machine that changed the node.number - Number of the changed node as a Stringbuilder - type of the changed nodectype - command type, 'c'=changed, 'd'=deleted', 'r'=relations changed, 'n'=new- Returns:
true if maintenance was performed, false (the default) otherwise
nodeChanged
public boolean nodeChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
getEpisodes
public void getEpisodes(int number)
getItems
public void getItems(int number)
getPeople
public void getPeople(int number)
addURL
public void addURL(java.lang.String url)
- Adds a url to be scheduled for reload.
The url has to be a relative url eg. /3voor12/bla/index.shtml?123+456 .
If no parameters are given, the url STILL has to have a '?' character eg. /3voor12/test.shtml?
The urls are forwarded to a thread that schedules the reloads based on priority.
Uses default priority for scheduling reload.
- Parameters:
url - the url to reload
addURL
public void addURL(java.lang.String url,
int priority)
- Adds a url to be scheduled for reload.
The url has to be a relative url eg. /3voor12/bla/index.shtml?123+456 .
If no parameters are given, the url STILL has to have a '?' character eg. /3voor12/test.shtml?
The urls are forwarded to a thread that schedules the reloads based on priority.
- Parameters:
url - the url to reloadpriority - priority at which the url needs to be reloaded
pushReload
public boolean pushReload(java.lang.String url)
- Forces a reload and subsequent caching of a page.
The routine makes a change to a netfiles object, which causes the NetFileSrv builder to invoke
the
PageMaster VWM that handles the filechanges, in this case transfer of the file to
a remote proxy (a mirror server).
- Parameters:
url - Url of the page to reload- Returns:
true
MMBase 2001