All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netscape.messaging.pop3.POP3Sink

java.lang.Object
   |
   +----netscape.messaging.pop3.POP3Sink

public class POP3Sink
extends Object
implements IPOP3Sink
POP3Sink is the default implementation of the response sink for all POP3 commands.

The POP3Sink object contains callback methods for each client call. The client’s processResponses call invokes the appropriate object method.

The Messaging Access SDK provides the POP3Sink class as a convenience implementation the POP3Sink interface. You can save a step by extending the POP3Sink class, or you can implement your own class based on the POP3Sink interface. The constructor for the POP3Sink class takes an POP3Sink interface as a parameter.

By default, this implementation does nothing, except for the error callback, which throws an exception.


Constructor Index

 o POP3Sink()

Method Index

 o connect(StringBuffer)
Notification for the response to the connection to the server.
 o delete(StringBuffer)
Notification for the response to the DELE command.
 o error(StringBuffer)
Error notification.
 o list(int, int)
Notification for the response to the LIST command.
 o listComplete()
Notification for the completion of the LIST command.
 o listStart()
Notification for the start of the LIST command.
 o noop()
Notification for the response to the NOOP command.
 o pass(StringBuffer)
Notification for the response to the PASS command.
 o quit(StringBuffer)
Notification for the response to the QUIT command.
 o reset(StringBuffer)
Notification for the response to the RSET command.
 o retrieve(byte[])
Notification for raw message from the RETR command.
 o retrieveComplete()
Notification for the completion of the RETR command.
 o retrieveStart(int, int)
Notification for the start of a message from the RETR command.
 o sendCommand(StringBuffer)
Notification for the response to the extended method.
 o sendCommandComplete()
Notification for the completion of the extended command.
 o sendCommandStart()
Notification for the start of the extended method.
 o stat(int, int)
Notification for the response to the STAT command.
 o top(StringBuffer)
Notification for a line of the message from the TOP command.
 o topComplete()
Notification for the completion of the TOP command.
 o topStart(int)
Notification for the start of a message from the TOP command.
 o uidList(int, StringBuffer)
Notification for the response to the UIDL command.
 o uidListComplete()
Notification for the completion of the UIDL command.
 o uidListStart()
Notification for the start of the UIDL command.
 o user(StringBuffer)
Notification for the response to the USER command.
 o xAuthList(int, int, StringBuffer)
Notification for the response to the XAUTHLIST command.
 o xAuthListComplete()
Notification for the completion of the XAUTHLIST command.
 o xAuthListStart()
Notification for the start of the XAUTHLIST command.
 o xSender(StringBuffer)
Notification for the response to the XSENDER command.

Constructors

 o POP3Sink
 public POP3Sink()

Methods

 o connect
 public void connect(StringBuffer in_responseMessage)
Notification for the response to the connection to the server.

Connects to the server using the default port. See "POP3 Response Codes" in Chapter 5, "Receiving Mail with POP3."

Parameters:
in_responseMessage - Server response for connect.
See Also:
connect, quit
 o delete
 public void delete(StringBuffer in_responseMessage)
Notification for the response to the DELE command. Marks a message for deletion on the server; actually deleted when quit() is called. Sends the DELE [arg] POP3 protocol command.

Parameters:
in_responseMessage - Server response for delete.
See Also:
delete, quit
 o error
 public void error(StringBuffer in_responseMessage) throws POP3ServerException
Error notification. Called when an error occurs. See "POP3 Response Codes" in Chapter 5, "Receiving Mail with POP3."

Parameters:
in_responseMessage - Server response for an error.
Throws: POP3ServerException
If a server response error occurs.
See Also:
processResponses
 o listStart
 public void listStart()
Notification for the start of the LIST command. Along with list and listComplete, can be used to list all messages.

See Also:
list, listComplete, list
 o list
 public void list(int in_messageNumber,
                  int in_octetCount)
Notification for the response to the LIST command. Along with listStart and listComplete, can be used to list all messages.

Parameters:
in_messageNumber - Number of message to list.
in_octetCount - Octet count of the message.
See Also:
list, listStart, listComplete
 o listComplete
 public void listComplete()
Notification for the completion of the LIST command. Along with list and listStart, can be used to list all messages.

See Also:
list, listStart, list
 o noop
 public void noop()
Notification for the response to the NOOP command.

Server responds to commands with a "still here" response. Sending the noop method does nothing except force this response. Can be used to maintain server connection, perhaps being issued at timed intervals to make sure that the server is still active.

Resets the autologout timer inside the server. Not needed by applications that do not need to maintain the connection.

See Also:
noop
 o pass
 public void pass(StringBuffer in_responseMessage)
Notification for the response to the PASS command. Identifies the user password; on success, the POP3 session enters the Transaction state.

Parameters:
in_responseMessage - Server response for pass.
See Also:
pass
 o quit
 public void quit(StringBuffer in_responseMessage)
Notification for the response to the QUIT command. Closes the connection with the POP3 server, purges deleted messages, and logs the user out from the server.

If issued in Authentication state, server closes connection. If issued in Transaction state, server goes into the Update state and deletes marked messages, then quits.

Parameters:
in_responseMessage - Server response for quit.
See Also:
quit
 o reset
 public void reset(StringBuffer in_responseMessage)
Notification for the response to the RSET command. POP3 can affect server only by deleting/undeleting messages with delete and reset.

Parameters:
in_responseMessage - Server response for reset.
See Also:
reset, retrieve, delete
 o retrieveStart
 public void retrieveStart(int in_messageNumber,
                           int in_octetCount)
