franta-hg@63: /*
franta-hg@63: * SONEWS News Server
franta-hg@63: * see AUTHORS for the list of contributors
franta-hg@63: *
franta-hg@63: * This program is free software: you can redistribute it and/or modify
franta-hg@63: * it under the terms of the GNU General Public License as published by
franta-hg@63: * the Free Software Foundation, either version 3 of the License, or
franta-hg@63: * (at your option) any later version.
franta-hg@63: *
franta-hg@63: * This program is distributed in the hope that it will be useful,
franta-hg@63: * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@63: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@63: * GNU General Public License for more details.
franta-hg@63: *
franta-hg@63: * You should have received a copy of the GNU General Public License
franta-hg@63: * along with this program. If not, see .
franta-hg@63: */
franta-hg@63: package org.sonews.storage.impl;
franta-hg@63:
franta-hg@64: import java.sql.SQLException;
franta-hg@65: import java.util.Collections;
franta-hg@64: import java.util.List;
franta-hg@65: import java.util.logging.Level;
franta-hg@64: import org.sonews.feed.Subscription;
franta-hg@64: import org.sonews.storage.Article;
franta-hg@64: import org.sonews.storage.ArticleHead;
franta-hg@64: import org.sonews.storage.Group;
franta-hg@64: import org.sonews.storage.Storage;
franta-hg@64: import org.sonews.storage.StorageBackendException;
franta-hg@65: import org.sonews.util.Log;
franta-hg@64: import org.sonews.util.Pair;
franta-hg@64:
franta-hg@63: /**
franta-hg@63: *
franta-hg@63: * @author František Kučera (frantovo.cz)
franta-hg@63: */
franta-hg@64: public class DrupalDatabase implements Storage {
franta-hg@64:
franta-hg@64: /**
franta-hg@64: * Rises the database: reconnect and recreate all prepared statements.
franta-hg@64: * @throws java.lang.SQLException
franta-hg@64: */
franta-hg@64: protected void arise() throws SQLException {
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public void addArticle(Article art) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: addArticle {0}", new Object[]{art});
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public void addEvent(long timestamp, int type, long groupID) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: addEvent {0} / {1} / {2}", new Object[]{timestamp, type, groupID});
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public void addGroup(String groupname, int flags) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: addGroup {0} / {1}", new Object[]{groupname, flags});
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public int countArticles() throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: countArticles");
franta-hg@65: return 0;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public int countGroups() throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: countGroups");
franta-hg@65: return 0;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public void delete(String messageID) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: delete {0}", new Object[]{messageID});
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public Article getArticle(String messageID) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getArticle {0}", new Object[]{messageID});
franta-hg@65: /** TODO: */
franta-hg@65: return null;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public Article getArticle(long articleIndex, long groupID) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getArticle {0} / {1}", new Object[]{articleIndex, groupID});
franta-hg@65: /** TODO: */
franta-hg@65: return null;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public List> getArticleHeads(Group group, long first, long last) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getArticleHeads {0} / {1} / {2}", new Object[]{group, first, last});
franta-hg@65: /** TODO: */
franta-hg@65: return Collections.emptyList();
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public List> getArticleHeaders(Group group, long start, long end, String header, String pattern) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getArticleHeaders {0} / {1} / {2} / {3} / {4}", new Object[]{group, start, end, header, pattern});
franta-hg@65: /** TODO: */
franta-hg@65: return Collections.emptyList();
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public long getArticleIndex(Article art, Group group) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getArticleIndex {0} / {1}", new Object[]{art, group});
franta-hg@65: /** TODO: */
franta-hg@65: return 0;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public List getArticleNumbers(long groupID) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getArticleNumbers {0}", new Object[]{groupID});
franta-hg@65: /** TODO: */
franta-hg@65: return Collections.emptyList();
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public String getConfigValue(String key) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getConfigValue {0}", new Object[]{key});
franta-hg@65: return null;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public int getEventsCount(int eventType, long startTimestamp, long endTimestamp, Group group) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getEventsCount {0} / {1} / {2} / {3}", new Object[]{eventType, startTimestamp, endTimestamp, group});
franta-hg@65: return 0;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public double getEventsPerHour(int key, long gid) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getEventsPerHour {0} / {1}", new Object[]{key, gid});
franta-hg@65: return 0;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public int getFirstArticleNumber(Group group) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getFirstArticleNumber {0}", new Object[]{group});
franta-hg@65: /** TODO: */
franta-hg@65: return 0;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public Group getGroup(String name) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getGroup {0}", new Object[]{name});
franta-hg@65: /** TODO: */
franta-hg@65: return null;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public List getGroups() throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getGroups");
franta-hg@65: /** TODO: */
franta-hg@65: return Collections.emptyList();
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public List getGroupsForList(String listAddress) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getGroupsForList {0}", new Object[]{listAddress});
franta-hg@65: return Collections.emptyList();
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public int getLastArticleNumber(Group group) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getLastArticleNumber {0}", new Object[]{group});
franta-hg@65: /** TODO: */
franta-hg@65: return 0;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public List getListsForGroup(String groupname) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getListsForGroup {0}", new Object[]{groupname});
franta-hg@65: return Collections.emptyList();
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public String getOldestArticle() throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getOldestArticle");
franta-hg@65: return null;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public int getPostingsCount(String groupname) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getPostingsCount {0}", new Object[]{groupname});
franta-hg@65: return 0;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public List getSubscriptions(int type) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: getSubscriptions {0}", new Object[]{type});
franta-hg@65: return Collections.emptyList();
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public boolean isArticleExisting(String messageID) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: isArticleExisting {0}", new Object[]{messageID});
franta-hg@65: /** TODO: */
franta-hg@65: return false;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public boolean isGroupExisting(String groupname) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: isGroupExisting {0}", new Object[]{groupname});
franta-hg@65: /** TODO: */
franta-hg@65: return false;
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public void purgeGroup(Group group) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: purgeGroup {0}", new Object[]{group});
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public void setConfigValue(String key, String value) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: setConfigValue {0} = {1}", new Object[]{key, value});
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public boolean update(Article article) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: update {0}", new Object[]{article});
franta-hg@65: throw new StorageBackendException("Not implemented yet.");
franta-hg@64: }
franta-hg@64:
franta-hg@64: @Override
franta-hg@64: public boolean update(Group group) throws StorageBackendException {
franta-hg@65: Log.get().log(Level.SEVERE, "TODO: update {0}", new Object[]{group});
franta-hg@65: throw new StorageBackendException("Not implemented yet.");
franta-hg@64: }
franta-hg@63: }