Drupal: nic to nedělá, jen loguje.
3 * see AUTHORS for the list of contributors
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package org.sonews.storage.impl;
20 import java.sql.SQLException;
21 import java.util.Collections;
22 import java.util.List;
23 import java.util.logging.Level;
24 import org.sonews.feed.Subscription;
25 import org.sonews.storage.Article;
26 import org.sonews.storage.ArticleHead;
27 import org.sonews.storage.Group;
28 import org.sonews.storage.Storage;
29 import org.sonews.storage.StorageBackendException;
30 import org.sonews.util.Log;
31 import org.sonews.util.Pair;
35 * @author František Kučera (frantovo.cz)
37 public class DrupalDatabase implements Storage {
40 * Rises the database: reconnect and recreate all prepared statements.
41 * @throws java.lang.SQLException
43 protected void arise() throws SQLException {
47 public void addArticle(Article art) throws StorageBackendException {
48 Log.get().log(Level.SEVERE, "TODO: addArticle {0}", new Object[]{art});
52 public void addEvent(long timestamp, int type, long groupID) throws StorageBackendException {
53 Log.get().log(Level.SEVERE, "TODO: addEvent {0} / {1} / {2}", new Object[]{timestamp, type, groupID});
57 public void addGroup(String groupname, int flags) throws StorageBackendException {
58 Log.get().log(Level.SEVERE, "TODO: addGroup {0} / {1}", new Object[]{groupname, flags});
62 public int countArticles() throws StorageBackendException {
63 Log.get().log(Level.SEVERE, "TODO: countArticles");
68 public int countGroups() throws StorageBackendException {
69 Log.get().log(Level.SEVERE, "TODO: countGroups");
74 public void delete(String messageID) throws StorageBackendException {
75 Log.get().log(Level.SEVERE, "TODO: delete {0}", new Object[]{messageID});
79 public Article getArticle(String messageID) throws StorageBackendException {
80 Log.get().log(Level.SEVERE, "TODO: getArticle {0}", new Object[]{messageID});
86 public Article getArticle(long articleIndex, long groupID) throws StorageBackendException {
87 Log.get().log(Level.SEVERE, "TODO: getArticle {0} / {1}", new Object[]{articleIndex, groupID});
93 public List<Pair<Long, ArticleHead>> getArticleHeads(Group group, long first, long last) throws StorageBackendException {
94 Log.get().log(Level.SEVERE, "TODO: getArticleHeads {0} / {1} / {2}", new Object[]{group, first, last});
96 return Collections.emptyList();
100 public List<Pair<Long, String>> getArticleHeaders(Group group, long start, long end, String header, String pattern) throws StorageBackendException {
101 Log.get().log(Level.SEVERE, "TODO: getArticleHeaders {0} / {1} / {2} / {3} / {4}", new Object[]{group, start, end, header, pattern});
103 return Collections.emptyList();
107 public long getArticleIndex(Article art, Group group) throws StorageBackendException {
108 Log.get().log(Level.SEVERE, "TODO: getArticleIndex {0} / {1}", new Object[]{art, group});
114 public List<Long> getArticleNumbers(long groupID) throws StorageBackendException {
115 Log.get().log(Level.SEVERE, "TODO: getArticleNumbers {0}", new Object[]{groupID});
117 return Collections.emptyList();
121 public String getConfigValue(String key) throws StorageBackendException {
122 Log.get().log(Level.SEVERE, "TODO: getConfigValue {0}", new Object[]{key});
127 public int getEventsCount(int eventType, long startTimestamp, long endTimestamp, Group group) throws StorageBackendException {
128 Log.get().log(Level.SEVERE, "TODO: getEventsCount {0} / {1} / {2} / {3}", new Object[]{eventType, startTimestamp, endTimestamp, group});
133 public double getEventsPerHour(int key, long gid) throws StorageBackendException {
134 Log.get().log(Level.SEVERE, "TODO: getEventsPerHour {0} / {1}", new Object[]{key, gid});
139 public int getFirstArticleNumber(Group group) throws StorageBackendException {
140 Log.get().log(Level.SEVERE, "TODO: getFirstArticleNumber {0}", new Object[]{group});
146 public Group getGroup(String name) throws StorageBackendException {
147 Log.get().log(Level.SEVERE, "TODO: getGroup {0}", new Object[]{name});
153 public List<Group> getGroups() throws StorageBackendException {
154 Log.get().log(Level.SEVERE, "TODO: getGroups");
156 return Collections.emptyList();
160 public List<String> getGroupsForList(String listAddress) throws StorageBackendException {
161 Log.get().log(Level.SEVERE, "TODO: getGroupsForList {0}", new Object[]{listAddress});
162 return Collections.emptyList();
166 public int getLastArticleNumber(Group group) throws StorageBackendException {
167 Log.get().log(Level.SEVERE, "TODO: getLastArticleNumber {0}", new Object[]{group});
173 public List<String> getListsForGroup(String groupname) throws StorageBackendException {
174 Log.get().log(Level.SEVERE, "TODO: getListsForGroup {0}", new Object[]{groupname});
175 return Collections.emptyList();
179 public String getOldestArticle() throws StorageBackendException {
180 Log.get().log(Level.SEVERE, "TODO: getOldestArticle");
185 public int getPostingsCount(String groupname) throws StorageBackendException {
186 Log.get().log(Level.SEVERE, "TODO: getPostingsCount {0}", new Object[]{groupname});
191 public List<Subscription> getSubscriptions(int type) throws StorageBackendException {
192 Log.get().log(Level.SEVERE, "TODO: getSubscriptions {0}", new Object[]{type});
193 return Collections.emptyList();
197 public boolean isArticleExisting(String messageID) throws StorageBackendException {
198 Log.get().log(Level.SEVERE, "TODO: isArticleExisting {0}", new Object[]{messageID});
204 public boolean isGroupExisting(String groupname) throws StorageBackendException {
205 Log.get().log(Level.SEVERE, "TODO: isGroupExisting {0}", new Object[]{groupname});
211 public void purgeGroup(Group group) throws StorageBackendException {
212 Log.get().log(Level.SEVERE, "TODO: purgeGroup {0}", new Object[]{group});
216 public void setConfigValue(String key, String value) throws StorageBackendException {
217 Log.get().log(Level.SEVERE, "TODO: setConfigValue {0} = {1}", new Object[]{key, value});
221 public boolean update(Article article) throws StorageBackendException {
222 Log.get().log(Level.SEVERE, "TODO: update {0}", new Object[]{article});
223 throw new StorageBackendException("Not implemented yet.");
227 public boolean update(Group group) throws StorageBackendException {
228 Log.get().log(Level.SEVERE, "TODO: update {0}", new Object[]{group});
229 throw new StorageBackendException("Not implemented yet.");