# HG changeset patch # User František Kučera # Date 1318114973 -7200 # Node ID b58cab5be0f404d4debf688359592a9c821f5d71 # Parent 72950b29569ed76db523d4f2f36e58f001cb602e Drupal: nic to nedělá, jen loguje. diff -r 72950b29569e -r b58cab5be0f4 src/org/sonews/storage/impl/DrupalDatabase.java --- a/src/org/sonews/storage/impl/DrupalDatabase.java Sun Oct 09 00:00:25 2011 +0200 +++ b/src/org/sonews/storage/impl/DrupalDatabase.java Sun Oct 09 01:02:53 2011 +0200 @@ -18,13 +18,16 @@ package org.sonews.storage.impl; import java.sql.SQLException; +import java.util.Collections; import java.util.List; +import java.util.logging.Level; import org.sonews.feed.Subscription; import org.sonews.storage.Article; import org.sonews.storage.ArticleHead; import org.sonews.storage.Group; import org.sonews.storage.Storage; import org.sonews.storage.StorageBackendException; +import org.sonews.util.Log; import org.sonews.util.Pair; /** @@ -42,151 +45,187 @@ @Override public void addArticle(Article art) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: addArticle {0}", new Object[]{art}); } @Override public void addEvent(long timestamp, int type, long groupID) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: addEvent {0} / {1} / {2}", new Object[]{timestamp, type, groupID}); } @Override public void addGroup(String groupname, int flags) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: addGroup {0} / {1}", new Object[]{groupname, flags}); } @Override public int countArticles() throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: countArticles"); + return 0; } @Override public int countGroups() throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: countGroups"); + return 0; } @Override public void delete(String messageID) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: delete {0}", new Object[]{messageID}); } @Override public Article getArticle(String messageID) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getArticle {0}", new Object[]{messageID}); + /** TODO: */ + return null; } @Override public Article getArticle(long articleIndex, long groupID) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getArticle {0} / {1}", new Object[]{articleIndex, groupID}); + /** TODO: */ + return null; } @Override public List> getArticleHeads(Group group, long first, long last) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getArticleHeads {0} / {1} / {2}", new Object[]{group, first, last}); + /** TODO: */ + return Collections.emptyList(); } @Override public List> getArticleHeaders(Group group, long start, long end, String header, String pattern) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getArticleHeaders {0} / {1} / {2} / {3} / {4}", new Object[]{group, start, end, header, pattern}); + /** TODO: */ + return Collections.emptyList(); } @Override public long getArticleIndex(Article art, Group group) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getArticleIndex {0} / {1}", new Object[]{art, group}); + /** TODO: */ + return 0; } @Override public List getArticleNumbers(long groupID) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getArticleNumbers {0}", new Object[]{groupID}); + /** TODO: */ + return Collections.emptyList(); } @Override public String getConfigValue(String key) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getConfigValue {0}", new Object[]{key}); + return null; } @Override public int getEventsCount(int eventType, long startTimestamp, long endTimestamp, Group group) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getEventsCount {0} / {1} / {2} / {3}", new Object[]{eventType, startTimestamp, endTimestamp, group}); + return 0; } @Override public double getEventsPerHour(int key, long gid) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getEventsPerHour {0} / {1}", new Object[]{key, gid}); + return 0; } @Override public int getFirstArticleNumber(Group group) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getFirstArticleNumber {0}", new Object[]{group}); + /** TODO: */ + return 0; } @Override public Group getGroup(String name) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getGroup {0}", new Object[]{name}); + /** TODO: */ + return null; } @Override public List getGroups() throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getGroups"); + /** TODO: */ + return Collections.emptyList(); } @Override public List getGroupsForList(String listAddress) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getGroupsForList {0}", new Object[]{listAddress}); + return Collections.emptyList(); } @Override public int getLastArticleNumber(Group group) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getLastArticleNumber {0}", new Object[]{group}); + /** TODO: */ + return 0; } @Override public List getListsForGroup(String groupname) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getListsForGroup {0}", new Object[]{groupname}); + return Collections.emptyList(); } @Override public String getOldestArticle() throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getOldestArticle"); + return null; } @Override public int getPostingsCount(String groupname) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getPostingsCount {0}", new Object[]{groupname}); + return 0; } @Override public List getSubscriptions(int type) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: getSubscriptions {0}", new Object[]{type}); + return Collections.emptyList(); } @Override public boolean isArticleExisting(String messageID) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: isArticleExisting {0}", new Object[]{messageID}); + /** TODO: */ + return false; } @Override public boolean isGroupExisting(String groupname) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: isGroupExisting {0}", new Object[]{groupname}); + /** TODO: */ + return false; } @Override public void purgeGroup(Group group) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: purgeGroup {0}", new Object[]{group}); } @Override public void setConfigValue(String key, String value) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: setConfigValue {0} = {1}", new Object[]{key, value}); } @Override public boolean update(Article article) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: update {0}", new Object[]{article}); + throw new StorageBackendException("Not implemented yet."); } @Override public boolean update(Group group) throws StorageBackendException { - throw new StorageBackendException("Not supported yet."); + Log.get().log(Level.SEVERE, "TODO: update {0}", new Object[]{group}); + throw new StorageBackendException("Not implemented yet."); } }