}
public Forum getForum(String name) throws ForumNotFoundException, UnauthorizedException {
//If cache is not enabled, do a new lookup of object
if (!cacheManager.isCacheEnabled()) {
Forum forum = new DbForum(name, this);
return forum;
}
//Cache is enabled.
CacheableInteger forumIDInteger = (CacheableInteger) cacheManager.get(DbCacheManager.FORUM_ID_CACHE, name);
//if id wan't found in cache, load it up and put it there.
if (forumIDInteger == null) {
Forum forum = new DbForum(name, this);
forumIDInteger = new CacheableInteger(new Integer(forum.getID()));
cacheManager.add(DbCacheManager.FORUM_ID_CACHE, name, forumIDInteger);
}
return getForum(forumIDInteger.getInteger().intValue());
}