# HG changeset patch # User cli # Date 1307383941 -7200 # Node ID 7f84f4de28937b6fe72063ba3cc952db5edb8c1b # Parent 11402b5680810df9598a9daa7c6d9a5828dbcc06 Add HSQLDB stubs and reformat some source files. diff -r 11402b568081 -r 7f84f4de2893 AUTHORS --- a/AUTHORS Wed May 04 18:34:21 2011 +0200 +++ b/AUTHORS Mon Jun 06 20:12:21 2011 +0200 @@ -6,11 +6,12 @@ the Free Software community are mentioned here: sonews News Server -------------------- +------------------ +Copyright (c) 2011 by Christian Lins + Copyright (c) 2009, 2010 by - -Christian Lins -Bernd Eilers + Christian Lins + Bernd Eilers sonews based partly upon diff -r 11402b568081 -r 7f84f4de2893 SConstruct --- a/SConstruct Wed May 04 18:34:21 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -# This file is used to build and automatically test sonews - -import os -env = Environment() - -env['ENV']['LANG'] = 'en_GB.UTF-8' -env['JAVACFLAGS'] = '-source 1.6 -target 1.6' -env['JAVACLASSPATH'] = '/usr/share/java/junit4.jar:/usr/share/java/glassfish-mail.jar:/usr/share/java/servlet-api-2.5.jar:/usr/share/java/jchart2d.jar:classes' - -# Build Java classes -classes = env.Java(target='classes', source=['org/sonews/']) -test_classes = env.Java(target='classes', source=['test']) - -# Setting dependencies -Depends(test_classes, classes) - diff -r 11402b568081 -r 7f84f4de2893 debian/control --- a/debian/control Wed May 04 18:34:21 2011 +0200 +++ b/debian/control Mon Jun 06 20:12:21 2011 +0200 @@ -9,9 +9,8 @@ Package: sonews-server Architecture: all -Depends: openjdk-6-jre-headless | openjdk-6-jre | sun-java6-jre | cacao | jamvm, glassfish-mail, libmysql-java -Suggests: sonews-web, libpg-java, mysql-server, libjchart2d-java +Depends: openjdk-6-jre-headless | openjdk-6-jre | sun-java6-jre, glassfish-mail, libhsqldb-java +Suggests: sonews-web, libpg-java, mysql-server, libmysql-java, libjchart2d-java Description: Usenet news server sonews is a modern Usenet server providing newsgroups via NNTP. A relational database backend is used to store the news data. - The sonews-web providers a configuration web interface. diff -r 11402b568081 -r 7f84f4de2893 makedeb --- a/makedeb Wed May 04 18:34:21 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -#!/bin/bash -x -PACKAGE_ROOT=sonews - -# Compile classes -scons - -# Create JAR files; this cannot be done with SCons, -# because Scons looses inner classes. -jar -cf sonews.jar -C classes/ org/ -jar -ufe sonews.jar org.sonews.Main -jar -cf test.jar -C classes/ test/ -jar -ufe test.jar test.TestBench -jar -cf sonews-helpers.jar helpers/ - -# Create faked root for packaging -sudo rm -r $PACKAGE_ROOT/ -mkdir -p $PACKAGE_ROOT/usr/share/java -mkdir -p $PACKAGE_ROOT/usr/bin -mkdir -p $PACKAGE_ROOT/etc/sonews -mkdir -p $PACKAGE_ROOT/usr/share/doc/sonews/ -cp -r DEBIAN $PACKAGE_ROOT/ -cp helpers/sonews $PACKAGE_ROOT/usr/bin/sonews -cp helpers/sonews.conf.sample $PACKAGE_ROOT/etc/sonews/sonews.conf -cp helpers/copyright $PACKAGE_ROOT/usr/share/doc/sonews/ -cp sonews*.jar $PACKAGE_ROOT/usr/share/java/ - -sudo chown root:root -R $PACKAGE_ROOT/ - -dpkg-deb --build $PACKAGE_ROOT - -# Cleanup -sudo rm -r $PACKAGE_ROOT -rm -r classes/ - -# Check debs -lintian sonews.deb diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/Main.java --- a/src/org/sonews/Main.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/Main.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews; import java.sql.Driver; @@ -42,8 +41,7 @@ * @author Christian Lins * @since sonews/0.5.0 */ -public final class Main -{ +public final class Main { /** Version information of the sonews daemon */ public static final String VERSION = "sonews/1.1.0"; @@ -54,8 +52,7 @@ * @param args * @throws Exception */ - public static void main(String[] args) throws Exception - { + public static void main(String[] args) throws Exception { System.out.println(VERSION); Thread.currentThread().setName("Mainthread"); @@ -106,7 +103,7 @@ // a working JDBCDatabase connection. try { StorageProvider sprov = - StorageManager.loadProvider("org.sonews.storage.impl.JDBCDatabaseProvider"); + StorageManager.loadProvider("org.sonews.storage.impl.JDBCDatabaseProvider"); StorageManager.enableProvider(sprov); // Make sure some elementary groups are existing @@ -118,7 +115,7 @@ ex.printStackTrace(); System.err.println("Database initialization failed with " + ex.toString()); System.err.println("Make sure you have specified the correct database" - + " settings in sonews.conf!"); + + " settings in sonews.conf!"); return; } @@ -154,13 +151,11 @@ daemon.join(); } - private static void printArguments() - { + private static void printArguments() { String usage = Resource.getAsString("helpers/usage", true); System.out.println(usage); } - private Main() - { + private Main() { } } diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/daemon/command/PostCommand.java --- a/src/org/sonews/daemon/command/PostCommand.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/daemon/command/PostCommand.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews.daemon.command; import java.io.IOException; @@ -45,40 +44,35 @@ * @author Christian Lins * @since sonews/0.5.0 */ -public class PostCommand implements Command -{ +public class PostCommand implements Command { private final Article article = new Article(); private int lineCount = 0; private long bodySize = 0; private InternetHeaders headers = null; private long maxBodySize = - Config.inst().get(Config.ARTICLE_MAXSIZE, 128) * 1024L; // Size in bytes + Config.inst().get(Config.ARTICLE_MAXSIZE, 128) * 1024L; // Size in bytes private PostState state = PostState.WaitForLineOne; private final ByteArrayOutputStream bufBody = new ByteArrayOutputStream(); private final StringBuilder strHead = new StringBuilder(); @Override - public String[] getSupportedCommandStrings() - { - return new String[] {"POST"}; + public String[] getSupportedCommandStrings() { + return new String[]{"POST"}; } @Override - public boolean hasFinished() - { + public boolean hasFinished() { return this.state == PostState.Finished; } @Override - public String impliedCapability() - { + public String impliedCapability() { return null; } @Override - public boolean isStateful() - { + public boolean isStateful() { return true; } @@ -90,8 +84,7 @@ */ @Override // TODO: Refactor this method to reduce complexity! public void processLine(NNTPConnection conn, String line, byte[] raw) - throws IOException, StorageBackendException - { + throws IOException, StorageBackendException { switch (state) { case WaitForLineOne: { if (line.equalsIgnoreCase("POST")) { @@ -113,7 +106,7 @@ try { // Parse the header using the InternetHeader class from JavaMail API headers = new InternetHeaders( - new ByteArrayInputStream(strHead.toString().trim().getBytes(conn.getCurrentCharset()))); + new ByteArrayInputStream(strHead.toString().trim().getBytes(conn.getCurrentCharset()))); // add the header entries for the article article.setHeaders(headers); @@ -181,8 +174,7 @@ * @param article */ private void controlMessage(NNTPConnection conn, Article article) - throws IOException - { + throws IOException { String[] ctrl = article.getHeader(Headers.CONTROL)[0].split(" "); if (ctrl.length == 2) // "cancel " { @@ -203,8 +195,7 @@ } private void supersedeMessage(NNTPConnection conn, Article article) - throws IOException - { + throws IOException { try { String oldMsg = article.getHeader(Headers.SUPERSEDES)[0]; StorageManager.current().delete(oldMsg); @@ -217,8 +208,7 @@ } private void postArticle(NNTPConnection conn, Article article) - throws IOException - { + throws IOException { if (article.getHeader(Headers.CONTROL)[0].length() > 0) { controlMessage(conn, article); } else if (article.getHeader(Headers.SUPERSEDES)[0].length() > 0) { @@ -253,7 +243,7 @@ // Log this posting to statistics Stats.getInstance().mailPosted( - article.getHeader(Headers.NEWSGROUPS)[0]); + article.getHeader(Headers.NEWSGROUPS)[0]); } success = true; } diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/storage/Channel.java --- a/src/org/sonews/storage/Channel.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/storage/Channel.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews.storage; import java.util.ArrayList; @@ -30,8 +29,7 @@ * @author Christian Lins * @since sonews/1.0 */ -public abstract class Channel -{ +public abstract class Channel { /** * If this flag is set the Group is no real newsgroup but a mailing list @@ -39,22 +37,19 @@ * the mailing list gateway. */ public static final int MAILINGLIST = 0x1; - /** * If this flag is set the Group is marked as readonly and the posting * is prohibited. This can be useful for groups that are synced only in * one direction. */ public static final int READONLY = 0x2; - /** * If this flag is set the Group is marked as deleted and must not occur * in any output. The deletion is done lazily by a low priority daemon. */ public static final int DELETED = 0x80; - public static List getAll() - { + public static List getAll() { List all = new ArrayList(); /*List agroups = AggregatedGroup.getAll(); @@ -72,36 +67,35 @@ } public static Channel getByName(String name) - throws StorageBackendException - { + throws StorageBackendException { return StorageManager.current().getGroup(name); } public abstract Article getArticle(long idx) - throws StorageBackendException; + throws StorageBackendException; public abstract List> getArticleHeads( - final long first, final long last) - throws StorageBackendException; + final long first, final long last) + throws StorageBackendException; public abstract List getArticleNumbers() - throws StorageBackendException; + throws StorageBackendException; public abstract long getFirstArticleNumber() - throws StorageBackendException; + throws StorageBackendException; public abstract long getIndexOf(Article art) - throws StorageBackendException; + throws StorageBackendException; public abstract long getInternalID(); public abstract long getLastArticleNumber() - throws StorageBackendException; + throws StorageBackendException; public abstract String getName(); public abstract long getPostingsCount() - throws StorageBackendException; + throws StorageBackendException; public abstract boolean isDeleted(); diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/storage/Group.java --- a/src/org/sonews/storage/Group.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/storage/Group.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews.storage; import java.sql.SQLException; @@ -29,8 +28,7 @@ * @since sonews/0.5.0 */ // TODO: This class should not be public! -public class Group extends Channel -{ +public class Group extends Channel { private long id = 0; private int flags = -1; @@ -39,8 +37,7 @@ /** * @return List of all groups this server handles. */ - public static List getAll() - { + public static List getAll() { try { return StorageManager.current().getGroups(); } catch (StorageBackendException ex) { @@ -53,16 +50,14 @@ * @param name * @param id */ - public Group(final String name, final long id, final int flags) - { + public Group(final String name, final long id, final int flags) { this.id = id; this.flags = flags; this.name = name; } @Override - public boolean equals(Object obj) - { + public boolean equals(Object obj) { if (obj instanceof Group) { return ((Group) obj).id == this.id; } else { @@ -71,73 +66,61 @@ } public Article getArticle(long idx) - throws StorageBackendException - { + throws StorageBackendException { return StorageManager.current().getArticle(idx, this.id); } public List> getArticleHeads(final long first, final long last) - throws StorageBackendException - { + throws StorageBackendException { return StorageManager.current().getArticleHeads(this, first, last); } public List getArticleNumbers() - throws StorageBackendException - { + throws StorageBackendException { return StorageManager.current().getArticleNumbers(id); } public long getFirstArticleNumber() - throws StorageBackendException - { + throws StorageBackendException { return StorageManager.current().getFirstArticleNumber(this); } - public int getFlags() - { + public int getFlags() { return this.flags; } public long getIndexOf(Article art) - throws StorageBackendException - { + throws StorageBackendException { return StorageManager.current().getArticleIndex(art, this); } /** * Returns the group id. */ - public long getInternalID() - { + public long getInternalID() { assert id > 0; return id; } - public boolean isDeleted() - { + public boolean isDeleted() { return (this.flags & DELETED) != 0; } - public boolean isMailingList() - { + public boolean isMailingList() { return (this.flags & MAILINGLIST) != 0; } - public boolean isWriteable() - { + public boolean isWriteable() { return true; } public long getLastArticleNumber() - throws StorageBackendException - { + throws StorageBackendException { return StorageManager.current().getLastArticleNumber(this); } - public String getName() - { + public String getName() { return name; } @@ -146,13 +129,11 @@ * in the JDBCDatabase. * @param flag */ - public void setFlag(final int flag) - { + public void setFlag(final int flag) { this.flags |= flag; } - public void setName(final String name) - { + public void setName(final String name) { this.name = name; } @@ -161,8 +142,7 @@ * @throws java.sql.SQLException */ public long getPostingsCount() - throws StorageBackendException - { + throws StorageBackendException { return StorageManager.current().getPostingsCount(this.name); } @@ -170,8 +150,7 @@ * Updates flags and name in the backend. */ public void update() - throws StorageBackendException - { + throws StorageBackendException { StorageManager.current().update(this); } } diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/storage/Storage.java --- a/src/org/sonews/storage/Storage.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/storage/Storage.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews.storage; import java.util.List; @@ -27,8 +26,7 @@ * @author Christian Lins * @since sonews/1.0 */ -public interface Storage -{ +public interface Storage { /** * Stores the given Article in the storage. @@ -36,60 +34,60 @@ * @throws StorageBackendException */ void addArticle(Article art) - throws StorageBackendException; + throws StorageBackendException; void addEvent(long timestamp, int type, long groupID) - throws StorageBackendException; + throws StorageBackendException; void addGroup(String groupname, int flags) - throws StorageBackendException; + throws StorageBackendException; int countArticles() - throws StorageBackendException; + throws StorageBackendException; int countGroups() - throws StorageBackendException; + throws StorageBackendException; void delete(String messageID) - throws StorageBackendException; + throws StorageBackendException; Article getArticle(String messageID) - throws StorageBackendException; + throws StorageBackendException; Article getArticle(long articleIndex, long groupID) - throws StorageBackendException; + throws StorageBackendException; List> getArticleHeads(Group group, long first, long last) - throws StorageBackendException; + throws StorageBackendException; List> getArticleHeaders(Channel channel, long start, long end, - String header, String pattern) - throws StorageBackendException; + String header, String pattern) + throws StorageBackendException; long getArticleIndex(Article art, Group group) - throws StorageBackendException; + throws StorageBackendException; List getArticleNumbers(long groupID) - throws StorageBackendException; + throws StorageBackendException; String getConfigValue(String key) - throws StorageBackendException; + throws StorageBackendException; int getEventsCount(int eventType, long startTimestamp, long endTimestamp, - Channel channel) - throws StorageBackendException; + Channel channel) + throws StorageBackendException; double getEventsPerHour(int key, long gid) - throws StorageBackendException; + throws StorageBackendException; int getFirstArticleNumber(Group group) - throws StorageBackendException; + throws StorageBackendException; Group getGroup(String name) - throws StorageBackendException; + throws StorageBackendException; List getGroups() - throws StorageBackendException; + throws StorageBackendException; /** * Retrieves the collection of groupnames that are associated with the @@ -99,10 +97,10 @@ * @throws StorageBackendException */ List getGroupsForList(String listAddress) - throws StorageBackendException; + throws StorageBackendException; int getLastArticleNumber(Group group) - throws StorageBackendException; + throws StorageBackendException; /** * Returns a list of email addresses that are related to the given @@ -112,28 +110,28 @@ * @throws StorageBackendException */ List getListsForGroup(String groupname) - throws StorageBackendException; + throws StorageBackendException; String getOldestArticle() - throws StorageBackendException; + throws StorageBackendException; int getPostingsCount(String groupname) - throws StorageBackendException; + throws StorageBackendException; List getSubscriptions(int type) - throws StorageBackendException; + throws StorageBackendException; boolean isArticleExisting(String messageID) - throws StorageBackendException; + throws StorageBackendException; boolean isGroupExisting(String groupname) - throws StorageBackendException; + throws StorageBackendException; void purgeGroup(Group group) - throws StorageBackendException; + throws StorageBackendException; void setConfigValue(String key, String value) - throws StorageBackendException; + throws StorageBackendException; /** * Updates headers and channel references of the given article. @@ -142,8 +140,8 @@ * @throws StorageBackendException */ boolean update(Article article) - throws StorageBackendException; + throws StorageBackendException; boolean update(Group group) - throws StorageBackendException; + throws StorageBackendException; } diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/storage/StorageManager.java --- a/src/org/sonews/storage/StorageManager.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/storage/StorageManager.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,22 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews.storage; /** - * + * Provides access to a storage backend. * @author Christian Lins * @since sonews/1.0 */ -public final class StorageManager -{ +public final class StorageManager { private static StorageProvider provider; public static Storage current() - throws StorageBackendException - { + throws StorageBackendException { synchronized (StorageManager.class) { if (provider == null) { return null; @@ -40,8 +37,7 @@ } } - public static StorageProvider loadProvider(String pluginClassName) - { + public static StorageProvider loadProvider(String pluginClassName) { try { Class clazz = Class.forName(pluginClassName); Object inst = clazz.newInstance(); @@ -56,8 +52,7 @@ * Sets the current storage provider. * @param provider */ - public static void enableProvider(StorageProvider provider) - { + public static void enableProvider(StorageProvider provider) { synchronized (StorageManager.class) { if (StorageManager.provider != null) { disableProvider(); @@ -69,8 +64,7 @@ /** * Disables the current provider. */ - public static void disableProvider() - { + public static void disableProvider() { synchronized (StorageManager.class) { provider = null; } diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/storage/StorageProvider.java --- a/src/org/sonews/storage/StorageProvider.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/storage/StorageProvider.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews.storage; /** @@ -23,8 +22,7 @@ * @author Christian Lins * @since sonews/1.0 */ -public interface StorageProvider -{ +public interface StorageProvider { public boolean isSupported(String uri); @@ -35,5 +33,5 @@ * @return The reference to the associated Storage. */ public Storage storage(Thread thread) - throws StorageBackendException; + throws StorageBackendException; } diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/storage/impl/HSQLDB.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/sonews/storage/impl/HSQLDB.java Mon Jun 06 20:12:21 2011 +0200 @@ -0,0 +1,157 @@ +/* + * SONEWS News Server + * see AUTHORS for the list of contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sonews.storage.impl; + +import java.util.List; +import org.sonews.feed.Subscription; +import org.sonews.storage.Article; +import org.sonews.storage.ArticleHead; +import org.sonews.storage.Channel; +import org.sonews.storage.Group; +import org.sonews.storage.Storage; +import org.sonews.storage.StorageBackendException; +import org.sonews.util.Pair; + +/** + * + * @author Christian Lins + * @since sonews/1.1 + */ +public class HSQLDB implements Storage { + + public void addArticle(Article art) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void addEvent(long timestamp, int type, long groupID) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void addGroup(String groupname, int flags) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int countArticles() throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int countGroups() throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void delete(String messageID) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Article getArticle(String messageID) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Article getArticle(long articleIndex, long groupID) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List> getArticleHeaders(Channel channel, long start, long end, String header, String pattern) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List> getArticleHeads(Group group, long first, long last) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public long getArticleIndex(Article art, Group group) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List getArticleNumbers(long groupID) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getConfigValue(String key) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getEventsCount(int eventType, long startTimestamp, long endTimestamp, Channel channel) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public double getEventsPerHour(int key, long gid) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getFirstArticleNumber(Group group) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Group getGroup(String name) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List getGroups() throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List getGroupsForList(String listAddress) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getLastArticleNumber(Group group) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List getListsForGroup(String groupname) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getOldestArticle() throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getPostingsCount(String groupname) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List getSubscriptions(int type) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isArticleExisting(String messageID) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isGroupExisting(String groupname) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void purgeGroup(Group group) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setConfigValue(String key, String value) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean update(Article article) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean update(Group group) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/storage/impl/HSQLDBProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/sonews/storage/impl/HSQLDBProvider.java Mon Jun 06 20:12:21 2011 +0200 @@ -0,0 +1,39 @@ +/* + * SONEWS News Server + * see AUTHORS for the list of contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.sonews.storage.impl; + +import org.sonews.storage.Storage; +import org.sonews.storage.StorageBackendException; +import org.sonews.storage.StorageProvider; + +/** + * + * @author Christian Lins + * @since sonews/1.1 + */ +public class HSQLDBProvider implements StorageProvider { + + public boolean isSupported(String uri) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Storage storage(Thread thread) throws StorageBackendException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/storage/impl/JDBCDatabaseProvider.java --- a/src/org/sonews/storage/impl/JDBCDatabaseProvider.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/storage/impl/JDBCDatabaseProvider.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews.storage.impl; import java.sql.SQLException; @@ -30,21 +29,18 @@ * @author Christian Lins * @since sonews/1.0 */ -public class JDBCDatabaseProvider implements StorageProvider -{ +public class JDBCDatabaseProvider implements StorageProvider { protected static final Map instances = new ConcurrentHashMap(); @Override - public boolean isSupported(String uri) - { + public boolean isSupported(String uri) { throw new UnsupportedOperationException("Not supported yet."); } @Override public Storage storage(Thread thread) - throws StorageBackendException - { + throws StorageBackendException { try { if (!instances.containsKey(Thread.currentThread())) { JDBCDatabase db = new JDBCDatabase(); diff -r 11402b568081 -r 7f84f4de2893 src/org/sonews/util/io/ArticleInputStream.java --- a/src/org/sonews/util/io/ArticleInputStream.java Wed May 04 18:34:21 2011 +0200 +++ b/src/org/sonews/util/io/ArticleInputStream.java Mon Jun 06 20:12:21 2011 +0200 @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package org.sonews.util.io; import java.io.ByteArrayOutputStream; @@ -29,15 +28,13 @@ * @author Christian Lins * @since sonews/0.5.0 */ -public class ArticleInputStream extends InputStream -{ +public class ArticleInputStream extends InputStream { private byte[] buf; private int pos = 0; public ArticleInputStream(final Article art) - throws IOException, UnsupportedEncodingException - { + throws IOException, UnsupportedEncodingException { final ByteArrayOutputStream out = new ByteArrayOutputStream(); out.write(art.getHeaderSource().getBytes("UTF-8")); out.write("\r\n\r\n".getBytes()); @@ -56,8 +53,7 @@ * @return The byte read, or -1 if end of stream */ @Override - public synchronized int read() - { + public synchronized int read() { if (pos < buf.length) { return ((int) buf[pos++]) & 0xFF; } else {