geekblog 0.0.1-dev

geekblog
Class TransientDataManager

java.lang.Object
  |
  +--geekblog.TransientDataManager
All Implemented Interfaces:
DataManager

public class TransientDataManager
extends java.lang.Object
implements DataManager


Field Summary
 
Fields inherited from interface geekblog.DataManager
KEY
 
Constructor Summary
TransientDataManager()
           
 
Method Summary
 void destroy(javax.servlet.ServletContext context)
          Tear everything down
 java.util.Collection findEntries(java.lang.String text)
          Find all entries containing some text expression
 java.util.Collection getAllEntries()
          Retrieve every single last one.
 java.util.Collection getArticleEntries()
          Retrieve a list of all the entries marked as articles.
 int getCommentCountForEntry(long entryID)
          Retrieve the count of comments for a given entry.
 java.util.Collection getCommentsForEntry(long entryID)
          Retrieve the list of comments for a given entry.
 java.util.Collection getEntriesForDate(java.util.Date date)
          Retrieve a list of entries for a given date.
 java.util.Collection getEntriesForMonth(java.util.Date date)
          Retrieve a list of entries for a given month/year.
 BlogEntry getEntry(long entryID)
          Retrieve an entry by ID.
 int getEntryCountForDate(java.util.Date date)
          Retrieve a count of the entries for a given date.
 int getEntryCountForMonth(java.util.Date date)
          Retrieve a count of the entries for a given month.
 java.util.Collection getLastNEntries(int n)
          Retrieve the last "n" entries.
 void init(javax.servlet.ServletContext context)
          Set everything up
 void markAsArticle(BlogEntry entry)
          Mark an entry as an article.
 void postComment(long entryID, BlogComment comment)
          Post a comment to an entry.
 void postEntry(BlogEntry entry)
          Post an entry (either new or edited).
 void removeEntry(long entryID)
          Remove an entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransientDataManager

public TransientDataManager()
Method Detail

init

public void init(javax.servlet.ServletContext context)
Description copied from interface: DataManager
Set everything up

Specified by:
init in interface DataManager

destroy

public void destroy(javax.servlet.ServletContext context)
Description copied from interface: DataManager
Tear everything down

Specified by:
destroy in interface DataManager

getEntry

public BlogEntry getEntry(long entryID)
Description copied from interface: DataManager
Retrieve an entry by ID.

Specified by:
getEntry in interface DataManager

getAllEntries

public java.util.Collection getAllEntries()
Retrieve every single last one.

Specified by:
getAllEntries in interface DataManager

getLastNEntries

public java.util.Collection getLastNEntries(int n)
Retrieve the last "n" entries.

Specified by:
getLastNEntries in interface DataManager

getEntriesForDate

public java.util.Collection getEntriesForDate(java.util.Date date)
Description copied from interface: DataManager
Retrieve a list of entries for a given date.

Specified by:
getEntriesForDate in interface DataManager
Parameters:
date - Day/month/year tuple to find entries for. Ignores hour, minutes, seconds.

getEntriesForMonth

public java.util.Collection getEntriesForMonth(java.util.Date date)
Retrieve a list of entries for a given month/year.

Specified by:
getEntriesForMonth in interface DataManager
Parameters:
date - Month/year tuple to find entries for. Ignores day, hour, minutes, seconds.

getEntryCountForDate

public int getEntryCountForDate(java.util.Date date)
Description copied from interface: DataManager
Retrieve a count of the entries for a given date.

Specified by:
getEntryCountForDate in interface DataManager
Parameters:
date - Day/month/year to find count of entries for. Ignores hour, minutes, seconds.

getEntryCountForMonth

public int getEntryCountForMonth(java.util.Date date)
Retrieve a count of the entries for a given month.

Specified by:
getEntryCountForMonth in interface DataManager
Parameters:
date - Month and year to find count of entries for. Ignores day, hour, minutes, seconds.

getCommentCountForEntry

public int getCommentCountForEntry(long entryID)
Retrieve the count of comments for a given entry.

Specified by:
getCommentCountForEntry in interface DataManager
Returns:
The number of comments for the entry, or -1 if the entry is not found.

getCommentsForEntry

public java.util.Collection getCommentsForEntry(long entryID)
Description copied from interface: DataManager
Retrieve the list of comments for a given entry.

Specified by:
getCommentsForEntry in interface DataManager

markAsArticle

public void markAsArticle(BlogEntry entry)
Mark an entry as an article.

Specified by:
markAsArticle in interface DataManager

getArticleEntries

public java.util.Collection getArticleEntries()
Retrieve a list of all the entries marked as articles.

Specified by:
getArticleEntries in interface DataManager

findEntries

public java.util.Collection findEntries(java.lang.String text)
Find all entries containing some text expression

Specified by:
findEntries in interface DataManager

postEntry

public void postEntry(BlogEntry entry)
Description copied from interface: DataManager
Post an entry (either new or edited). Posting an entry that already exists (as indicated by BlogEntry.getID() ) is an update, otherwise insert the new entry into the data store.

Specified by:
postEntry in interface DataManager
Parameters:
entry - The BlogEntry to mark as an article.

postComment

public void postComment(long entryID,
                        BlogComment comment)
Description copied from interface: DataManager
Post a comment to an entry.

Specified by:
postComment in interface DataManager

removeEntry

public void removeEntry(long entryID)
Remove an entry

Specified by:
removeEntry in interface DataManager
Parameters:
entryID - The ID of the entry to remove.

geekblog 0.0.1-dev

Copyright © 2003 Ted Neward. All Rights Reserved.