dog.mail.nntp
Class NNTPStore

java.lang.Object
  |
  +--javax.mail.Service
        |
        +--javax.mail.Store
              |
              +--dog.mail.nntp.NNTPStore

public class NNTPStore
extends javax.mail.Store
implements dog.util.StatusSource

The storage class implementing the NNTP Usenet news protocol.


Field Summary
static int DEFAULT_PORT
          The default NNTP port.
 
Fields inherited from class javax.mail.Service
debug, session, url
 
Constructor Summary
NNTPStore(javax.mail.Session session, javax.mail.URLName urlname)
          Constructor.
 
Method Summary
 void addStatusListener(dog.util.StatusListener l)
           
 void close()
          Closes the connection.
 javax.mail.Folder getDefaultFolder()
          Returns the root folder.
 javax.mail.Folder getFolder(java.lang.String name)
          Returns the newsgroup with the specified name.
 javax.mail.Folder getFolder(javax.mail.URLName urlname)
          Returns the newsgroup specified as part of a URLName.
 java.lang.String getHostName()
          Returns the hostname of the server.
 javax.mail.Transport getTransport()
          Returns a Transport that can be used to send articles to this news server.
 void postArticle(javax.mail.Message article, javax.mail.Address[] addresses)
          Post an article.
protected  void processStatusEvent(dog.util.StatusEvent event)
           
protected  boolean protocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password)
          Connects to the NNTP server and authenticates with the specified parameters.
 void removeStatusListener(dog.util.StatusListener l)
           
 
Methods inherited from class javax.mail.Store
addFolderListener, addStoreListener, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener
 
Methods inherited from class javax.mail.Service
addConnectionListener, connect, connect, connect, finalize, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final int DEFAULT_PORT
The default NNTP port.
Constructor Detail

NNTPStore

public NNTPStore(javax.mail.Session session,
                 javax.mail.URLName urlname)
Constructor.
Method Detail

protocolConnect

protected boolean protocolConnect(java.lang.String host,
                                  int port,
                                  java.lang.String username,
                                  java.lang.String password)
                           throws javax.mail.MessagingException
Connects to the NNTP server and authenticates with the specified parameters.
Overrides:
protocolConnect in class javax.mail.Service

close

public void close()
           throws javax.mail.MessagingException
Closes the connection.
Overrides:
close in class javax.mail.Service

getHostName

public java.lang.String getHostName()
Returns the hostname of the server.

postArticle

public void postArticle(javax.mail.Message article,
                        javax.mail.Address[] addresses)
                 throws javax.mail.MessagingException
Post an article.
Parameters:
article - the article
addresses - the addresses to post to.
Throws:
javax.mail.MessagingException - if a messaging exception occurred or there were no newsgroup recipients

getTransport

public javax.mail.Transport getTransport()
Returns a Transport that can be used to send articles to this news server.

getDefaultFolder

public javax.mail.Folder getDefaultFolder()
                                   throws javax.mail.MessagingException
Returns the root folder.
Overrides:
getDefaultFolder in class javax.mail.Store

getFolder

public javax.mail.Folder getFolder(java.lang.String name)
                            throws javax.mail.MessagingException
Returns the newsgroup with the specified name.
Overrides:
getFolder in class javax.mail.Store

getFolder

public javax.mail.Folder getFolder(javax.mail.URLName urlname)
                            throws javax.mail.MessagingException
Returns the newsgroup specified as part of a URLName.
Overrides:
getFolder in class javax.mail.Store

addStatusListener

public void addStatusListener(dog.util.StatusListener l)
Specified by:
addStatusListener in interface dog.util.StatusSource

removeStatusListener

public void removeStatusListener(dog.util.StatusListener l)
Specified by:
removeStatusListener in interface dog.util.StatusSource

processStatusEvent

protected void processStatusEvent(dog.util.StatusEvent event)