Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.util
Class AttachmentUpgradeTask

java.lang.Object
  extended by com.jivesoftware.util.AbstractPollableRunnable
      extended by com.jivesoftware.forum.util.AttachmentUpgradeTask
All Implemented Interfaces:
PollableRunnable, java.io.Serializable, java.lang.Runnable

public class AttachmentUpgradeTask
extends AbstractPollableRunnable

A task to upgrade JF 3.x file system attachments to JF 4.x attachments which can be stored in the database. This task will not check to see if database mode is explicitly enabled - it assumes it is.

Since:
4.0
See Also:
Serialized Form

Constructor Summary
AttachmentUpgradeTask(ForumFactory factory)
          Creates a new task - to run it, submit it to the task engine or call doRun() directly.
 
Method Summary
 void doRun()
          Scans the attachment directory for .bin files.
 java.lang.Throwable getException()
           
 int getTaskMaximum()
          Returns the maximum value of task progress (default is 100).
 int getTaskValue()
          Returns the current value of the task's progress.
 
Methods inherited from class com.jivesoftware.util.AbstractPollableRunnable
cancel, getEndDate, getPercentComplete, getStartDate, getTaskMinimum, isFinished, isIndeterminate, isRunning, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentUpgradeTask

public AttachmentUpgradeTask(ForumFactory factory)
Creates a new task - to run it, submit it to the task engine or call doRun() directly.

Method Detail

getTaskValue

public int getTaskValue()
Description copied from interface: PollableRunnable
Returns the current value of the task's progress. This will be x where min <= x <= max. If this is in indeterminate mode then this will return -1.

Specified by:
getTaskValue in interface PollableRunnable
Specified by:
getTaskValue in class AbstractPollableRunnable
Returns:
the current value of the task's progress.

getTaskMaximum

public int getTaskMaximum()
Description copied from interface: PollableRunnable
Returns the maximum value of task progress (default is 100). If this is in indeterminate mode then this will return -1.

Specified by:
getTaskMaximum in interface PollableRunnable
Overrides:
getTaskMaximum in class AbstractPollableRunnable
Returns:
the maximum value of task progress.

getException

public java.lang.Throwable getException()

doRun

public void doRun()
Scans the attachment directory for .bin files. For each file it will check the database to see if it already exists and if not it will do an insert.

Specified by:
doRun in class AbstractPollableRunnable

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.