gnu.mail.providers.nntp
Class NNTPTransport
java.lang.Object
javax.mail.Service
javax.mail.Transport
gnu.mail.providers.nntp.NNTPTransport
public class NNTPTransport
- extends Transport
An NNTP transport provider.
This uses an NNTPConnection to handle all the protocol-related
functionality.
- Version:
- 2.0
- Author:
- Chris Burdess
| Methods inherited from class javax.mail.Service |
addConnectionListener, connect, connect, connect, connect, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
NNTPTransport
public NNTPTransport(Session session,
URLName url)
- Constructor.
- Parameters:
session - the sessionurl - the connection URL
protocolConnect
protected boolean protocolConnect(String host,
int port,
String username,
String password)
throws MessagingException
- Performs the protocol connection.
- Overrides:
protocolConnect in class Service
- Parameters:
host - the name of the host to connect toport - the port to use (-1 for the default port)username - the usernamepassword - the password
- Returns:
- true on success, false if authentication failed
- Throws:
AuthenticationFailedException - on authentication failure
MessagingException - for non-authentication failures- See Also:
NNTPStore.protocolConnect(java.lang.String, int, java.lang.String, java.lang.String)
close
public void close()
throws MessagingException
- Close the connection.
- Overrides:
close in class Service
- Throws:
MessagingException- See Also:
NNTPStore.close()
sendMessage
public void sendMessage(Message message,
Address[] addresses)
throws MessagingException
- Post an article.
- Specified by:
sendMessage in class Transport
- Parameters:
message - a MimeMessageaddresses - an array of Address(ignored!)
- Throws:
SendFailedException - if the send failed because of
invalid addresses
MessagingException - if the transport is not connected
© Copyright 2003, 2004
The Free Software Foundation, All rights reserved