    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

##

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

##

SalvagerResource()

##

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

##

ATTR_LOGNAME

     protected static int ATTR_LOGNAME

  Attribute index - The salvager log.

engine

     protected WalkerEngine engine

  The engine currently running, or null.

thread

     protected Thread thread

  The power for the engine, when needed.

walker

     protected ResourceWalker walker

  The walk handler.

log

     protected PrintStream log

  The log, as a RandomAccessFile

report

     protected SalvagerReport report

  The last walker's report.

verified

     protected boolean verified

  Did we run a verify stage since last safe report ?

started

     protected long started

  Date at which the currernt salvage was started.

logfile

     protected File logfile

  The log file to use (if any)

##

SalvagerResource

     public SalvagerResource()

##

setValue

     public void setValue(int idx,
                          Object value)

  Set some of this resource attribute.

  Overrides:
    setValue in class FileResource

getEngine

     protected synchronized WalkerEngine getEngine()

  Get the walker engine currently running.

  Returns:
    A WalkerEngine instance, or null if no engine is currently running.

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

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.

interruptSalvage

     protected synchronized void interruptSalvage()

  Interrupt the current walker, if any.

getLogname

     public String getLogname()

  Get the salvager's resource log name.

  Returns:
    A String filename.

acceptUnload

     public synchronized boolean acceptUnload()

  This resource should never be unloaded.

  Overrides:
    acceptUnload in class Resource

notifyUnload

     public void notifyUnload()

  This resource is being unloaded.

  Overrides:
    notifyUnload in class Resource

dumpReport

     protected void dumpReport(HtmlGenerator g)

  Dump the last report, if any into given stream.

  Parameters:
    g - The HtmlGenerator to dump to.

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.

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

handle

     public Reply handle(Request request,
                         URLDecoder data) throws HTTPException

  Handle the form submission, after posted data parsing.

  Overrides:
    handle in class PostableResource

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