1.1 --- a/src/org/sonews/storage/Channel.java Sun Sep 11 14:19:19 2011 +0200
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,103 +0,0 @@
1.4 -/*
1.5 - * SONEWS News Server
1.6 - * see AUTHORS for the list of contributors
1.7 - *
1.8 - * This program is free software: you can redistribute it and/or modify
1.9 - * it under the terms of the GNU General Public License as published by
1.10 - * the Free Software Foundation, either version 3 of the License, or
1.11 - * (at your option) any later version.
1.12 - *
1.13 - * This program is distributed in the hope that it will be useful,
1.14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.16 - * GNU General Public License for more details.
1.17 - *
1.18 - * You should have received a copy of the GNU General Public License
1.19 - * along with this program. If not, see <http://www.gnu.org/licenses/>.
1.20 - */
1.21 -package org.sonews.storage;
1.22 -
1.23 -import java.util.ArrayList;
1.24 -import java.util.List;
1.25 -import org.sonews.util.Pair;
1.26 -
1.27 -/**
1.28 - * A logical communication Channel is the a generic structural element for sets
1.29 - * of messages; e.g. a Newsgroup for a set of Articles.
1.30 - * A Channel can either be a real set of messages or an aggregated set of
1.31 - * several subsets.
1.32 - * @author Christian Lins
1.33 - * @since sonews/1.0
1.34 - */
1.35 -public abstract class Channel {
1.36 -
1.37 - /**
1.38 - * If this flag is set the Group is no real newsgroup but a mailing list
1.39 - * mirror. In that case every posting and receiving mails must go through
1.40 - * the mailing list gateway.
1.41 - */
1.42 - public static final int MAILINGLIST = 0x1;
1.43 - /**
1.44 - * If this flag is set the Group is marked as readonly and the posting
1.45 - * is prohibited. This can be useful for groups that are synced only in
1.46 - * one direction.
1.47 - */
1.48 - public static final int READONLY = 0x2;
1.49 - /**
1.50 - * If this flag is set the Group is marked as deleted and must not occur
1.51 - * in any output. The deletion is done lazily by a low priority daemon.
1.52 - */
1.53 - public static final int DELETED = 0x80;
1.54 -
1.55 - public static List<Channel> getAll() {
1.56 - List<Channel> all = new ArrayList<Channel>();
1.57 -
1.58 - /*List<Channel> agroups = AggregatedGroup.getAll();
1.59 - if(agroups != null)
1.60 - {
1.61 - all.addAll(agroups);
1.62 - }*/
1.63 -
1.64 - List<Channel> groups = Group.getAll();
1.65 - if (groups != null) {
1.66 - all.addAll(groups);
1.67 - }
1.68 -
1.69 - return all;
1.70 - }
1.71 -
1.72 - public static Channel getByName(String name)
1.73 - throws StorageBackendException {
1.74 - return StorageManager.current().getGroup(name);
1.75 - }
1.76 -
1.77 - public abstract Article getArticle(long idx)
1.78 - throws StorageBackendException;
1.79 -
1.80 - public abstract List<Pair<Long, ArticleHead>> getArticleHeads(
1.81 - final long first, final long last)
1.82 - throws StorageBackendException;
1.83 -
1.84 - public abstract List<Long> getArticleNumbers()
1.85 - throws StorageBackendException;
1.86 -
1.87 - public abstract long getFirstArticleNumber()
1.88 - throws StorageBackendException;
1.89 -
1.90 - public abstract long getIndexOf(Article art)
1.91 - throws StorageBackendException;
1.92 -
1.93 - public abstract long getInternalID();
1.94 -
1.95 - public abstract long getLastArticleNumber()
1.96 - throws StorageBackendException;
1.97 -
1.98 - public abstract String getName();
1.99 -
1.100 - public abstract long getPostingsCount()
1.101 - throws StorageBackendException;
1.102 -
1.103 - public abstract boolean isDeleted();
1.104 -
1.105 - public abstract boolean isWriteable();
1.106 -}