Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbArchiveManager

java.lang.Object
  extended by com.jivesoftware.forum.database.DbArchiveManager
All Implemented Interfaces:
JiveManager, ArchiveManager, java.lang.Runnable

public class DbArchiveManager
extends java.lang.Object
implements ArchiveManager, JiveManager, java.lang.Runnable

Database implementation of the ArchiveManager interface.


Nested Class Summary
 class DbArchiveManager.ArchiveTask
          A task to be run in the TaskEngine that executes an archiving run.
 
Field Summary
static java.lang.String ARCHIVED_PROP
           
static java.lang.String ARCHIVING_DISABLED_PROP
           
 
Fields inherited from interface com.jivesoftware.forum.ArchiveManager
DELETE_THREADS, MARK_THREADS, MOVE_THREADS
 
Constructor Summary
DbArchiveManager()
           
 
Method Summary
 void destroy()
          Notifies the manager to release any resources that may be holding on too.
 int getArchiveDays(Forum forum)
          Returns the number of days that threads in forum must be inactive before being archived.
 Forum getArchiveForum(Forum forum)
          Returns the "archive forum" for the specified forum.
 int getArchiveMode(Forum forum)
          Returns the archive mode for the forum.
 int getAutoArchiveInterval()
          Returns the inverval between auto archive executions (in hours).
 java.util.Date getLastArchivedDate()
          Returns the date the archiving process was last run.
 void initialize()
          Initialize the manager.
 boolean isArchivingEnabled(Forum forum)
          Returns true if archiving is enabled for the specified forum.
 boolean isAutoArchiveEnabled()
          Returns true if auto-archiving is enabled.
 boolean isBusy()
          Returns true if the archiving process is currently running.
 void run()
           
 void runArchiver()
          Manually runs the archiving process.
 void setArchiveDays(Forum forum, int days)
          Sets the number of days that threads in forum must be inactive before being archived.
 void setArchiveForum(Forum forum, Forum archiveForum)
          Sets the "archive forum" for the specified forum.
 void setArchiveMode(Forum forum, int mode)
          Returns the archive mode for the forum.
 void setArchivingEnabled(Forum forum, boolean enabled)
          Enables or disables archiving for the specified forum.
 void setAutoArchiveEnabled(boolean enabled)
          Enables or disables auto-archiving.
 void setAutoArchiveInterval(int interval)
          Sets the inverval between auto archive executions (in hours).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARCHIVING_DISABLED_PROP

public static final java.lang.String ARCHIVING_DISABLED_PROP
See Also:
Constant Field Values

ARCHIVED_PROP

public static final java.lang.String ARCHIVED_PROP
See Also:
Constant Field Values
Constructor Detail

DbArchiveManager

public DbArchiveManager()
Method Detail

initialize

public void initialize()
Description copied from interface: JiveManager
Initialize the manager. It is within this method that it is ok to create, access and/or otherwise use external classes (including caches). Until this method is called implementation should not access any external classes that could possibly either access one of the main Factory classes or any caches since doing so can cause deadlocks and possible clustering issues during startup.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
initialize in interface JiveManager

destroy

public void destroy()
Description copied from interface: JiveManager
Notifies the manager to release any resources that may be holding on too. This could also be used to clear out the managers caches, etc.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
destroy in interface JiveManager

isArchivingEnabled

public boolean isArchivingEnabled(Forum forum)
Description copied from interface: ArchiveManager
Returns true if archiving is enabled for the specified forum. When archiving is enabled, inactive threads will be archived based on the archiving mode.

Specified by:
isArchivingEnabled in interface ArchiveManager
Parameters:
forum - the forum to check the status of.
Returns:
true if archiving is enabled for the specified forum.

setArchivingEnabled

public void setArchivingEnabled(Forum forum,
                                boolean enabled)
Description copied from interface: ArchiveManager
Enables or disables archiving for the specified forum. When archiving is enabled, inactive threads will be archived based on the archiving mode.

Specified by:
setArchivingEnabled in interface ArchiveManager
Parameters:
forum - the forum to set the status of.
enabled - true if archiving should be enabled for the forum.

getArchiveDays

public int getArchiveDays(Forum forum)
Description copied from interface: ArchiveManager
Returns the number of days that threads in forum must be inactive before being archived. The default value is 180 days.

Specified by:
getArchiveDays in interface ArchiveManager
Parameters:
forum - the forum to check the value on.
Returns:
the number of days a thread must be inactive before being archived.

setArchiveDays

public void setArchiveDays(Forum forum,
                           int days)
