PullFeeder sends an addition "MODE READER" to peers.
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/>.
19 package org.sonews.storage;
21 import java.util.ArrayList;
22 import java.util.List;
23 import org.sonews.util.Pair;
26 * A logical communication Channel is the a generic structural element for sets
27 * of messages; e.g. a Newsgroup for a set of Articles.
28 * A Channel can either be a real set of messages or an aggregated set of
30 * @author Christian Lins
33 public abstract class Channel
37 * If this flag is set the Group is no real newsgroup but a mailing list
38 * mirror. In that case every posting and receiving mails must go through
39 * the mailing list gateway.
41 public static final int MAILINGLIST = 0x1;
44 * If this flag is set the Group is marked as readonly and the posting
45 * is prohibited. This can be useful for groups that are synced only in
48 public static final int READONLY = 0x2;
51 * If this flag is set the Group is marked as deleted and must not occur
52 * in any output. The deletion is done lazily by a low priority daemon.
54 public static final int DELETED = 0x80;
56 public static List<Channel> getAll()
58 List<Channel> all = new ArrayList<Channel>();
60 /*List<Channel> agroups = AggregatedGroup.getAll();
66 List<Channel> groups = Group.getAll();
75 public static Channel getByName(String name)
79 // Check if it's an aggregated group
80 channel = AggregatedGroup.getByName(name);
82 // If it's not an aggregate is probably a "real" group
85 channel = Group.getByName(name);
91 public abstract Article getArticle(long idx)
92 throws StorageBackendException;
94 public abstract List<Pair<Long, ArticleHead>> getArticleHeads(
95 final long first, final long last)
96 throws StorageBackendException;
98 public abstract List<Long> getArticleNumbers()
99 throws StorageBackendException;
101 public abstract long getFirstArticleNumber()
102 throws StorageBackendException;
104 public abstract long getIndexOf(Article art)
105 throws StorageBackendException;
107 public abstract long getInternalID();
109 public abstract long getLastArticleNumber()
110 throws StorageBackendException;
112 public abstract String getName();
114 public abstract long getPostingsCount()
115 throws StorageBackendException;
117 public abstract boolean isDeleted();
119 public abstract boolean isWriteable();