Package org.sonews.storage
Interface Storage
- All Known Implementing Classes:
CouchDBStorage
,JDBCDatabase
public interface Storage
A generic storage backend interface.
- Since:
- sonews/1.0
- Author:
- Christian Lins
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addArticle
(Article art) Stores the given Article in the storage.boolean
authenticateUser
(String username, char[] password) Deprecated.int
void
createOrUpdateGroup
(Group group) void
getArticle
(long articleIndex, long groupID) getArticle
(String messageID) getArticleHeaders
(Group group, long start, long end, String header, String pattern) getArticleHeads
(Group group, long first, long last) long
getArticleIndex
(Article art, Group group) getArticleNumbers
(long groupID) int
getFirstArticleNumber
(Group group) int
getLastArticleNumber
(Group group) int
getPostingsCount
(String groupname) boolean
isArticleExisting
(String messageID) void
purgeGroup
(Group group) Performes a purge operation in the storage backend, e.g. to delete old messages or release allocated resources.boolean
Updates headers and group references of the given article.
-
Method Details
-
addArticle
Stores the given Article in the storage.- Parameters:
art
-- Throws:
StorageBackendException
-
countArticles
- Throws:
StorageBackendException
-
createOrUpdateGroup
- Throws:
StorageBackendException
-
delete
- Throws:
StorageBackendException
-
getArticle
- Throws:
StorageBackendException
-
getArticle
- Throws:
StorageBackendException
-
getArticleHeads
List<Pair<Long,Article>> getArticleHeads(Group group, long first, long last) throws StorageBackendException - Throws:
StorageBackendException
-
getArticleHeaders
List<Pair<Long,String>> getArticleHeaders(Group group, long start, long end, String header, String pattern) throws StorageBackendException - Throws:
StorageBackendException
-
getArticleIndex
- Throws:
StorageBackendException
-
getArticleNumbers
- Throws:
StorageBackendException
-
getFirstArticleNumber
- Throws:
StorageBackendException
-
getLastArticleNumber
- Throws:
StorageBackendException
-
getOldestArticle
- Throws:
StorageBackendException
-
getGroups
- Throws:
StorageBackendException
-
getPostingsCount
- Throws:
StorageBackendException
-
isArticleExisting
- Throws:
StorageBackendException
-
purgeGroup
Performes a purge operation in the storage backend, e.g. to delete old messages or release allocated resources.- Parameters:
group
-- Throws:
StorageBackendException
-
update
Updates headers and group references of the given article.- Parameters:
article
-- Returns:
- Throws:
StorageBackendException
-
authenticateUser
@Deprecated boolean authenticateUser(String username, char[] password) throws StorageBackendException Deprecated.TODO Move to separate Authentication Backend- Parameters:
username
-password
-- Returns:
- Throws:
StorageBackendException
-