Figure 1.1 Messaging Access API Architecture
sendCommand
(or pass-through) interface, which programmers can use to send protocol elements that are not directly supported by the API. The IMAP4 API has further conveniences, such as transparently handling unilateral and unsolicited responses from the server and making these available at the API level through a callback mechanism.
For more information about the sendCommand
API, see the reference entries for
SMTPClient.sendCommand
,
POP3Client.sendCommand
, and
IMAP4Client.sendCommand
.
For more information about using callbacks, see the section about callback mapping in each of these chapters: Sending Mail with SMTP, Receiving Mail with IMAP4, Receiving Mail with POP3, and Building and Parsing MIME Messages.
[Top]packages
directory - JAR file that contains the Java classes that make up the Messaging Access SDK. You do not have to unzip this file.examples
directory - Sample code that demonstrates selected parts of the Messaging Access SDK.ReadMeJ.htm
- Links to current installation information, development notes, system requirements, information about using the SDK that may be more current than this guide, and Netscape licensing information.ReadMeJ.htm
, included in the SDK.
[Top]
Platforms |
Supported Versions
|
|
|
|
|
|
| |
---|
processResponses
call of the client class is issued. This call reads in responses from the server and invokes the appropriate callback method for all responses that are available at the time of execution.
When you start a session with the MIME dynamic parser, you first create and initialize the data sink, and then you create the parser. The parser makes callbacks to its data sink based on the kind of data it finds in the input stream. For example, if it finds a header, it makes the header callback. For the other protocols, the callback comes from the server and callbacks tend to be tied to individual methods.
For MIME, the kind of callback is dependent upon the kind of data that is in the input stream. There are no particular correspondences between functions and data sink callback prototypes, as there are in the other protocols.
As a convenience, SMTP, IMAP4, and POP3 provide sink classes that implement the response sink interface. For example, the SMTPSink
class implements the ISMTPSink
interface. You can save a step by extending the sink class, or you can implement your own class based on the interface.
For more information, see the section about implementing the response sink in each of these chapters: Sending Mail with SMTP, Receiving Mail with IMAP4, Receiving Mail with POP3, and Building and Parsing MIME Messages.
NOTE: SMTP, IMAP4, and POP3 commands are asynchronous. After sending a command, the application does not have to wait to issue the next one, but can do something else. §[Top]
SMTPException
,
MIMEException
,
POP3Exception
,
IMAP4Exception
,
IMException
.
Protocol Server Exceptions handle server response errors. These exceptions are caused when the server sends an error saying that some part of the operation failed or is not supported. This can happen even when all relevant code executes properly and everything operates normally on the client side.
Server Exceptions are thrown from the error
callback on the response sink when an API call that is mapped directly to the RFC fails. It is up to the developer to determine whether or not the error
callback will throw this exception. As an SDK default, the SMTP, IMAP4, and POP3 sink classes that represent the response sink classes throw an exception whenever the error
callback is called. Server Exception classes:
SMTPServerException
,
POP3ServerException
, IMAP4ServerException
.
IOException
exceptions handle I/O errors, which usually occur when the user tries to make API calls before connecting or if the connection is lost unexpectedly. The user can respond by catching the IOException
and examining the reason for the failure. The user can try to re-establish the connection by calling connect
again.
InterruptedIOException
exceptions occur when a time-out occurs. This is a recoverable condition; the application can wait and reissue the method.
[Top]proapi.jar
file contains the Java classes for the protocol APIs. coapi.jar
file contains the Java classes for the convenience APIs. packages
subdirectory under the install-root
directory.
CLASSPATH
environment variable to include the fully qualified path names for the proapi.jar
and the coapi.jar
files.
On Unix platforms, set the CLASSPATH
as follows:
If you are using ksh
:
%
CLASSPATH=$CLASSPATH:<fully-qualified-path>/proapi.jar:
<fully-qualified-path>/coapi.jar
% export CLASSPATHFor convenience, consider adding the lines above to your
.profile
file.
If you are using csh
:
% set classpath=($classpath <fully-qualified-path>/proapi.jarFor convenience, consider adding the lines above to your
<fully-qualified-path>/coapi.jar)
.cshrc
file.
On MS Windows platforms, set the CLASSPATH
as follows:
C:\> set
CLASSPATH=%CLASSPATH%;<fully-qualified-path>\proapi.jar;If you are using MS Windows 95, consider adding these lines to your
<fully-qualified-path>\coapi.jar
AUTOEXEC.BAT
file.
If you are using MS Windows NT, make these environment variable changes in the Control Panel. To do this, start the Control Panel, select System, and then edit the environment variables.
NOTE: If you are not using the Sun JDK, you may need to make other environment changes as specified by the vendor. For example, if you are using Symantec Visual Cafe 2.0, you must set the CLASSPATH in theIf your environment requires it, set your PATH variable to include the target directory for building your Java application. After you have set up your environment, you can build an application that uses the Messaging Access SDK API by invoking thesc.ini
file in thebin
directory. §
javac
compiler on the Java files you want to compile. For example, if you are using the Sun JDK, you could use this code:
cd <build-directory>; javac *.javaIf you are using another environment, such as Symantec Visual Cafe, follow the build procedure for that environment. [Top]
Last Updated: June 3, 1998