All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.contrib.SalvagerResource

java.lang.Object
   |
   +----w3c.tools.store.AttributeHolder
           |
           +----w3c.tools.store.Resource
                   |
                   +----w3c.jigsaw.resources.HTTPResource
                           |
                           +----w3c.jigsaw.resources.FilteredResource
                                   |
                                   +----w3c.jigsaw.resources.FileResource
                                           |
                                           +----w3c.jigsaw.forms.PostableResource
                                                   |
                                                   +----w3c.jigsaw.contrib.SalvagerResource

public class SalvagerResource
extends PostableResource

Variable Index

 o ATTR_LOGNAME
Attribute index - The salvager log.
 o engine
The engine currently running, or null.
 o log
The log, as a RandomAccessFile
 o logfile
The log file to use (if any)
 o report
The last walker's report.
 o started
Date at which the currernt salvage was started.
 o thread
The power for the engine, when needed.
 o verified
Did we run a verify stage since last safe report ?
 o walker
The walk handler.

Constructor Index

 o SalvagerResource()

Method Index

 o acceptUnload()
This resource should never be unloaded.
 o dump(HtmlGenerator)
Dump a suitable form for display report and running the salvager.
 o dumpReport(HtmlGenerator)
Dump the last report, if any into given stream.
 o get(Request)
Redirect all requests to the log, when possible.
 o getEngine()
Get the walker engine currently running.
 o getLogname()
Get the salvager's resource log name.
 o handle(Request, URLDecoder)
Handle the form submission, after posted data parsing.
 o initialize(Object[])
Setup the list of allowed methods.
 o interruptSalvage()
Interrupt the current walker, if any.
 o notifyUnload()
This resource is being unloaded.
 o setValue(int, Object)
Set some of this resource attribute.
 o startSalvage(boolean, boolean)
Start the salvage process.
 o walkerDone(ResourceWalker, SalvagerReport)
Callback, for the walker to notify the end of salvaging.

Variables

 o ATTR_LOGNAME
 protected static int ATTR_LOGNAME
Attribute index - The salvager log.

 o engine
 protected WalkerEngine engine
The engine currently running, or null.

 o thread
 protected Thread thread
The power for the engine, when needed.

 o walker
 protected ResourceWalker walker
The walk handler.

 o log
 protected PrintStream log
The log, as a RandomAccessFile

 o report
 protected SalvagerReport report
The last walker's report.

 o verified
 protected boolean verified
Did we run a verify stage since last safe report ?

 o started
 protected long started
Date at which the currernt salvage was started.

 o logfile
 protected File logfile
The log file to use (if any)

Constructors

 o SalvagerResource
 public SalvagerResource()

Methods

 o setValue
 public void setValue(int idx,
                      Object value)
Set some of this resource attribute.

Overrides:
setValue in class FileResource
 o getEngine
 protected synchronized WalkerEngine getEngine()
Get the walker engine currently running.

Returns:
A WalkerEngine instance, or null if no engine is currently running.
 o walkerDone
 protected synchronized void walkerDone(ResourceWalker walker,
                                        SalvagerReport report)
Callback, for the walker to notify the end of salvaging.

Parameters:
walker - The walker that is done.
report - The walker's report
 o startSalvage
 protected synchronized boolean startSalvage(boolean doverify,
                                             boolean doremove)
Start the salvage process.

Returns:
A boolean, true if salvager launched, false if salvager was already running.
 o interruptSalvage
 protected synchronized void interruptSalvage()
Interrupt the current walker, if any.

 o getLogname
 public String getLogname()
Get the salvager's resource log name.

Returns:
A String filename.
 o acceptUnload
 public synchronized boolean acceptUnload()
This resource should never be unloaded.

Overrides:
acceptUnload in class Resource
 o notifyUnload
 public void notifyUnload()
This resource is being unloaded.

Overrides:
notifyUnload in class Resource
 o dumpReport
 protected void dumpReport(HtmlGenerator g)
Dump the last report, if any into given stream.

Parameters:
g - The HtmlGenerator to dump to.
 o dump
 public void dump(HtmlGenerator g)
Dump a suitable form for display report and running the salvager.

Parameters:
g - The Htmlgenerator to dump infos into.
 o get
 public Reply get(Request request) throws HTTPException
Redirect all requests to the log, when possible.

Returns:
A Reply instance.
Throws: HTTPException
If performing the request failed.
Overrides:
get in class PostableResource
 o handle
 public Reply handle(Request request,
                     URLDecoder data) throws HTTPException
Handle the form submission, after posted data parsing.

Overrides:
handle in class PostableResource
 o initialize
 public void initialize(Object values[])
Setup the list of allowed methods.

Overrides:
initialize in class PostableResource

All Packages  Class Hierarchy  This Package  Previous  Next  Index