org.mmbase.module
Class LinkChecker
java.lang.Object
org.mmbase.util.functions.FunctionProvider
org.mmbase.util.functions.DescribedFunctionProvider
org.mmbase.module.Module
org.mmbase.module.ProcessorModule
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.
- Version:
- $Id: LinkChecker.java 35335 2009-05-21 08:14:41Z michiel $
- Author:
- Rob vermeulen, Kees Jongenburger
|
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.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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinkChecker
public LinkChecker()
init
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.
- Overrides:
init in class ProcessorModule
getModuleInfo
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
- Overrides:
getModuleInfo in class Module
run
public void run()
- Specified by:
run in interface Runnable
checkUrls
protected void checkUrls(String builderName,
String fieldName,
StringBuilder data)
- Checks if the urls in a specified builder exist.
- Parameters:
builderName - the builder to checkfieldName - the fieldname of the url to checkdata - the StringBuilder to append error information to- Since:
- MMBase-1.7
checkUrl
protected boolean checkUrl(String url)
throws MalformedURLException,
IOException
- Checks if an url exists.
- Parameters:
url - the url to check
- Returns:
false if the url does not exist, true if the url exists
- Throws:
MalformedURLException
IOException
MMBase 2.0-SNAPSHOT - null