Class LinkChecker

  extended by org.mmbase.util.functions.FunctionProvider
      extended by org.mmbase.util.functions.DescribedFunctionProvider
          extended by org.mmbase.module.Module
              extended by org.mmbase.module.ProcessorModule
                  extended by org.mmbase.module.LinkChecker
All Implemented Interfaces:
Runnable, Descriptor

public class LinkChecker
extends ProcessorModule
implements Runnable

The linkChecker module detects broken urls in the urls builder and the jumpers builder. If the linkchecker module is active it will at start up (5 minutes after the MMBase initialisation) and start perfoming checks.

So this wil only happen once every time time MMBase has been started. But since this class is a Runnable it can also be scheduled as a 'cronjob'.

For the LinckChecker to work the sendmail modules has to be configured and has to be active.

$Id: 35335 2009-05-21 08:14:41Z michiel $
Rob vermeulen, Kees Jongenburger

Nested Class Summary
Nested classes/interfaces inherited from class org.mmbase.module.ProcessorModule
ProcessorModule.GetNodeListFunction, ProcessorModule.ProcessFunction, ProcessorModule.ReplaceFunction
Field Summary
Fields inherited from class org.mmbase.module.ProcessorModule
Fields inherited from class org.mmbase.module.Module
configurationPath, getMaintainerFunction, getVersionFunction, properties, STATE_START_TIME
Fields inherited from class org.mmbase.util.functions.DescribedFunctionProvider
description, guiName, name
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
Constructor Summary
Method Summary
protected  boolean checkUrl(String url)
          Checks if an url exists.
protected  void checkUrls(String builderName, String fieldName, StringBuilder data)
          Checks if the urls in a specified builder exist.
 String getModuleInfo()
          Provide some info on the module; By default, this returns the module description for the default locale
 void init()
          Initializes the module.
 void run()
Methods inherited from class org.mmbase.module.ProcessorModule
getList, getListBuilder, getNodeList, onload, process, reload, replace, replace, unload
Methods inherited from class org.mmbase.module.Module
addInitParameters, checkModules, getInitParameter, getInitParameter, getInitParameter, getInitParameters, getInitParameters, getMaintainer, getModule, getModule, getModule, getModule, getModuleLoader, getModuleReader, getModuleReader, getModules, getState, getStates, getVersion, hasModule, hasStarted, loadInitParameters, loadInitParameters, maintainance, setInitParameter, setMaintainer, setState, setVersion, shutdown, shutdownModules, startModule, startModules
Methods inherited from class org.mmbase.util.functions.DescribedFunctionProvider
getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName, setName
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public LinkChecker()
Method Detail


public void init()
Description copied from class: ProcessorModule
Initializes the module. Init must be overridden to read the environment variables it needs.
This method is called by Module.startModule(), which makes sure it is not called more than once. You should not call init() directly, call startModule() instead.

init in class ProcessorModule


public String getModuleInfo()
Description copied from class: Module
Provide some info on the module; By default, this returns the module description for the default locale

getModuleInfo in class Module


public void run()
Specified by:
run in interface Runnable


protected void checkUrls(String builderName,
                         String fieldName,
                         StringBuilder data)
Checks if the urls in a specified builder exist.

builderName - the builder to check
fieldName - the fieldname of the url to check
data - the StringBuilder to append error information to


protected boolean checkUrl(String url)
                    throws MalformedURLException,
Checks if an url exists.

url - the url to check
false if the url does not exist, true if the url exists

MMBase 2.0-SNAPSHOT - null