org.apache.james.nntpserver.repository
Class NNTPRepositoryImpl

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.apache.james.nntpserver.repository.NNTPRepositoryImpl
All Implemented Interfaces:
Configurable, Contextualizable, Initializable, LogEnabled, NNTPRepository

public class NNTPRepositoryImpl
extends AbstractLogEnabled
implements NNTPRepository, Contextualizable, Configurable, Initializable

NNTP Repository implementation.

Author:
Harmeet Bedi

Constructor Summary
NNTPRepositoryImpl()
           
 
Method Summary
 void configure(Configuration aConfiguration)
           
 void contextualize(Context context)
           
 void createArticle(NNTPLineReader reader)
          Creates an article in the repository from the data in the reader.
 NNTPArticle getArticleFromID(String id)
          Gets the article with the specified id from within the repository.
 Iterator getArticlesSince(Date dt)
          Gets all articles posted since the specified date
 NNTPGroup getGroup(String groupName)
          Gets the group with the specified name from within the repository.
 Iterator getGroupsSince(Date dt)
          Gets all groups added since the specified date
 Iterator getMatchedGroups(String wildmat)
          Gets all groups that match the wildmat string
 String[] getOverviewFormat()
          Returns the ordered array of header names (including the trailing colon on each) returned in overview format for articles stored in this repository.
 void initialize()
           
 boolean isReadOnly()
          Returns whether this repository is read only.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NNTPRepositoryImpl

public NNTPRepositoryImpl()
Method Detail

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
ContextException
See Also:
Contextualizable.contextualize(Context)

configure

public void configure(Configuration aConfiguration)
               throws ConfigurationException
Specified by:
configure in interface Configurable
ConfigurationException
See Also:
Configurable.configure(Configuration)

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Exception
See Also:
Initializable.initialize()

isReadOnly

public boolean isReadOnly()
Description copied from interface: NNTPRepository
Returns whether this repository is read only.

Specified by:
isReadOnly in interface NNTPRepository
Returns:
whether this repository is read only
See Also:
NNTPRepository.isReadOnly()

getGroup

public NNTPGroup getGroup(String groupName)
Description copied from interface: NNTPRepository
Gets the group with the specified name from within the repository.

Specified by:
getGroup in interface NNTPRepository
Parameters:
groupName - the name of the group to retrieve
Returns:
the group
See Also:
NNTPRepository.getGroup(String)

getArticleFromID

public NNTPArticle getArticleFromID(String id)
Description copied from interface: NNTPRepository
Gets the article with the specified id from within the repository.

Specified by:
getArticleFromID in interface NNTPRepository
Parameters:
id - the id of the article to retrieve
Returns:
the article
See Also:
NNTPRepository.getArticleFromID(String)

createArticle

public void createArticle(NNTPLineReader reader)
Description copied from interface: NNTPRepository
Creates an article in the repository from the data in the reader.

Specified by:
createArticle in interface NNTPRepository
Parameters:
reader - the reader that serves as a source for the article data
See Also:
NNTPRepository.createArticle(NNTPLineReader)

getMatchedGroups

public Iterator getMatchedGroups(String wildmat)
Description copied from interface: NNTPRepository
Gets all groups that match the wildmat string

Specified by:
getMatchedGroups in interface NNTPRepository
Parameters:
wildmat - the wildmat parameter
Returns:
an iterator containing the groups retrieved
See Also:
NNTPRepository.getMatchedGroups(String)

getGroupsSince

public Iterator getGroupsSince(Date dt)
Description copied from interface: NNTPRepository
Gets all groups added since the specified date

Specified by:
getGroupsSince in interface NNTPRepository
Parameters:
dt - the Date that serves as a lower bound
Returns:
an iterator containing the groups retrieved
See Also:
NNTPRepository.getGroupsSince(Date)

getArticlesSince

public Iterator getArticlesSince(Date dt)
Description copied from interface: NNTPRepository
Gets all articles posted since the specified date

Specified by:
getArticlesSince in interface NNTPRepository
Parameters:
dt - the Date that serves as a lower bound
Returns:
an iterator containing the articles retrieved
See Also:
NNTPRepository.getArticlesSince(Date)

getOverviewFormat

public String[] getOverviewFormat()
Description copied from interface: NNTPRepository
Returns the ordered array of header names (including the trailing colon on each) returned in overview format for articles stored in this repository.

Specified by:
getOverviewFormat in interface NNTPRepository
See Also:
NNTPRepository.getOverviewFormat()


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."