org.apache.geronimo.javamail.store.nntp
Class NNTPStore

java.lang.Object
  extended by javax.mail.Service
      extended by javax.mail.Store
          extended by org.apache.geronimo.javamail.store.nntp.NNTPStore
Direct Known Subclasses:
NNTPSSLStore

public class NNTPStore
extends Store

NNTP implementation of javax.mail.Store POP protocol spec is implemented in org.apache.geronimo.javamail.store.pop3.NNTPConnection

Version:
$Rev: 673152 $ $Date: 2008-07-01 13:37:38 -0400 (Tue, 01 Jul 2008) $

Field Summary
protected  NNTPConnection connection
           
protected static int DEFAULT_NNTP_PORT
           
protected static int DEFAULT_NNTP_SSL_PORT
           
protected  NNTPNewsrc newsrc
           
protected static String NNTP_NEWSRC
           
protected  ProtocolProperties props
           
protected static String protocol
           
protected  NNTPRootFolder root
           
 
Fields inherited from class javax.mail.Service
debug, session, url
 
Constructor Summary
  NNTPStore(Session session, URLName name)
          Construct an NNTPStore item.
protected NNTPStore(Session session, URLName name, String protocol, int defaultPort, boolean sslConnection)
          Common constructor used by the POP3Store and POP3SSLStore classes to do common initialization of defaults.
 
Method Summary
 void close()
           
 Folder getDefaultFolder()
           
 Folder getFolder(String name)
           
 Folder getFolder(URLName url)
           
protected  boolean protocolConnect(String host, int port, String username, String password)
          Do the protocol connection for an NNTP transport.
 
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, 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

NNTP_NEWSRC

protected static final String NNTP_NEWSRC
See Also:
Constant Field Values

protocol

protected static final String protocol
See Also:
Constant Field Values

DEFAULT_NNTP_PORT

protected static final int DEFAULT_NNTP_PORT
See Also:
Constant Field Values

DEFAULT_NNTP_SSL_PORT

protected static final int DEFAULT_NNTP_SSL_PORT
See Also:
Constant Field Values

props

protected ProtocolProperties props

connection

protected NNTPConnection connection

root

protected NNTPRootFolder root

newsrc

protected NNTPNewsrc newsrc
Constructor Detail

NNTPStore

public NNTPStore(Session session,
                 URLName name)
Construct an NNTPStore item. This will load the .newsrc file associated with the server.

Parameters:
session - The owning javamail Session.
name - The Store urlName, which can contain server target information.

NNTPStore

protected NNTPStore(Session session,
                    URLName name,
                    String protocol,
                    int defaultPort,
                    boolean sslConnection)
Common constructor used by the POP3Store and POP3SSLStore classes to do common initialization of defaults.

Parameters:
session - The host session instance.
name - The URLName of the target.
protocol - The protocol type ("nntp" or "nntps"). This helps us in retrieving protocol-specific session properties.
defaultPort - The default port used by this protocol. For pop3, this will be 110. The default for pop3 with ssl is 995.
sslConnection - Indicates whether an SSL connection should be used to initial contact the server. This is different from the STARTTLS support, which switches the connection to SSL after the initial startup.
Method Detail

getDefaultFolder

public Folder getDefaultFolder()
                        throws MessagingException
Specified by:
getDefaultFolder in class Store
Throws:
MessagingException
See Also:
This returns a root folder object for all of the news groups.

getFolder

public Folder getFolder(String name)
                 throws MessagingException
Specified by:
getFolder in class Store
Throws:
MessagingException
See Also:
Store.getFolder(java.lang.String)

getFolder

public Folder getFolder(URLName url)
                 throws MessagingException
Specified by:
getFolder in class Store
Throws:
MessagingException
See Also:
Store.getFolder(javax.mail.URLName)

protocolConnect

protected boolean protocolConnect(String host,
                                  int port,
                                  String username,
                                  String password)
                           throws MessagingException
Do the protocol connection for an NNTP transport. This handles server authentication, if possible. Returns false if unable to connect to the server.

Overrides:
protocolConnect in class Service
Parameters:
host - The target host name.
port - The server port number.
user - The authentication user (if any).
password - The server password. Might not be sent directly if more sophisticated authentication is used.
Returns:
true if we were able to connect to the server properly, false for any failures.
Throws:
MessagingException

close

public void close()
           throws MessagingException
Overrides:
close in class Service
Throws:
MessagingException
See Also:
Service.close()


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.