src/org/sonews/storage/Channel.java
changeset 37 74139325d305
parent 35 ed84c8bdd87b
child 39 73b21e9f3958
     1.1 --- a/src/org/sonews/storage/Channel.java	Sun Aug 29 17:28:58 2010 +0200
     1.2 +++ b/src/org/sonews/storage/Channel.java	Sun Aug 29 18:17:37 2010 +0200
     1.3 @@ -33,79 +33,75 @@
     1.4  public abstract class Channel
     1.5  {
     1.6  
     1.7 -  /**
     1.8 -   * If this flag is set the Group is no real newsgroup but a mailing list
     1.9 -   * mirror. In that case every posting and receiving mails must go through
    1.10 -   * the mailing list gateway.
    1.11 -   */
    1.12 -  public static final int MAILINGLIST = 0x1;
    1.13 +	/**
    1.14 +	 * If this flag is set the Group is no real newsgroup but a mailing list
    1.15 +	 * mirror. In that case every posting and receiving mails must go through
    1.16 +	 * the mailing list gateway.
    1.17 +	 */
    1.18 +	public static final int MAILINGLIST = 0x1;
    1.19 +	/**
    1.20 +	 * If this flag is set the Group is marked as readonly and the posting
    1.21 +	 * is prohibited. This can be useful for groups that are synced only in
    1.22 +	 * one direction.
    1.23 +	 */
    1.24 +	public static final int READONLY = 0x2;
    1.25 +	/**
    1.26 +	 * If this flag is set the Group is marked as deleted and must not occur
    1.27 +	 * in any output. The deletion is done lazily by a low priority daemon.
    1.28 +	 */
    1.29 +	public static final int DELETED = 0x80;
    1.30  
    1.31 -  /**
    1.32 -   * If this flag is set the Group is marked as readonly and the posting
    1.33 -   * is prohibited. This can be useful for groups that are synced only in
    1.34 -   * one direction.
    1.35 -   */
    1.36 -  public static final int READONLY    = 0x2;
    1.37 +	public static List<Channel> getAll()
    1.38 +	{
    1.39 +		List<Channel> all = new ArrayList<Channel>();
    1.40  
    1.41 -  /**
    1.42 -   * If this flag is set the Group is marked as deleted and must not occur
    1.43 -   * in any output. The deletion is done lazily by a low priority daemon.
    1.44 -   */
    1.45 -  public static final int DELETED     = 0x80;
    1.46 +		/*List<Channel> agroups = AggregatedGroup.getAll();
    1.47 +		if(agroups != null)
    1.48 +		{
    1.49 +		all.addAll(agroups);
    1.50 +		}*/
    1.51  
    1.52 -  public static List<Channel> getAll()
    1.53 -  {
    1.54 -    List<Channel> all = new ArrayList<Channel>();
    1.55 +		List<Channel> groups = Group.getAll();
    1.56 +		if (groups != null) {
    1.57 +			all.addAll(groups);
    1.58 +		}
    1.59  
    1.60 -    /*List<Channel> agroups = AggregatedGroup.getAll();
    1.61 -    if(agroups != null)
    1.62 -    {
    1.63 -      all.addAll(agroups);
    1.64 -    }*/
    1.65 +		return all;
    1.66 +	}
    1.67  
    1.68 -    List<Channel> groups = Group.getAll();
    1.69 -    if(groups != null)
    1.70 -    {
    1.71 -      all.addAll(groups);
    1.72 -    }
    1.73 +	public static Channel getByName(String name)
    1.74 +		throws StorageBackendException
    1.75 +	{
    1.76 +		return StorageManager.current().getGroup(name);
    1.77 +	}
    1.78  
    1.79 -    return all;
    1.80 -  }
    1.81 +	public abstract Article getArticle(long idx)
    1.82 +		throws StorageBackendException;
    1.83  
    1.84 -  public static Channel getByName(String name)
    1.85 -    throws StorageBackendException
    1.86 -  {
    1.87 -    return StorageManager.current().getGroup(name);
    1.88 -  }
    1.89 +	public abstract List<Pair<Long, ArticleHead>> getArticleHeads(
    1.90 +		final long first, final long last)
    1.91 +		throws StorageBackendException;
    1.92  
    1.93 -  public abstract Article getArticle(long idx)
    1.94 -    throws StorageBackendException;
    1.95 +	public abstract List<Long> getArticleNumbers()
    1.96 +		throws StorageBackendException;
    1.97  
    1.98 -  public abstract List<Pair<Long, ArticleHead>> getArticleHeads(
    1.99 -    final long first, final long last)
   1.100 -    throws StorageBackendException;
   1.101 +	public abstract long getFirstArticleNumber()
   1.102 +		throws StorageBackendException;
   1.103  
   1.104 -  public abstract List<Long> getArticleNumbers()
   1.105 -    throws StorageBackendException;
   1.106 +	public abstract long getIndexOf(Article art)
   1.107 +		throws StorageBackendException;
   1.108  
   1.109 -  public abstract long getFirstArticleNumber()
   1.110 -    throws StorageBackendException;
   1.111 +	public abstract long getInternalID();
   1.112  
   1.113 -  public abstract long getIndexOf(Article art)
   1.114 -    throws StorageBackendException;
   1.115 +	public abstract long getLastArticleNumber()
   1.116 +		throws StorageBackendException;
   1.117  
   1.118 -  public abstract long getInternalID();
   1.119 +	public abstract String getName();
   1.120  
   1.121 -  public abstract long getLastArticleNumber()
   1.122 -    throws StorageBackendException;
   1.123 +	public abstract long getPostingsCount()
   1.124 +		throws StorageBackendException;
   1.125  
   1.126 -  public abstract String getName();
   1.127 -  
   1.128 -  public abstract long getPostingsCount()
   1.129 -    throws StorageBackendException;
   1.130 +	public abstract boolean isDeleted();
   1.131  
   1.132 -  public abstract boolean isDeleted();
   1.133 -
   1.134 -  public abstract boolean isWriteable();
   1.135 -
   1.136 +	public abstract boolean isWriteable();
   1.137  }