Description copied from interface: ArchiveManager
Sets the number of days that threads in forum must be inactive before being archived. The default value is 180 days.

Specified by:
setArchiveDays in interface ArchiveManager
Parameters:
forum - the forum to set the value on.
days - the number of days a thread must be inactive before being archived.

getArchiveMode

public int getArchiveMode(Forum forum)
Description copied from interface: ArchiveManager
Returns the archive mode for the forum. The archive mode dictates what is done with archived threads. Valid modes are ArchiveManager.MARK_THREADS, ArchiveManager.DELETE_THREADS, and ArchiveManager.MOVE_THREADS.

If the MOVE_THREADS mode is being used, an "archive forum" must be specified to move archived threads to.

Specified by:
getArchiveMode in interface ArchiveManager
Parameters:
forum - the forum to check the archive mode of.
Returns:
the archive mode of the specified forum.

setArchiveMode

public void setArchiveMode(Forum forum,
                           int mode)
Description copied from interface: ArchiveManager
Returns the archive mode for the forum. The archive mode dictates what is done with archived threads. Valid modes are ArchiveManager.MARK_THREADS, ArchiveManager.DELETE_THREADS, and ArchiveManager.MOVE_THREADS.

If the MOVE_THREADS mode is being used, an "archive forum" must be specified to move archived threads to.

Specified by:
setArchiveMode in interface ArchiveManager
Parameters:
forum - the forum to set the archive mode of.
mode - the archive mode.

getArchiveForum

public Forum getArchiveForum(Forum forum)
Description copied from interface: ArchiveManager
Returns the "archive forum" for the specified forum. An archive forum is necessary when the archiving mode is set to MOVE_THREADS -- ie, there must be a forum to move the threads to. If no archive forum is set, null will be returned.

Specified by:
getArchiveForum in interface ArchiveManager
Parameters:
forum - the forum to get the "archive forum" of.
Returns:
the "archive forum" of the specified forum or null if not defined.

setArchiveForum

public void setArchiveForum(Forum forum,
                            Forum archiveForum)
Description copied from interface: ArchiveManager
Sets the "archive forum" for the specified forum. An archive forum is necessary when the archiving mode is set to MOVE_THREADS -- ie, there must be a forum to move the threads to.

Specified by:
setArchiveForum in interface ArchiveManager
Parameters:
forum - the forum to set the "archive forum" of.
archiveForum - the "archive forum" for .

isAutoArchiveEnabled

public boolean isAutoArchiveEnabled()
Description copied from interface: ArchiveManager
Returns true if auto-archiving is enabled. When enabled, the archiving process will be run on a periodic basis.

Specified by:
isAutoArchiveEnabled in interface ArchiveManager
Returns:
true if auto-archiving is enabled.

setAutoArchiveEnabled

public void setAutoArchiveEnabled(boolean enabled)
Description copied from interface: ArchiveManager
Enables or disables auto-archiving. When enabled, the archiving process will be run on a periodic basis.

Specified by:
setAutoArchiveEnabled in interface ArchiveManager
Parameters:
enabled - true if auto-archiving should be enabled.

getAutoArchiveInterval

public int getAutoArchiveInterval()
Description copied from interface: ArchiveManager
Returns the inverval between auto archive executions (in hours).

Specified by:
getAutoArchiveInterval in interface ArchiveManager
Returns:
the interval betwen auto archive executions (in hours).

setAutoArchiveInterval

public void setAutoArchiveInterval(int interval)
Description copied from interface: ArchiveManager
Sets the inverval between auto archive executions (in hours).

Specified by:
setAutoArchiveInterval in interface ArchiveManager
Parameters:
interval - the interval betwen auto archive executions (in hours).

getLastArchivedDate

public java.util.Date getLastArchivedDate()
Description copied from interface: ArchiveManager
Returns the date the archiving process was last run. Returns null if the archiving process has never been run.

Specified by:
getLastArchivedDate in interface ArchiveManager
Returns:
the date the archiving process was last run.

isBusy

public boolean isBusy()
               throws UnauthorizedException
Description copied from interface: ArchiveManager
Returns true if the archiving process is currently running. The is useful for an administration GUI.

Specified by:
isBusy in interface ArchiveManager
Returns:
true if the archiving process is currently running.
Throws:
UnauthorizedException - if not a system administrator.

runArchiver

public void runArchiver()
                 throws UnauthorizedException
Description copied from interface: ArchiveManager
Manually runs the archiving process.

Specified by:
runArchiver in interface ArchiveManager
Throws:
UnauthorizedException - if not a system administrator.

run

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

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.