de.fh_mannheim.mm.dms.framework
Class BookmarkManager

java.lang.Object
  extended byde.fh_mannheim.mm.dms.framework.BookmarkManager

public class BookmarkManager
extends java.lang.Object

This class organizes all favorites.

Version:
$Revision: 1.6 $
Author:
Jan Löffler, mail@jlsoft.de

Constructor Summary
BookmarkManager(Config cfg, UploadManager uplMgr, UserManager usrMgr)
          Constructor.
 
Method Summary
 boolean addBookmark(int nUserID, int nFileID, int nType)
          Add a bookmark to a file for a specific user.
 boolean addHit(int nUserID, int nFileID)
          Add a hit to a seen file for a specific user.
 boolean deleteBookmark(int nUserID, int nFileID)
          Delete a bookmark to a file for a specific user.
 BookmarkList getAllBookmarks(int nUserID)
          Get all bookmarks.
 UserList getAllUsersByBookmark(int nFileID)
          Get all users who read this file.
 BookmarkList getFilesByType(int nUserID, int nBookmarkType)
          Get all files by type.
 BookmarkList getLastSeenFiles(int nUserID, int nLimit)
          Get last seen files.
 BookmarkList getMostSeenFiles(int nLimit)
          Get most seen files of all users.
 BookmarkList getMostSeenFiles(int nUserID, int nLimit)
          Get most seen files.
 BookmarkList getMostSeenFilesByEqualUsers(int nUserID, int nUserLimit, int nFileLimit)
          Get most seen files of other users who have the same categories.
 BookmarkList getSelfAddedBookmarks(int nUserID)
          Get all bookmarks.
 boolean isUpdateNotifierEnabled(int nUserID, int nFileID)
          Is update notifier enabled or not.
 boolean setUpdateNotifier(int nUserID, int nFileID)
          Set or remove an update notifier.
 boolean setUpdateNotifier(int nUserID, int nFileID, boolean bEnabled)
          Set or remove an update notifier.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BookmarkManager

public BookmarkManager(Config cfg,
                       UploadManager uplMgr,
                       UserManager usrMgr)
Constructor.

Parameters:
cfg - Config
Method Detail

addBookmark

public boolean addBookmark(int nUserID,
                           int nFileID,
                           int nType)
Add a bookmark to a file for a specific user.

Parameters:
nUserID - User
nFileID - Upload
nType - Type of bookmark
Returns:
true, if successful

addHit

public boolean addHit(int nUserID,
                      int nFileID)
Add a hit to a seen file for a specific user.

Parameters:
nUserID - User
nFileID - Upload
Returns:
true, if successful

deleteBookmark

public boolean deleteBookmark(int nUserID,
                              int nFileID)
Delete a bookmark to a file for a specific user.

Parameters:
nUserID - User
nFileID - Upload
Returns:
true, if successful

getAllBookmarks

public BookmarkList getAllBookmarks(int nUserID)
Get all bookmarks.

Parameters:
nUserID - User
Returns:
BookmarkList with bookmarks

getSelfAddedBookmarks

public BookmarkList getSelfAddedBookmarks(int nUserID)
Get all bookmarks.

Parameters:
nUserID - User
Returns:
BookmarkList with bookmarks

getAllUsersByBookmark

public UserList getAllUsersByBookmark(int nFileID)
Get all users who read this file.

Parameters:
nFileID -
Returns:
All users watching this file

getFilesByType

public BookmarkList getFilesByType(int nUserID,
                                   int nBookmarkType)
Get all files by type.

Parameters:
nUserID - User
nBookmarkType - Bookmarktype
Returns:
BookmarkList with bookmarks

getMostSeenFiles

public BookmarkList getMostSeenFiles(int nLimit)
Get most seen files of all users.

Parameters:
nLimit - Limit
Returns:
BookmarkList with bookmarks

getMostSeenFiles

public BookmarkList getMostSeenFiles(int nUserID,
                                     int nLimit)
Get most seen files.

Parameters:
nUserID - User
nLimit - Limit
Returns:
BookmarkList with bookmarks

getMostSeenFilesByEqualUsers

public BookmarkList getMostSeenFilesByEqualUsers(int nUserID,
                                                 int nUserLimit,
                                                 int nFileLimit)
Get most seen files of other users who have the same categories.

Parameters:
nUserID - User
nUserLimit - Limit of users
nFileLimit - Limit of files
Returns:
BookmarkList with bookmarks

getLastSeenFiles

public BookmarkList getLastSeenFiles(int nUserID,
                                     int nLimit)
Get last seen files.

Parameters:
nUserID - User
nLimit - Limit
Returns:
BookmarkList with bookmarks

isUpdateNotifierEnabled

public boolean isUpdateNotifierEnabled(int nUserID,
                                       int nFileID)
Is update notifier enabled or not.

Parameters:
nUserID - User
nFileID - Upload
Returns:
true, if enabled

setUpdateNotifier

public boolean setUpdateNotifier(int nUserID,
                                 int nFileID)
Set or remove an update notifier.

Parameters:
nUserID - User
nFileID - Upload
Returns:
true, if successful

setUpdateNotifier

public boolean setUpdateNotifier(int nUserID,
                                 int nFileID,
                                 boolean bEnabled)
Set or remove an update notifier.

Parameters:
nUserID - User
nFileID - Upload
bEnabled - Should this be setted or deleted
Returns:
true, if successful