📄 forum.java
字号:
* Note: this feature not yet implemented.
*
* @param type should be either Forum.THREAD or Forum.MESSAGE
* @return true if the forum is moderated.
*/
//public boolean isModerated(int type);
/**
* Sets whether the forum is moderated. When a forum is moderated,
* posted messages and threads must first be approved by a user with
* moderator permissions.<p>
*
* Note: this feature not yet implemented.
*
* @param type should be either Forum.THREAD or Forum.MESSAGE
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
//public void setModerated(int type, boolean moderated)
// throws UnauthorizedException;
/**
* Factory method to create a Thread.
*
* @param forum the forum to create the thread in.
* @param rootMessage the root message of the thread.
*
* @throws UnauthorizedException if does not have CREATE_THREAD permissions.
*/
public abstract ForumThread createThread(ForumMessage rootMessage) throws
UnauthorizedException;
/**
* Factory method to create a Message.
*
* @param user the user for the message.
* @throws UnauthorizedException if does not have CREATE_MESSAGE permissions.
*/
public abstract ForumMessage createMessage(User user)
throws UnauthorizedException;
/**
* Adds a thread to the forum.
*
* @param thread the thread to add to the forum.
* @throws UnauthorizedException if does not have CREATE_THREAD permissions.
*/
public void addThread(ForumThread thread) throws UnauthorizedException;
/**
* Deletes a thread. Once a thread is deleted, the thread object should
* no longer be used.
*
* @param thread the thread to delete.
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
public void deleteThread(ForumThread thread) throws UnauthorizedException;
/**
* Moves a thread from one forum to another. For this to work, the thread
* must exist in the forum that this method is invoked on, and the user
* calling this method must have ADMIN permissions for the forum this method
* is invoked on and <code>newForum</code>.<p>
*
* The main purpose of this method is to allow admins to move non-topical
* threads into a more appropriate forum.
*
* @param thread the thread to move to another forum.
* @param newForum the forum to move the thread to.
* @throws UnauthorizedException if does not have ADMIN permissions for the
* this forum and <code>newForum</code>.
* @throws IllegalArgumentException if <code>thread</code> does not belong
* to the forum that this method was invoked on.
*/
public void moveThread(ForumThread thread, Forum newForum)
throws UnauthorizedException, IllegalArgumentException;
/**
* Returns the thread specified by id. The method will return null
* if the thread is not in the forum.
*/
public ForumThread getThread(int threadID)
throws ForumThreadNotFoundException;
/**
* Returns a Iterator for the forum to move through the threads.
*/
public Iterator threads();
/**
* Returns a ListIterator for the forum to move through the threads.
*
* @param startIndex the index you'd like to start the iterator at.
* @param numResuls the max number of results iterator will hold.
*/
public Iterator threads(int startIndex, int numResults);
/**
* Returns the number of threads in the forum.
*/
public int getThreadCount();
/**
* Returns the number of messages in the forum.
*/
public int getMessageCount();
/**
* Creates a query object to search the forum. This method is considered
* a first stab at searching in Jive, and will almost certainly be
* modified in the near future.
*/
public Query createQuery();
/**
* Grants a user a particular permission for the forum. Valid permission
* types for a forum are <code>ForumPermissions.ADMIN</code>
*
* @param user the User to grant a permission to.
* @param permissionType the type of permission to grant the user.
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
public void addUserPermission(User user, int permissionType)
throws UnauthorizedException;
/**
* Revokes a particular permission from a user for the forum.
*
* @param user the User to revoke a permission from.
* @param permissionType the type of permission to revoke from the user.
* @throws UnauthorizedException if does not have ADMIN permissions.
* @see ForumPermissions
*/
public void removeUserPermission(User user, int permissionType)
throws UnauthorizedException;
/**
* Returns all the userID's of users with a particular permission.
*
* @param permissionType the type of permission to check.
* @throws UnauthorizedException if does not have ADMIN permissions.
* @see ForumPermissions
*/
public int [] usersWithPermission(int permissionType)
throws UnauthorizedException;
/**
* Grants a group a particular permission for the forum.
*
* @throws UnauthorizedException if does not have ADMIN permissions.
* @see ForumPermissions
*/
public void addGroupPermission(Group group, int permissionType)
throws UnauthorizedException;
/**
* Revokes a particular permission from a group for the forum.
*
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
public void removeGroupPermission(Group group, int permissionType)
throws UnauthorizedException;
/**
* Returns all the groupID's of groups with a particular permission.
*
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
public int[] groupsWithPermission(int permissionType)
throws UnauthorizedException;
/**
* Applies all of the currently active filters to a message.
*
* @param message the ForumMessage to apply filters to.
*/
public ForumMessage applyFilters(ForumMessage message);
/**
* Returns an array of the currently active ForumMessageFilters.
*
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
public ForumMessageFilter[] getForumMessageFilters()
throws UnauthorizedException;
/**
* Adds a new ForumMessageFilter to the end of the filter list.
*
* @param filter ForumMessageFilter to add to the filter list.
*
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
public void addForumMessageFilter(ForumMessageFilter filter)
throws UnauthorizedException;
/**
* Inserts a new ForumMessageFilter at specified index in the filter list.
*
* @param filter ForumMessageFilter to add to the filter list.
* @param index position in filter list to insert new filter.
*
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
public void addForumMessageFilter(ForumMessageFilter filter, int index)
throws UnauthorizedException;
/**
* Removes a ForumMessageFilter at the specified index in the filter list.
*
* @param index position in filter list to remove filter from.
*
* @throws UnauthorizedException if does not have ADMIN permissions.
*/
public void removeForumMessageFilter(int index)
throws UnauthorizedException;
/**
* Returns the permissions for the forum that correspond to the
* passed-in Authorization.
*
* @param authorization the auth token to lookup permissions for.
*/
public abstract ForumPermissions getPermissions(Authorization authorization);
/**
* Returns true if the handle on the object has the permission specified.
* A list of possible permissions can be found in the ForumPermissions
* class. Certain methods of this class are restricted to certain
* permissions as specified in the method comments.
*
* @see ForumPermissions
*/
public boolean hasPermission(int type);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -