Package 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
-
-
Constructor Summary
Constructors Constructor Description NNTPTransport(Session session, URLName url)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the connection.protected booleanprotocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password)Performs the protocol connection.voidsendMessage(Message message, Address[] addresses)Post an article.-
Methods inherited from class javax.mail.Transport
addTransportListener, notifyTransportListeners, removeTransportListener, send, send
-
Methods inherited from class javax.mail.Service
addConnectionListener, connect, connect, connect, connect, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString
-
-
-
-
Method Detail
-
protocolConnect
protected boolean protocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password) throws MessagingExceptionPerforms the protocol connection.- Overrides:
protocolConnectin classService- 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 failureMessagingException- for non-authentication failures- See Also:
NNTPStore.protocolConnect(java.lang.String, int, java.lang.String, java.lang.String)
-
close
public void close() throws MessagingExceptionClose the connection.- Overrides:
closein classService- Throws:
MessagingException- See Also:
NNTPStore.close()
-
sendMessage
public void sendMessage(Message message, Address[] addresses) throws MessagingException
Post an article.- Specified by:
sendMessagein classTransport- Parameters:
message- a MimeMessageaddresses- an array of Address(ignored!)- Throws:
SendFailedException- if the send failed because of invalid addressesMessagingException- if the transport is not connected
-
-