All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.net.POP3Client

java.lang.Object
   |
   +----COM.ibm.net.InetProtocolClient
           |
           +----COM.ibm.net.POP3Client

public class POP3Client
extends InetProtocolClient
Implements a Post Office Protocol 3 (RFC 1939) client.

Internally supported POP3 commands:
USER PASS QUIT STAT LIST UIDL RETR TOP DELE RSET

Unsupported commands:
APOP

 Copyright (c) Taligent, Inc.  1996 - 1997.
 Copyright (c) IBM Corporation 1996 - 1997.
 All Rights Reserved.
 


Constructor Index

 o POP3Client()
Empty default constructor.
 o POP3Client(String)
Construct a POP3 session a mail server.
 o POP3Client(String, int)
Construct a POP3 session with a mail server.

Method Index

 o deleteMessage(String)
Delete a message on the server.
 o listMessages()
Retrieve list of messages.
 o listUniqueIdentifiers()
Retrieve list of unique IDs, one for each available message.
 o logoff()
Logoff mail server.
 o logon(String, String)
Logon to mail server.
 o messageSize(String)
Retrieve size (in bytes) of a message.
 o reset()
Reset POP3 session with mail server.
 o retrieveMessage(String)
Retrieve a buffered reader with which a message may be read.
 o retrieveMessageTop(String, int)
Retrieve a buffered reader with which the top lines of a message may be read.
 o status()
Fetch "drop listing" (status) of the maildrop.
 o uniqueIdentifier(String)
Retrieve the unique ID of a message.

Constructors

 o POP3Client
 public POP3Client()
Empty default constructor.

 o POP3Client
 public POP3Client(String mailServ)
Construct a POP3 session a mail server. POP3Client will use port 110 by default.

Parameters:
mailServ - Name or IP address of mail server
 o POP3Client
 public POP3Client(String mailServ,
                   int port)
Construct a POP3 session with a mail server.

Parameters:
mailServ - Name or IP address of mail server
port - Port number of the server

Methods

 o logon
 public void logon(String user,
                   String password) throws IOException
Logon to mail server.

Parameters:
user - User name
password - User password
Throws: IOException
Could not logon
 o logoff
 public void logoff() throws IOException
Logoff mail server.

Throws: IOException
Could not logoff
 o status
 public String status() throws IOException
Fetch "drop listing" (status) of the maildrop.

Returns:
A string containing (at least) two tokens: first is the number of messages and the second the total bytecount of the messages.
Throws: IOException
Could not retrieve server status
 o listMessages
 public String[] listMessages() throws IOException
Retrieve list of messages.

Returns:
An array of message strings, each containing two tokens separated by a single whitespace. The first token is the message number and the second its size (in bytes).
Throws: IOException
Could not retrieve message list
 o uniqueIdentifier
 public String uniqueIdentifier(String msgNum) throws IOException
Retrieve the unique ID of a message.

Parameters:
msgNum - Number of the message to query
Returns:
A string containing two tokens separated by a single whitespace. The first token is the message number and the second its unique ID.
Throws: IOException
Could not unique ID
 o listUniqueIdentifiers
 public String[] listUniqueIdentifiers() throws IOException
Retrieve list of unique IDs, one for each available message.

Returns:
A string array, each element containing two tokens separated by a single whitespace. The first token is the message number and the second its unique ID.
Throws: IOException
Could not unique IDs
 o messageSize
 public int messageSize(String msgNum) throws IOException
Retrieve size (in bytes) of a message.

Parameters:
msgNum - Number of the message to query
Returns:
Size (in bytes) of the message
Throws: IOException
Could not retrieve message size
 o retrieveMessage
 public BufferedReader retrieveMessage(String msgNum) throws IOException
Retrieve a buffered reader with which a message may be read. A line containing only "." terminates the message. Lines that originally began with a single '.' have it doubled; strip one during retrieval to produce the original message body. Do not close the reader stream after completion.

Parameters:
msgNum - Number of the message to query
Returns:
Buffered reader
Throws: IOException
Could not retrieve message size
See Also:
BufferedReader;
 o retrieveMessageTop
 public BufferedReader retrieveMessageTop(String msgNum,
                                          int lines) throws IOException
Retrieve a buffered reader with which the top lines of a message may be read. A line containing only "." indicates terminates the message. Lines that originally began with a single '.' have it doubled; strip one during retrieval to produce the original message body. Do not close the reader stream after completion.

Parameters:
msgNum - Number of the message to query
lines - Number of lines of the message to retrieve
Returns:
Buffered reader
Throws: IOException
Could not retrieve message top
See Also:
BufferedReader;
 o deleteMessage
 public void deleteMessage(String msgNum) throws IOException
Delete a message on the server.

Parameters:
msgNum - Number of message to delete
Throws: IOException
Could not retrieve message top
 o reset
 public void reset() throws IOException
Reset POP3 session with mail server.

Throws: IOException
Could not reset session

All Packages  Class Hierarchy  This Package  Previous  Next  Index