gnu.mail.providers.nntp
Class NNTPTransport

java.lang.Object
  extended by javax.mail.Service
      extended by javax.mail.Transport
          extended by 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

Field Summary
 
Fields inherited from class javax.mail.Service
debug, session, url
 
Constructor Summary
NNTPTransport(Session session, URLName url)
          Constructor.
 
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.Transport
addTransportListener, notifyTransportListeners, removeTransportListener, send, send
 
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

NNTPTransport

public NNTPTransport(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
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 MimeMessage
addresses - 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