Notification for the start of a message from the RETR command. Along with retrieve and retrieveComplete, can be used to retrieve the message data.

Parameters:
in_messageNumber - Number of message to list.
in_octetCount - Octet count of the message.
See Also:
retrieve, retrieve, retrieveComplete
 o retrieve
 public void retrieve(byte in_messageData[])
Notification for raw message from the RETR command. Along with retrieveStart and retrieveComplete, can be used to retrieve the message data.

Parameters:
in_messageData - Message data to retrieve.
See Also:
retrieve, retrieveStart, retrieveComplete
 o retrieveComplete
 public void retrieveComplete()
Notification for the completion of the RETR command. Along with retrieve and retrieveStart, can be used to retrieve the data in the message.

See Also:
retrieve, retrieveStart, retrieve
 o sendCommandStart
 public void sendCommandStart()
Notification for the start of the extended method. Along with sendCommand and sendCommandComplete, extends the protocol to meet client application needs. See "POP3 Response Codes" in Chapter 5, "Receiving Mail with POP3."

See Also:
sendCommand, sendCommand, sendCommandComplete
 o sendCommand
 public void sendCommand(StringBuffer in_line)
Notification for the response to the extended method. Along with sendCommandStart and sendCommandComplete, extends the protocol to meet client application needs. Sends commands that are not supported by the Messaging SDK implementation of POP3. Can get extended server information, possibly multiline. See "POP3 Response Codes" in Chapter 5, "Receiving Mail with POP3."

Parameters:
in_line - Number of lines of the body to read.
See Also:
sendCommand
 o sendCommandComplete
 public void sendCommandComplete()
Notification for the completion of the extended command. Along with sendCommandStart and sendCommand, extends the protocol to meet client application needs. See "POP3 Response Codes" in Chapter 5, "Receiving Mail with POP3."

See Also:
sendCommand, sendCommandStart, sendCommand
 o stat
 public void stat(int in_messageCount,
                  int in_octetCount)
Notification for the response to the STAT command. Gets the status of the mail drop: returns the number of messages and octet size of the mail drop. Always returns message octet count.

Parameters:
in_messageCount - Number of messages.
in_octetCount - Octet count of the message.
See Also:
stat
 o topStart
 public void topStart(int in_messageNumber)
Notification for the start of a message from the TOP command. Along with the top and topComplete methods, retrieves the headers plus the specified number of lines from the message.

Parameters:
in_messageNumber - Number of message.
See Also:
top, top, topComplete
 o top
 public void top(StringBuffer in_line)
Notification for a line of the message from the TOP command. Along with the topStart and topComplete methods, retrieves the headers plus the specified number of lines from the message. Issues a 'TOP [arg1] [arg2]' command.

Parameters:
in_line - Number of lines of the body to read.
See Also:
top, topStart, topComplete
 o topComplete
 public void topComplete()
Notification for the completion of the TOP command. Along with the top and topStart methods, retrieves the headers plus the specified number of lines from the message.

See Also:
top, top, topStart
 o uidListStart
 public void uidListStart()
Notification for the start of the UIDL command. Along with uidList and uidListComplete, goes through all the messages in the mailbox and generates a list line by line. Uses the UIDL POP3 protocol command,

See Also:
uidList, uidList, uidListComplete, listStart
 o uidList
 public void uidList(int in_messageNumber,
                     StringBuffer in_uid)
Notification for the response to the UIDL command. Along with uidListStart and uidListComplete, goes through all the messages in the mailbox and generates a list line by line.

Parameters:
in_messageNumber - Number of message.
in_uid - Unique ID of message.
See Also:
uidList, uidListStart, uidListComplete, list
 o uidListComplete
 public void uidListComplete()
Notification for the completion of the UIDL command. Along with uidListStart and uidList, goes through all the messages in the mailbox and generates a list line by line.

See Also:
uidList, uidList, uidListStart, ListComplete
 o user
 public void user(StringBuffer in_responseMessage)
Notification for the response to the USER command.

Parameters:
in_responseMessage - Server response for user.
See Also:
user
 o xAuthListStart
 public void xAuthListStart()
Notification for the start of the XAUTHLIST command. Along with xAuthList and xAuthListComplete, sends the XAUTHLIST POP3 protocol command.

See Also:
xAuthList, xAuthList, xAuthListComplete
 o xAuthList
 public void xAuthList(int in_messageNumber,
                       int in_octetCount,
                       StringBuffer in_emailAddress)
Notification for the response to the XAUTHLIST command. Along with xAuthListStart and xAuthListComplete, sends the XAUTHLIST POP3 protocol command.

Parameters:
in_messageNumber - Number of message.
in_octetCount - Octet count of the message.
in_emailAddress - Email address.
See Also:
xAuthList, xAuthListStart, xAuthListComplete
 o xAuthListComplete
 public void xAuthListComplete()
Notification for the completion of the XAUTHLIST command. Along with xAuthList and xAuthListStart, sends the XAUTHLIST POP3 protocol command.

See Also:
xAuthList, xAuthList, xAuthListStart
 o xSender
 public void xSender(StringBuffer in_emailAddress)
Notification for the response to the XSENDER command. Gets the email address of the sender of the specified message. Sends the XSENDER [arg] POP3 protocol command.

Parameters:
in_emailAddress - Email address.
See Also:
xSender

All Packages  Class Hierarchy  This Package  Previous  Next  Index