src/org/sonews/storage/Group.java
changeset 47 e118b4d60029
parent 42 7f84f4de2893
child 48 b78e77619152
     1.1 --- a/src/org/sonews/storage/Group.java	Sat Sep 10 20:20:19 2011 +0200
     1.2 +++ b/src/org/sonews/storage/Group.java	Sun Sep 11 14:19:19 2011 +0200
     1.3 @@ -27,9 +27,28 @@
     1.4   * @author Christian Lins
     1.5   * @since sonews/0.5.0
     1.6   */
     1.7 -// TODO: This class should not be public!
     1.8  public class Group extends Channel {
     1.9  
    1.10 +	/**
    1.11 +	 * If this flag is set the Group is no real newsgroup but a mailing list
    1.12 +	 * mirror. In that case every posting and receiving mails must go through
    1.13 +	 * the mailing list gateway.
    1.14 +	 */
    1.15 +	public static final int MAILINGLIST = 0x1;
    1.16 +
    1.17 +	/**
    1.18 +	 * If this flag is set the Group is marked as readonly and the posting
    1.19 +	 * is prohibited. This can be useful for groups that are synced only in
    1.20 +	 * one direction.
    1.21 +	 */
    1.22 +	public static final int READONLY = 0x2;
    1.23 +
    1.24 +	/**
    1.25 +	 * If this flag is set the Group is marked as deleted and must not occur
    1.26 +	 * in any output. The deletion is done lazily by a low priority daemon.
    1.27 +	 */
    1.28 +	public static final int DELETED = 0x80;
    1.29 +
    1.30  	private long id = 0;
    1.31  	private int flags = -1;
    1.32  	private String name = null;
    1.33 @@ -47,8 +66,10 @@
    1.34  	}
    1.35  
    1.36  	/**
    1.37 +	 * Constructor.
    1.38  	 * @param name
    1.39  	 * @param id
    1.40 +	 * @param flags
    1.41  	 */
    1.42  	public Group(final String name, final long id, final int flags) {
    1.43  		this.id = id;
    1.44 @@ -99,7 +120,6 @@
    1.45  	 */
    1.46  	public long getInternalID() {
    1.47  		assert id > 0;
    1.48 -
    1.49  		return id;
    1.50  	}
    1.51  
    1.52 @@ -133,6 +153,10 @@
    1.53  		this.flags |= flag;
    1.54  	}
    1.55  
    1.56 +	public void unsetFlag(final int flag) {
    1.57 +		this.flags &= ~flag;
    1.58 +	}
    1.59 +
    1.60  	public void setName(final String name) {
    1.61  		this.name = name;
    1.62  	}