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
Method Summary |
void |
close()
Close the connection. |
protected boolean |
protocolConnect(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
Performs the protocol connection. |
void |
sendMessage(Message message,
Address[] addresses)
Post an article. |
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 |
NNTPTransport
public NNTPTransport(Session session,
URLName url)
- Constructor.
- Parameters:
session
- the sessionurl
- the connection URL
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 toport
- the port to use (-1 for the default port)username
- the usernamepassword
- the password
- Returns:
- true on success, false if authentication failed
- Throws:
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:
MessagingException
- if the transport is not connected
© Copyright 2003, 2004
The Free Software Foundation, All rights reserved