Java Doc for ForumRepository.java in  » Forum » JForum-2.1.8 » net » jforum » repository » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Forum » JForum 2.1.8 » net.jforum.repository 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.jforum.repository.ForumRepository

ForumRepository
public class ForumRepository implements Cacheable(Code)
Repository for the forums of the System. This repository acts like a cache system, to avoid repetitive and unnecessary SQL queries every time we need some info about the forums. To start the repository, call the method start(ForumModel, CategoryModel)
author:
   Rafael Steil
version:
   $Id: ForumRepository.java,v 1.60 2007/09/10 23:06:59 rafaelsteil Exp $




Method Summary
public static synchronized  voidaddCategory(Category c)
     Adds a new category to the cache.
public static synchronized  voidaddForum(Forum forum)
    
public static  voidclearModeratorList()
    
public static  ListgetAllCategories(int userId)
     Gets all categories from the cache.
public static  ListgetAllCategories()
     Get all categories. A call to @link #getAllCategories(int) is made, passing the return of SessionFacade.getUserSession().getUserId() as the value for the "userId" argument. List with the categories.
public static  CategorygetCategory(int categoryId)
     Gets a category by its id.
public static  CategorygetCategory(int userId, int categoryId)
     Gets a category by its id.
public static  CategorygetCategory(PermissionControl pc, int categoryId)
    
public static  ForumgetForum(int forumId)
    
public static  LastPostInfogetLastPostInfo(Forum forum)
     Gets information about the last message posted in some forum.
public static  LastPostInfogetLastPostInfo(int forumId)
     Gets information about the last message posted in some forum.
public static  StringgetListAllowedForums()
    
public static  ListgetModeratorList(int forumId)
     Gets information about the moderators of some forum.
public static  MostUsersEverOnlinegetMostUsersEverOnline()
    
public static  intgetTotalMessages()
     Gets the number of messages in the entire board.
public static  intgetTotalMessages(boolean fromDb)
     Gets the number of messags in the entire board.
Parameters:
  fromDb - If true, a query to the database willbe made, to retrieve the desired information.
public static synchronized  voidincrementTotalMessages()
    
public static  voidincrementTotalUsers()
    
public static  booleanisCategoryAccessible(int userId, int categoryId)
     Check is some category is accessible.
public static  booleanisCategoryAccessible(int categoryId)
     Check if some category is accessible.
public static  booleanisCategoryAccessible(PermissionControl pc, int categoryId)
     Check is some category is accessible.
public static  booleanisForumAccessible(int forumId)
    
public static  booleanisForumAccessible(int userId, int forumId)
    
public static  booleanisForumAccessible(int userId, int categoryId, int forumId)
    
public static  UserlastRegisteredUser()
    
public static synchronized  voidrefreshCategory(Category c)
     Refreshes a category entry in the cache.
public static synchronized  voidrefreshForum(Forum forum)
    
public static synchronized  voidreloadCategory(Category c)
     Updates some category. This method only updated the "name" and "order" fields.
public static synchronized  voidreloadForum(int forumId)
     Reloads a forum. The forum should already be in the cache and SHOULD NOT have its order changed.
public static synchronized  voidremoveCategory(Category c)
     Remove a category from the cache
Parameters:
  c - The category to remove.
public static synchronized  voidremoveForum(Forum forum)
     Removes a forum from the cache.
public static  CategoryretrieveCategory(int categoryId)
    
public  voidsetCacheEngine(CacheEngine engine)
    
public static  voidsetLastRegisteredUser(User user)
    
public static synchronized  voidstart(ForumDAO fm, CategoryDAO cm, ConfigDAO configModel)
     Starts the repository.
public static  IntegertotalUsers()
    
public static synchronized  voidupdateForumStats(Topic t, User u, Post p)
    
public static  voidupdateMostUsersEverOnline(MostUsersEverOnline m)
     Update the value of most online users ever.
Parameters:
  m - MostUsersEverOnline The new value to store.



Method Detail
addCategory
public static synchronized void addCategory(Category c)(Code)
Adds a new category to the cache.
Parameters:
  c - The category instance to insert in the cache.



addForum
public static synchronized void addForum(Forum forum)(Code)
Adds a new forum to the cache repository.
Parameters:
  forum - The forum to add



clearModeratorList
public static void clearModeratorList()(Code)



getAllCategories
public static List getAllCategories(int userId)(Code)
Gets all categories from the cache.
Parameters:
  userId - int List with the categories. Each entry is a Category object.



getAllCategories
public static List getAllCategories()(Code)
Get all categories. A call to @link #getAllCategories(int) is made, passing the return of SessionFacade.getUserSession().getUserId() as the value for the "userId" argument. List with the categories. Each entry is a Category object.
See Also:   ForumRepository.getAllCategories(int)



getCategory
public static Category getCategory(int categoryId)(Code)
Gets a category by its id. A call to @link #getCategory(int, int) is made, using the return of SessionFacade.getUserSession().getUserId() as argument for the "userId" parameter.
Parameters:
  categoryId - The id of the category to check null if the category is either notfound or access is denied.
See Also:   ForumRepository.getCategory(int,int)



getCategory
public static Category getCategory(int userId, int categoryId)(Code)
Gets a category by its id.
Parameters:
  userId - The user id who is requesting the category
