org.apache.james.nntpserver.repository
Class NNTPRepositoryImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.nntpserver.repository.NNTPRepositoryImpl
All Implemented Interfaces:
org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, NNTPRepository

public class NNTPRepositoryImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements NNTPRepository, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable

NNTP Repository implementation.


Constructor Summary
NNTPRepositoryImpl()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration aConfiguration)
           
 void contextualize(org.apache.avalon.framework.context.Context context)
           
 void createArticle(java.io.InputStream in)
          Creates an article in the repository from the data in the reader.
 NNTPArticle getArticleFromID(java.lang.String id)
          Gets the article with the specified id from within the repository.
 java.util.Iterator getArticlesSince(java.util.Date dt)
          Gets all articles posted since the specified date
 NNTPGroup getGroup(java.lang.String groupName)
          Gets the group with the specified name from within the repository.
 java.util.Iterator getGroupsSince(java.util.Date dt)
          Gets all groups added since the specified date
 java.util.Iterator getMatchedGroups(java.lang.String wildmat)
          Gets all groups that match the wildmat string
 java.lang.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(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException
See Also:
Contextualizable.contextualize(Context)

configure

public void configure(org.apache.avalon.framework.configuration.Configuration aConfiguration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(Configuration)

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.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(java.lang.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(java.lang.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(java.io.InputStream in)
Description copied from interface: NNTPRepository
Creates an article in the repository from the data in the reader. TODO: Change this to be more OO and pass in a MimeMessage

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

getMatchedGroups

public java.util.Iterator getMatchedGroups(java.lang.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 java.util.Iterator getGroupsSince(java.util.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 java.util.Iterator getArticlesSince(java.util.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 java.lang.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 © 2002-2007 The Apache Software Foundation. All Rights Reserved.