org.mmbase.module
Class LinkChecker

java.lang.Object
  extended byorg.mmbase.module.Module
      extended byorg.mmbase.module.ProcessorModule
          extended byorg.mmbase.module.LinkChecker
All Implemented Interfaces:
ProcessorInterface, java.lang.Runnable

public class LinkChecker
extends ProcessorModule
implements java.lang.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. This wil only happend once every time time MMBase has been started.
For the LinckChecker to work the sendmail modules has to be configured and has to be active.

Version:
$Id: LinkChecker.java,v 1.16 2004/02/13 13:38:34 pierre Exp $
Author:
Rob vermeulen, Kees Jongenburger

Constructor Summary
LinkChecker()
           
 
Method Summary
protected  boolean checkUrl(java.lang.String url)
          Checks if an url exists.
protected  void checkUrls(java.lang.String builderName, java.lang.String fieldName, java.lang.StringBuffer data)
          Checks if the urls in a specified builder exist.
 java.lang.String getModuleInfo()
          provide some info on the module
 void init()
          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.
 void run()
           
 
Methods inherited from class org.mmbase.module.ProcessorModule
cacheCheck, getList, getListBuilder, getNodeList, onload, process, reload, replace, replace, unload
 
Methods inherited from class org.mmbase.module.Module
getInitParameter, getInitParameters, getMaintainer, getMimeType, getMimeTypeFile, getModule, getModule, getModules, getName, getProperties, getProperty, getVersion, hasStarted, loadModulesFromDisk, maintainance, setInitParameter, setMaintainer, setName, setVersion, shutdown, shutdownModules, startModule, startModules, state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkChecker

public LinkChecker()
Method Detail

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 java.lang.String getModuleInfo()
Description copied from class: Module
provide some info on the module

Overrides:
getModuleInfo in class Module

run

public void run()
Specified by:
run in interface java.lang.Runnable

checkUrls

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

Parameters:
builderName - the builder to check
fieldName - the fieldname of the url to check
data - the StringBuffer to append error information to
Returns:
false if the url does not exist

checkUrl

protected boolean checkUrl(java.lang.String url)
                    throws java.net.MalformedURLException,
                           java.io.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:
java.net.MalformedURLException
java.io.IOException


MMBase build 1.7.1.20041002