gnu.mail.providers.nntp
Class NNTPStore

java.lang.Object
  extended by javax.mail.Service
      extended by javax.mail.Store
          extended by gnu.mail.providers.nntp.NNTPStore

public class NNTPStore
extends Store

An NNTP store provider. This uses an NNTPConnection to handle all the protocol-related functionality.


Field Summary
 
Fields inherited from class javax.mail.Service
debug, session, url
 
Constructor Summary
NNTPStore(Session session, URLName url)
          Constructor.
 
Method Summary
 void close()
          Close the connection.
 Folder getDefaultFolder()
          Returns the folder representing the "root" namespace.
 Folder getFolder(java.lang.String name)
          Returns a folder by name.
 Folder getFolder(URLName url)
          Returns the folder whose name corresponds to the file part of the specified URL.
protected  boolean protocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password)
          Performs the protocol connection.
 
Methods inherited from class javax.mail.Store
addFolderListener, addStoreListener, getPersonalNamespaces, getSharedNamespaces, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener
 
Methods inherited from class javax.mail.Service
addConnectionListener, connect, connect, connect, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NNTPStore

public NNTPStore(Session session,
                 URLName url)
Constructor.

Parameters:
session - the session
url - the connection URL
Method Detail

protocolConnect

protected boolean protocolConnect(java.lang.String host,
                                  int port,
                                  java.lang.String username,
                                  java.lang.String password)
                           throws MessagingException
Performs the protocol connection.

Overrides:
protocolConnect in class Service
Parameters:
host - the name of the host to connect to
port - the port to use (-1 for the default port)
username - the username
password - the password
Returns:
true on success, false if authentication failed
Throws:
AuthenticationFailedException - on authentication failure
MessagingException - for non-authentication failures

close

public void close()
           throws MessagingException
Close the connection.

Overrides:
close in class Service
Throws:
MessagingException

getDefaultFolder

public Folder getDefaultFolder()
                        throws MessagingException
Returns the folder representing the "root" namespace. This folder can be used to browse the folder hierarchy.

Specified by:
getDefaultFolder in class Store
Throws:
MessagingException

getFolder

public Folder getFolder(java.lang.String name)
                 throws MessagingException
Returns a folder by name.

Specified by:
getFolder in class Store
Parameters:
name - the folder name
Throws:
MessagingException

getFolder

public Folder getFolder(URLName url)
                 throws MessagingException
Returns the folder whose name corresponds to the file part of the specified URL.

Specified by:
getFolder in class Store
Parameters:
url - a URLName denoting a folder
Throws:
MessagingException