Package org.sonews.storage
Class Group
java.lang.Object
org.sonews.storage.Group
Represents a logical Group within this newsserver.
- Since:
- sonews/0.5.0
- Author:
- Christian Lins
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
If this flag is set the Group is marked as deleted and must not occur in any output.static final int
If this flag is set the Group is local to this server, i.e., the news are not peered.static final int
If this flag is set the Group is no real newsgroup but a mailing list mirror.static final int
If this flag is set the Group is considered private and only visible to clients of the private clients access list.static final int
If this flag is set the Group is marked as readonly and the posting is prohibited. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Group
getAll()
Reads and parses the groups.conf file if not done yet and returns a list of loaded Group objects.getArticle
(long idx) getArticleHeads
(long first, long last) long
int
getFlags()
long
getIndexOf
(Article art) long
long
getName()
long
int
hashCode()
boolean
boolean
boolean
void
setFlag
(int flag) Performs this.flags |= flag to set a specified flag and updates the data in the JDBCDatabase.void
void
unsetFlag
(int flag)
-
Field Details
-
MAILINGLIST
public static final int MAILINGLISTIf 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.- See Also:
-
READONLY
public static final int READONLYIf 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.- See Also:
-
PRIVATE
public static final int PRIVATEIf this flag is set the Group is considered private and only visible to clients of the private clients access list.- See Also:
-
LOCALE
public static final int LOCALEIf this flag is set the Group is local to this server, i.e., the news are not peered.- See Also:
-
DELETED
public static final int DELETEDIf 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.- See Also:
-
-
Constructor Details
-
Group
Constructor.- Parameters:
name
-id
-flags
-
-
-
Method Details
-
getAll
Reads and parses the groups.conf file if not done yet and returns a list of loaded Group objects. If groups.conf cannot be read an empty list is returned, never null.- Returns:
- List of all groups this server handles.
-
get
-
equals
-
hashCode
public int hashCode() -
getArticle
- Parameters:
idx
-- Returns:
- Throws:
StorageBackendException
-
getArticleHeads
public List<Pair<Long,Article>> getArticleHeads(long first, long last) throws StorageBackendException - Throws:
StorageBackendException
-
getArticleNumbers
- Throws:
StorageBackendException
-
getFirstArticleNumber
- Throws:
StorageBackendException
-
getFlags
public int getFlags() -
getIndexOf
- Throws:
StorageBackendException
-
getInternalID
public long getInternalID()- Returns:
- Internal group id used for referencing in the backend
-
isDeleted
public boolean isDeleted() -
isMailingList
public boolean isMailingList() -
isWriteable
public boolean isWriteable() -
getLastArticleNumber
- Throws:
StorageBackendException
-
getName
-
setFlag
public void setFlag(int flag) Performs this.flags |= flag to set a specified flag and updates the data in the JDBCDatabase.- Parameters:
flag
-
-
unsetFlag
public void unsetFlag(int flag) -
setName
-
getPostingsCount
- Returns:
- Number of posted articles in this group.
- Throws:
StorageBackendException
-