Drupal: pořadí metod.
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 List<Group> getGroups() throws StorageBackendException {
50 log.log(Level.SEVERE, "TODO: getGroups");
52 return Collections.emptyList();
56 public Group getGroup(String name) throws StorageBackendException {
57 log.log(Level.SEVERE, "TODO: getGroup {0}", new Object[]{name});
63 public boolean isGroupExisting(String groupname) throws StorageBackendException {
64 log.log(Level.SEVERE, "TODO: isGroupExisting {0}", new Object[]{groupname});
70 public Article getArticle(String messageID) throws StorageBackendException {
71 log.log(Level.SEVERE, "TODO: getArticle {0}", new Object[]{messageID});
77 public Article getArticle(long articleIndex, long groupID) throws StorageBackendException {
78 log.log(Level.SEVERE, "TODO: getArticle {0} / {1}", new Object[]{articleIndex, groupID});
84 public List<Pair<Long, ArticleHead>> getArticleHeads(Group group, long first, long last) throws StorageBackendException {
85 log.log(Level.SEVERE, "TODO: getArticleHeads {0} / {1} / {2}", new Object[]{group, first, last});
87 return Collections.emptyList();
91 public List<Pair<Long, String>> getArticleHeaders(Group group, long start, long end, String header, String pattern) throws StorageBackendException {
92 log.log(Level.SEVERE, "TODO: getArticleHeaders {0} / {1} / {2} / {3} / {4}", new Object[]{group, start, end, header, pattern});
94 return Collections.emptyList();
98 public long getArticleIndex(Article art, Group group) throws StorageBackendException {
99 log.log(Level.SEVERE, "TODO: getArticleIndex {0} / {1}", new Object[]{art, group});
105 public List<Long> getArticleNumbers(long groupID) throws StorageBackendException {
106 log.log(Level.SEVERE, "TODO: getArticleNumbers {0}", new Object[]{groupID});
108 return Collections.emptyList();
112 public int getFirstArticleNumber(Group group) throws StorageBackendException {
113 log.log(Level.SEVERE, "TODO: getFirstArticleNumber {0}", new Object[]{group});
119 public int getLastArticleNumber(Group group) throws StorageBackendException {
120 log.log(Level.SEVERE, "TODO: getLastArticleNumber {0}", new Object[]{group});
126 public boolean isArticleExisting(String messageID) throws StorageBackendException {
127 log.log(Level.SEVERE, "TODO: isArticleExisting {0}", new Object[]{messageID});
133 // --- zatím neimplementovat ---
136 public void addArticle(Article art) throws StorageBackendException {
137 log.log(Level.SEVERE, "TODO: addArticle {0}", new Object[]{art});
141 public void addEvent(long timestamp, int type, long groupID) throws StorageBackendException {
142 log.log(Level.SEVERE, "TODO: addEvent {0} / {1} / {2}", new Object[]{timestamp, type, groupID});
146 public void addGroup(String groupname, int flags) throws StorageBackendException {
147 log.log(Level.SEVERE, "TODO: addGroup {0} / {1}", new Object[]{groupname, flags});
151 public int countArticles() throws StorageBackendException {
152 log.log(Level.SEVERE, "TODO: countArticles");
157 public int countGroups() throws StorageBackendException {
158 log.log(Level.SEVERE, "TODO: countGroups");
163 public void delete(String messageID) throws StorageBackendException {
164 log.log(Level.SEVERE, "TODO: delete {0}", new Object[]{messageID});
168 public String getConfigValue(String key) throws StorageBackendException {
169 log.log(Level.SEVERE, "TODO: getConfigValue {0}", new Object[]{key});
174 public int getEventsCount(int eventType, long startTimestamp, long endTimestamp, Group group) throws StorageBackendException {
175 log.log(Level.SEVERE, "TODO: getEventsCount {0} / {1} / {2} / {3}", new Object[]{eventType, startTimestamp, endTimestamp, group});
180 public double getEventsPerHour(int key, long gid) throws StorageBackendException {
181 log.log(Level.SEVERE, "TODO: getEventsPerHour {0} / {1}", new Object[]{key, gid});
186 public List<String> getGroupsForList(String listAddress) throws StorageBackendException {
187 log.log(Level.SEVERE, "TODO: getGroupsForList {0}", new Object[]{listAddress});
188 return Collections.emptyList();
192 public List<String> getListsForGroup(String groupname) throws StorageBackendException {
193 log.log(Level.SEVERE, "TODO: getListsForGroup {0}", new Object[]{groupname});
194 return Collections.emptyList();
198 public String getOldestArticle() throws StorageBackendException {
199 log.log(Level.SEVERE, "TODO: getOldestArticle");
204 public int getPostingsCount(String groupname) throws StorageBackendException {
205 log.log(Level.SEVERE, "TODO: getPostingsCount {0}", new Object[]{groupname});
210 public List<Subscription> getSubscriptions(int type) throws StorageBackendException {
211 log.log(Level.SEVERE, "TODO: getSubscriptions {0}", new Object[]{type});
212 return Collections.emptyList();
216 public void purgeGroup(Group group) throws StorageBackendException {
217 log.log(Level.SEVERE, "TODO: purgeGroup {0}", new Object[]{group});
221 public void setConfigValue(String key, String value) throws StorageBackendException {
222 log.log(Level.SEVERE, "TODO: setConfigValue {0} = {1}", new Object[]{key, value});
226 public boolean update(Article article) throws StorageBackendException {
227 log.log(Level.SEVERE, "TODO: update {0}", new Object[]{article});
228 throw new StorageBackendException("Not implemented yet.");
232 public boolean update(Group group) throws StorageBackendException {
233 log.log(Level.SEVERE, "TODO: update {0}", new Object[]{group});
234 throw new StorageBackendException("Not implemented yet.");