Jive API (3.0.13) Core Javadocs

com.jivesoftware.community
Interface ArchiveManager

All Superinterfaces:
JiveManager

public interface ArchiveManager
extends JiveManager

Manages the archive feature of Jive. Archiving provides an automated method of dealing with old content. Three different archiving modes are available, and are set on a per-community basis:

Individual threads can be prevented from being archived by setting their extended property "jive.archivingDisabled" to "true".

See Also:
JiveContext.getArchiveManager()

Field Summary
static int DELETE_THREADS
          An archive mode that specifies that threads should be deleted.
static int MARK_THREADS
          An archive mode that specifies that threads are marked as archived and left in their original community.
static int MOVE_THREADS
          An archive mode that specifies that threads should be moved to another community.
 
Method Summary
 Community getArchiveCommunity(Community community)
          Returns the "archive community" for the specified community.
 int getArchiveDays(Community community)
          Returns the number of days that threads in community must be inactive before being archived.
 int getArchiveMode(Community community)
          Returns the archive mode for the community.
 int getAutoArchiveInterval()
          Returns the inverval between auto archive executions (in hours).
 Date getLastArchivedDate()
          Returns the date the archiving process was last run.
 boolean isArchivingEnabled(Community community)
          Returns true if archiving is enabled for the specified community.
 boolean isAutoArchiveEnabled()
          Returns true if auto-archiving is enabled.
 void runArchiver()
          Manually runs the archiving process.
 void setArchiveCommunity(Community community, Community archiveCommunity)
          Sets the "archive community" for the specified community.
 void setArchiveDays(Community archive, int days)
          Sets the number of days that threads in community must be inactive before being archived.
 void setArchiveMode(Community community, int mode)
          Returns the archive mode for the community.
 void setArchivingEnabled(Community community, boolean enabled)
          Enables or disables archiving for the specified community.
 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 interface com.jivesoftware.community.JiveManager
destroy
 

Field Detail

MARK_THREADS

static final int MARK_THREADS
An archive mode that specifies that threads are marked as archived and left in their original community. Normally, skins should note the fact that the threads are archived and disable new posts in those threads. Threads are marked as archived by setting their extended property "jive.archived" to "true".

See Also:
Constant Field Values

DELETE_THREADS

static final int DELETE_THREADS
An archive mode that specifies that threads should be deleted.

See Also:
Constant Field Values

MOVE_THREADS

static final int MOVE_THREADS
An archive mode that specifies that threads should be moved to another community.

See Also:
Constant Field Values
Method Detail

isArchivingEnabled

boolean isArchivingEnabled(Community community)
Returns true if archiving is enabled for the specified community. When archiving is enabled, inactive threads will be archived based on the archiving mode.

Parameters:
community - the community to check the status of.
Returns:
true if archiving is enabled for the specified community.

setArchivingEnabled

void setArchivingEnabled(Community community,
                         boolean enabled)
                         throws UnauthorizedException
Enables or disables archiving for the specified community. When archiving is enabled, inactive threads will be archived based on the archiving mode.

Parameters:
community - the community to set archiving enabled/disabled on
enabled - true if archiving should be enabled for the community.
Throws:
UnauthorizedException - if not an administrator of the community.

getArchiveDays

int getArchiveDays(Community community)
Returns the number of days that threads in community must be inactive before being archived. The default value is 180 days.

Parameters:
community - the community to get the archive days for
Returns:
the number of days a thread must be inactive before being archived.

setArchiveDays

void setArchiveDays(Community archive,
                    int days)
                    throws UnauthorizedException
Sets the number of days that threads in community must be inactive before being archived. The default value is 180 days.

Parameters:
archive - the community to set the archive days for
days - the number of days a thread must be inactive before being archived.
Throws:
UnauthorizedException - if not an admin of the community.

getArchiveMode

int getArchiveMode(Community community)
Returns the archive mode for the community. 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 community" must be specified to move archived threads to.

Parameters:
community - the community to get the archive mode for
Returns:
the archive mode of the specified community.

setArchiveMode

void setArchiveMode(Community community,
                    int mode)
                    throws UnauthorizedException
Returns the archive mode for the community. 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 community" must be specified to move archived threads to.

Parameters:
community - the community to set the archive mode for
mode - the archive mode.
Throws:
UnauthorizedException - if not an administrator of the community.

getArchiveCommunity

Community getArchiveCommunity(Community community)
                              throws UnauthorizedException
Returns the "archive community" for the specified community. An archive community is necessary when the archiving mode is set to MOVE_THREADS -- ie, there must be a community to move the threads to. If no archive community is set, null will be returned.

Parameters:
community - the community to get the archive community for
Returns:
the "archive community" of the specified community or null if not defined.
Throws:
UnauthorizedException - if not an admin of community or does not have read permission on the archive community being returned.

setArchiveCommunity

void setArchiveCommunity(Community community,
                         Community archiveCommunity)
                         throws UnauthorizedException
Sets the "archive community" for the specified community. An archive community is necessary when the archiving mode is set to MOVE_THREADS -- ie, there must be a community to move the threads to.

Parameters:
community - the community to set the archive community for
archiveCommunity - the archive community to archive the community to
Throws:
UnauthorizedException - if not an admin of community and archiveCommunity.

isAutoArchiveEnabled

boolean isAutoArchiveEnabled()
                             throws UnauthorizedException
Returns true if auto-archiving is enabled. When enabled, the archiving process will be run on a periodic basis.

Returns:
true if auto-archiving is enabled.
Throws:
UnauthorizedException - if not a system administrator.

setAutoArchiveEnabled

void setAutoArchiveEnabled(boolean enabled)
                           throws UnauthorizedException
Enables or disables auto-archiving. When enabled, the archiving process will be run on a periodic basis.

Parameters:
enabled - true if auto-archiving should be enabled.
Throws:
UnauthorizedException - if not a system administrator.

getAutoArchiveInterval

int getAutoArchiveInterval()
                           throws UnauthorizedException
Returns the inverval between auto archive executions (in hours).

Returns:
the interval betwen auto archive executions (in hours).
Throws:
UnauthorizedException - if not a system administrator.

setAutoArchiveInterval

void setAutoArchiveInterval(int interval)
                            throws UnauthorizedException
Sets the inverval between auto archive executions (in hours).

Parameters:
interval - the interval betwen auto archive executions (in hours).
Throws:
UnauthorizedException - if not a system administrator.

getLastArchivedDate

Date getLastArchivedDate()
                         throws UnauthorizedException
Returns the date the archiving process was last run. Returns null if the archiving process has never been run.

Returns:
the date the archiving process was last run.
Throws:
UnauthorizedException - if not a system administrator.

runArchiver

void runArchiver()
                 throws UnauthorizedException
Manually runs the archiving process.

Throws:
UnauthorizedException - if not a system administrator.

Jive Product Page

Copyright © 1999-2007 Jive Software.