diff -r 9f0b95aafaa3 -r ed84c8bdd87b src/org/sonews/storage/Channel.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/sonews/storage/Channel.java Sun Aug 29 17:28:58 2010 +0200
@@ -0,0 +1,111 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.sonews.util.Pair;
+
+/**
+ * A logical communication Channel is the a generic structural element for sets
+ * of messages; e.g. a Newsgroup for a set of Articles.
+ * A Channel can either be a real set of messages or an aggregated set of
+ * several subsets.
+ * @author Christian Lins
+ * @since sonews/1.0
+ */
+public abstract class Channel
+{
+
+ /**
+ * If this flag is set the Group is no real newsgroup but a mailing list
+ * mirror. In that case every posting and receiving mails must go through
+ * 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()
+ {
+ List all = new ArrayList();
+
+ /*List agroups = AggregatedGroup.getAll();
+ if(agroups != null)
+ {
+ all.addAll(agroups);
+ }*/
+
+ List groups = Group.getAll();
+ if(groups != null)
+ {
+ all.addAll(groups);
+ }
+
+ return all;
+ }
+
+ public static Channel getByName(String name)
+ throws StorageBackendException
+ {
+ return StorageManager.current().getGroup(name);
+ }
+
+ public abstract Article getArticle(long idx)
+ throws StorageBackendException;
+
+ public abstract List> getArticleHeads(
+ final long first, final long last)
+ throws StorageBackendException;
+
+ public abstract List getArticleNumbers()
+ throws StorageBackendException;
+
+ public abstract long getFirstArticleNumber()
+ throws StorageBackendException;
+
+ public abstract long getIndexOf(Article art)
+ throws StorageBackendException;
+
+ public abstract long getInternalID();
+
+ public abstract long getLastArticleNumber()
+ throws StorageBackendException;
+
+ public abstract String getName();
+
+ public abstract long getPostingsCount()
+ throws StorageBackendException;
+
+ public abstract boolean isDeleted();
+
+ public abstract boolean isWriteable();
+
+}