Parameters:
  categoryId - The id of the category to get null if the category is either notfound or access is denied.
See Also:   ForumRepository.getCategory(int)



getCategory
public static Category getCategory(PermissionControl pc, int categoryId)(Code)



getForum
public static Forum getForum(int forumId)(Code)
Gets a specific forum from the cache.
Parameters:
  forumId - The forum's ID to get net.jforum.Forum object instance or nullif the forum was not found or is not accessible to the user.



getLastPostInfo
public static LastPostInfo getLastPostInfo(Forum forum)(Code)
Gets information about the last message posted in some forum.
Parameters:
  forum - The forum to retrieve information LastPostInfo



getLastPostInfo
public static LastPostInfo getLastPostInfo(int forumId)(Code)
Gets information about the last message posted in some forum.
Parameters:
  forumId - The forum's id to retrieve information LastPostInfo



getListAllowedForums
public static String getListAllowedForums()(Code)



getModeratorList
public static List getModeratorList(int forumId)(Code)
Gets information about the moderators of some forum.
Parameters:
  forumId - The forum to retrieve information List



getMostUsersEverOnline
public static MostUsersEverOnline getMostUsersEverOnline()(Code)
Gets the number of most online users ever MostUsersEverOnline



getTotalMessages
public static int getTotalMessages()(Code)
Gets the number of messages in the entire board. int
See Also:   ForumRepository.getTotalMessages(boolean)



getTotalMessages
public static int getTotalMessages(boolean fromDb)(Code)
Gets the number of messags in the entire board.
Parameters:
  fromDb - If true, a query to the database willbe made, to retrieve the desired information. If false, thedata will be fetched from the cache. The number of messages posted in the board.
See Also:   ForumRepository.getTotalMessages()



incrementTotalMessages
public static synchronized void incrementTotalMessages()(Code)



incrementTotalUsers
public static void incrementTotalUsers()(Code)



isCategoryAccessible
public static boolean isCategoryAccessible(int userId, int categoryId)(Code)
Check is some category is accessible.
Parameters:
  userId - The user's id who is trying to get the category
Parameters:
  categoryId - The category's id to check for access rights true if access to the category is allowed.



isCategoryAccessible
public static boolean isCategoryAccessible(int categoryId)(Code)
Check if some category is accessible.
Parameters:
  categoryId - The category id to check for access rights true if access to the category is allowed.



isCategoryAccessible
public static boolean isCategoryAccessible(PermissionControl pc, int categoryId)(Code)
Check is some category is accessible.
Parameters:
  pc - The PermissionControl instance containingall security info related to the user.
Parameters:
  categoryId - the category's id to check for access rights true if access to the category is allowed.



isForumAccessible
public static boolean isForumAccessible(int forumId)(Code)



isForumAccessible
public static boolean isForumAccessible(int userId, int forumId)(Code)



isForumAccessible
public static boolean isForumAccessible(int userId, int categoryId, int forumId)(Code)



lastRegisteredUser
public static User lastRegisteredUser()(Code)



refreshCategory
public static synchronized void refreshCategory(Category c)(Code)
Refreshes a category entry in the cache.
Parameters:
  c - The category to refresh



refreshForum
public static synchronized void refreshForum(Forum forum)(Code)



reloadCategory
public static synchronized void reloadCategory(Category c)(Code)
Updates some category. This method only updated the "name" and "order" fields.
Parameters:
  c - The category to update. The method will search for a categorywith the same id and update its data.



reloadForum
public static synchronized void reloadForum(int forumId)(Code)
Reloads a forum. The forum should already be in the cache and SHOULD NOT have its order changed. If the forum's order was changed, then you MUST CALL @link Category#changeForumOrder(Forum) BEFORE calling this method.
Parameters:
  forumId - int The forum to reload its information



removeCategory
public static synchronized void removeCategory(Category c)(Code)
Remove a category from the cache
Parameters:
  c - The category to remove. The instance should have the category id at least



removeForum
public static synchronized void removeForum(Forum forum)(Code)
Removes a forum from the cache.
Parameters:
  forum - The forum instance to remove.



retrieveCategory
public static Category retrieveCategory(int categoryId)(Code)



setCacheEngine
public void setCacheEngine(CacheEngine engine)(Code)

See Also:   net.jforum.cache.Cacheable.setCacheEngine(net.jforum.cache.CacheEngine)



setLastRegisteredUser
public static void setLastRegisteredUser(User user)(Code)



start
public static synchronized void start(ForumDAO fm, CategoryDAO cm, ConfigDAO configModel)(Code)
Starts the repository.
Parameters:
  fm - The ForumModel instance which will beused to retrieve information about the forums.
Parameters:
  cm - The CategoryModel instance which willbe used to retrieve information about the categories.
Parameters:
  configModel - ConfigDAO



totalUsers
public static Integer totalUsers()(Code)



updateForumStats
public static synchronized void updateForumStats(Topic t, User u, Post p)(Code)



updateMostUsersEverOnline
public static void updateMostUsersEverOnline(MostUsersEverOnline m)(Code)
Update the value of most online users ever.
Parameters:
  m - MostUsersEverOnline The new value to store. Generally itwill be a bigger one.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.