archivemanager.java

来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· Java 代码 · 共 212 行

JAVA
212
字号
/** * $RCSfile: ArchiveManager.java,v $ * $Revision: 1.2 $ * $Date: 2002/07/11 01:56:20 $ * * Copyright (C) 2002 CoolServlets, Inc. All rights reserved. * * This software is the proprietary information of CoolServlets, Inc. * Use is subject to license terms. */package com.jivesoftware.forum;import java.util.Date;/** * Manages the archive feature of Jive Forums. Archiving provides an automated method of dealing * with old content. Three different archiving modes are available, and are set on a per-forum * basis:<ul> * *  <li>MARK_ONLY -- marks threads as archived, but takes no further action. This is useful *      for skins that want to disable the ability to make replies in very old threads. *  <li>DELETE_THREADS -- deletes threads marked as archived. *  <li>MOVE_THREADS -- moves threads marked as archived into a designated "archive forum". Most *      commonly, the archive forum would be setup with read-only permissions to act as a history *      discussions, but not allow continued conversation.</ul> * * A thread is marked as archiving by setting the extended property <tt>archived</tt> to * <tt>true</tt>. * * @see ForumFactory#getArchiveManager() * @author Matt Tucker */public interface ArchiveManager {    /**     * An archive mode that specifies that nothing should be done with     * threads that are marked as archived. They will simply be left in their     * original forum. Normally, skins should note the fact that the threads     * are archived and disable new posts in those threads.     */    public static final int MARK_ONLY = 0;    /**     * An archive mode that specifies that archived threads should be deleted.     */    public static final int DELETE_THREADS = 1;    /**     * An archive mode that specifies that archived threads should be moved     * to another forum.     */    public static final int MOVE_THREADS = 2;    /**     * Returns true if archiving is enabled for the specified forum. When     * archiving is enabled, inactive threads will be periodically marked as     * archived by setting the <tt>archived</tt> thread property to <tt>true</tt>.     *     * @param forum the forum to check the status of.     * @return true if archiving is enabled for the specified forum.     */    public boolean isArchivingEnabled(Forum forum);    /**     * Enables or disables archiving for the specified forum. When archiving is     * enabled, inactive threads will be periodically marked as archived by     * setting the <tt>archived</tt> thread property to <tt>true</tt>.     *     * @param forum the forum to set the status of.     * @param enabled true if archiving should be enabled for the forum.     * @throws UnauthorizedException if not an administrator of the forum.     */    public void setArchivingEnabled(Forum forum, boolean enabled)            throws UnauthorizedException;    /**     * Returns the number of days that threads in <tt>forum</tt> must be     * inactive before being marked as archived. The default value is 180 days.     *     * @param forum the forum to check the value on.     * @return the number of days a thread must be inactive before being     *      archived.     */    public int getArchiveDays(Forum forum);    /**     * Sets the number of days that threads in <tt>forum</tt> must be inactive     * before being marked as archived. The default value is 180 days.     *     * @param forum the forum to set the value on.     * @param days the number of days a thread must be inactive before being     *      archived.     * @throws UnauthorizedException if not an admin of the forum.     */    public void setArchiveDays(Forum forum, int days)            throws UnauthorizedException;    /**     * Returns the archive mode for the forum. The archive mode dictates what is     * done with archived threads. Valid modes are ArchiveManager.MARK_ONLY,     * ArchiveManager.DELETE_THREADS, and ArchiveManager.MOVE_THREADS.<p>     *     * If the MOVE_THREADS mode is being used, an "archive forum" must be     * specified to move archived threads to.     *     * @param forum the forum to check the archive mode of.     * @return the archive mode of the specified forum.     */    public int getArchiveMode(Forum forum);    /**     * Returns the archive mode for the forum. The archive mode dictates what is     * done with archived threads. Valid modes are ArchiveManager.MARK_ONLY,     * ArchiveManager.DELETE_THREADS, and ArchiveManager.MOVE_THREADS.<p>     *     * If the MOVE_THREADS mode is being used, an "archive forum" must be     * specified to move archived threads to.     *     * @param forum the forum to set the archive mode of.     * @param mode the archive mode.     * @throws UnauthorizedException if not an administrator of the forum.     */    public void setArchiveMode(Forum forum, int mode)            throws UnauthorizedException;    /**     * 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, <tt>null</tt> will be returned.     *     * @param forum the forum to get the "archive forum" of.     * @return the "archive forum" of the specified forum or null if not     *      defined.     * @throws UnauthorizedException if not an admin of <tt>forum</tt> or     *      does not have read permission on the archive forum being returned.     */    public Forum getArchiveForum(Forum forum) throws UnauthorizedException;    /**     * 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.     *     * @param forum the forum to set the "archive forum" of.     * @param archiveForum the "archive forum" for <ttforum</tt>.     * @throws UnauthorizedException if not an admin of <tt>forum</tt> and     *      <tt>archiveForum</tt>.     */    public void setArchiveForum(Forum forum, Forum archiveForum)            throws UnauthorizedException;    /**     * Returns true if auto-archiving is enabled. When enabled, the archiving     * process will be run on a periodic basis.     *     * @return true if auto-archiving is enabled.     * @throws UnauthorizedException if not a system administrator.     */    public boolean isAutoArchiveEnabled() throws UnauthorizedException;    /**     * Enables or disables auto-archiving. When enabled, the archiving     * process will be run on a periodic basis.     *     * @param enabled true if auto-archiving should be enabled.     * @throws UnauthorizedException if not a system administrator.     */    public void setAutoArchiveEnabled(boolean enabled) throws UnauthorizedException;    /**     * Returns the inverval between auto archive executions (in hours).     *     * @return the interval betwen auto archive executions (in hours).     * @throws UnauthorizedException if not a system administrator.     */    public int getAutoArchiveInterval() throws UnauthorizedException;    /**     * Sets the inverval between auto archive executions (in hours).     *     * @param interval the interval betwen auto archive executions (in hours).     * @throws UnauthorizedException if not a system administrator.     */    public void setAutoArchiveInterval(int interval) throws UnauthorizedException;    /**     * Returns true if the archiving process is currently running. The is useful for an     * administration GUI.     *     * @return true if the archiving process is currently running.     * @throws UnauthorizedException if not a system administrator.     */    public boolean isBusy() throws UnauthorizedException;    /**     * Returns the date the archiving process was last run. Returns null if the archiving process     * has never been run.     *     * @return the date the archiving process was last run.     * @throws UnauthorizedException if not a system administrator.     */    public Date getLastArchivedDate() throws UnauthorizedException;    /**     * Manually runs the archiving process.     *     * @throws UnauthorizedException if not a system administrator.     */    public void runArchiver() throws UnauthorizedException;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?