geekblog 0.0.1-dev

geekblog
Interface DataManager

All Known Implementing Classes:
JDBCDataManager, TransientDataManager

public interface DataManager


Field Summary
static java.lang.String KEY
          Key to use when storing the DataManager in the ServletContext.
 
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 list 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.
 

Field Detail

KEY

public static final java.lang.String KEY
Key to use when storing the DataManager in the ServletContext.

See Also:
Constant Field Values
Method Detail

init

public void init(javax.servlet.ServletContext context)
Set everything up


destroy

public void destroy(javax.servlet.ServletContext context)
Tear everything down


getEntry

public BlogEntry getEntry(long entryID)
Retrieve an entry by ID.


getAllEntries

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


getLastNEntries

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


getEntriesForDate

public java.util.Collection getEntriesForDate(java.util.Date date)
Retrieve a list of entries for a given date.

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.

Parameters:
date - Month/year tuple to find entries for. Ignores day, hour, minutes, seconds.

getEntryCountForDate

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

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.

Parameters:
date - Month and year to find count of entries for. Ignores day, hour, minutes, seconds.

markAsArticle

public void markAsArticle(BlogEntry entry)
Mark an entry as an article. It is the responsibility of this method to ensure that marking an entry as an article doesn't create two articles out of the same entry.


getArticleEntries

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


findEntries

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


postEntry

public void postEntry(BlogEntry entry)
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.

Parameters:
entry - The BlogEntry to mark as an article.

removeEntry

public void removeEntry(long entryID)
Remove an entry. Also removes all comments associated with that entry. Silently fail if the entry doesn't exst--no exception is thrown.

Parameters:
entryID - The ID of the entry to remove.

getCommentCountForEntry

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


getCommentsForEntry

public java.util.Collection getCommentsForEntry(long entryID)
Retrieve the list of comments for a given entry.


postComment

public void postComment(long entryID,
                        BlogComment comment)
Post a comment to an entry.


geekblog 0.0.1-dev

Copyright © 2003 Ted Neward. All Rights Reserved.