Drupal: funkční logování.
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 java.util.logging.Logger;
25 import org.sonews.feed.Subscription;
26 import org.sonews.storage.Article;
27 import org.sonews.storage.ArticleHead;
28 import org.sonews.storage.Group;
29 import org.sonews.storage.Storage;
30 import org.sonews.storage.StorageBackendException;
31 import org.sonews.util.Pair;
35 * @author František Kučera (frantovo.cz)
37 public class DrupalDatabase implements Storage {
39 private static final Logger log = Logger.getLogger(DrupalDatabase.class.getName());
42 * Rises the database: reconnect and recreate all prepared statements.
43 * @throws java.lang.SQLException
45 protected void arise() throws SQLException {
49 public void addArticle(Article art) throws StorageBackendException {
50 log.log(Level.SEVERE, "TODO: addArticle {0}", new Object[]{art});
54 public void addEvent(long timestamp, int type, long groupID) throws StorageBackendException {
55 log.log(Level.SEVERE, "TODO: addEvent {0} / {1} / {2}", new Object[]{timestamp, type, groupID});
59 public void addGroup(String groupname, int flags) throws StorageBackendException {
60 log.log(Level.SEVERE, "TODO: addGroup {0} / {1}", new Object[]{groupname, flags});
64 public int countArticles() throws StorageBackendException {
65 log.log(Level.SEVERE, "TODO: countArticles");
70 public int countGroups() throws StorageBackendException {
71 log.log(Level.SEVERE, "TODO: countGroups");
76 public void delete(String messageID) throws StorageBackendException {
77 log.log(Level.SEVERE, "TODO: delete {0}", new Object[]{messageID});
81 public Article getArticle(String messageID) throws StorageBackendException {
82 log.log(Level.SEVERE, "TODO: getArticle {0}", new Object[]{messageID});
88 public Article getArticle(long articleIndex, long groupID) throws StorageBackendException {
89 log.log(Level.SEVERE, "TODO: getArticle {0} / {1}", new Object[]{articleIndex, groupID});
95 public List<Pair<Long, ArticleHead>> getArticleHeads(Group group, long first, long last) throws StorageBackendException {
96 log.log(Level.SEVERE, "TODO: getArticleHeads {0} / {1} / {2}", new Object[]{group, first, last});
98 return Collections.emptyList();
102 public List<Pair<Long, String>> getArticleHeaders(Group group, long start, long end, String header, String pattern) throws StorageBackendException {
103 log.log(Level.SEVERE, "TODO: getArticleHeaders {0} / {1} / {2} / {3} / {4}", new Object[]{group, start, end, header, pattern});
105 return Collections.emptyList();
109 public long getArticleIndex(Article art, Group group) throws StorageBackendException {
110 log.log(Level.SEVERE, "TODO: getArticleIndex {0} / {1}", new Object[]{art, group});
116 public List<Long> getArticleNumbers(long groupID) throws StorageBackendException {
117 log.log(Level.SEVERE, "TODO: getArticleNumbers {0}", new Object[]{groupID});
119 return Collections.emptyList();
123 public String getConfigValue(String key) throws StorageBackendException {
124 log.log(Level.SEVERE, "TODO: getConfigValue {0}", new Object[]{key});
129 public int getEventsCount(int eventType, long startTimestamp, long endTimestamp, Group group) throws StorageBackendException {
130 log.log(Level.SEVERE, "TODO: getEventsCount {0} / {1} / {2} / {3}", new Object[]{eventType, startTimestamp, endTimestamp, group});
135 public double getEventsPerHour(int key, long gid) throws StorageBackendException {
136 log.log(Level.SEVERE, "TODO: getEventsPerHour {0} / {1}", new Object[]{key, gid});
141 public int getFirstArticleNumber(Group group) throws StorageBackendException {
142 log.log(Level.SEVERE, "TODO: getFirstArticleNumber {0}", new Object[]{group});
148 public Group getGroup(String name) throws StorageBackendException {
149 log.log(Level.SEVERE, "TODO: getGroup {0}", new Object[]{name});
155 public List<Group> getGroups() throws StorageBackendException {
156 log.log(Level.SEVERE, "TODO: getGroups");
158 return Collections.emptyList();
162 public List<String> getGroupsForList(String listAddress) throws StorageBackendException {
163 log.log(Level.SEVERE, "TODO: getGroupsForList {0}", new Object[]{listAddress});
164 return Collections.emptyList();
168 public int getLastArticleNumber(Group group) throws StorageBackendException {
169 log.log(Level.SEVERE, "TODO: getLastArticleNumber {0}", new Object[]{group});
175 public List<String> getListsForGroup(String groupname) throws StorageBackendException {
176 log.log(Level.SEVERE, "TODO: getListsForGroup {0}", new Object[]{groupname});
177 return Collections.emptyList();
181 public String getOldestArticle() throws StorageBackendException {
182 log.log(Level.SEVERE, "TODO: getOldestArticle");
187 public int getPostingsCount(String groupname) throws StorageBackendException {
188 log.log(Level.SEVERE, "TODO: getPostingsCount {0}", new Object[]{groupname});
193 public List<Subscription> getSubscriptions(int type) throws StorageBackendException {
194 log.log(Level.SEVERE, "TODO: getSubscriptions {0}", new Object[]{type});
195 return Collections.emptyList();
199 public boolean isArticleExisting(String messageID) throws StorageBackendException {
200 log.log(Level.SEVERE, "TODO: isArticleExisting {0}", new Object[]{messageID});
206 public boolean isGroupExisting(String groupname) throws StorageBackendException {
207 log.log(Level.SEVERE, "TODO: isGroupExisting {0}", new Object[]{groupname});
213 public void purgeGroup(Group group) throws StorageBackendException {
214 log.log(Level.SEVERE, "TODO: purgeGroup {0}", new Object[]{group});
218 public void setConfigValue(String key, String value) throws StorageBackendException {
219 log.log(Level.SEVERE, "TODO: setConfigValue {0} = {1}", new Object[]{key, value});
223 public boolean update(Article article) throws StorageBackendException {
224 log.log(Level.SEVERE, "TODO: update {0}", new Object[]{article});
225 throw new StorageBackendException("Not implemented yet.");
229 public boolean update(Group group) throws StorageBackendException {
230 log.log(Level.SEVERE, "TODO: update {0}", new Object[]{group});
231 throw new StorageBackendException("Not implemented yet.");