Sun Java System Mobile Enterprise Platform 1.0 Developer's Guide for Enterprise Connectors

Chapter 1 Introduction to Enterprise Connectors

Sun Java System Mobile Enterprise Platform (MEP) includes a library, the Enterprise Connector Business Object (ECBO) API, that enables development of objects that provide an interface between data on mobile client devices and data stored in a database or an EIS/EAI system. This library, in conjunction with the Mobile Client Business Object (MCBO) API , provides a complete solution that allows you to synchronize arbitrary enterprise data between a client device and a database or EIS/EAI system, using a Gateway Engine deployed on the Sun Java System Application Server that acts as an intermediary.

Although the MCBO and ECBO APIs are based on Open Mobile Alliance Data Synchronization (OMA DS), you do not need to know specifics of OMA DS in order to use the APIs. The ECBO API also depends upon Java Content Repository (JCR) technology as defined by JSR-170 (http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html), but it hides the complexity of this technology from the developer.

About the Enterprise Connector Business Object (ECBO) API

The Enterprise Connector Business Object (ECBO) API provides classes and methods that allow you to create an Enterprise Connector, which is a Java artifact that consists of extensions of five classes compiled and packaged into a JAR file along with a resource file.

The methods you implement in your connector are called by the MEP libraries deployed on the Gateway Engine. In this respect, the ECBO API is more like a Service Provider Interface (SPI) than an Application Programmer Interface (API).

Each connector defines a particular business object whose data is to be synchronized. It also defines commands and operations that allow the connector to perform Create, Retrieve, Update, and Delete (CRUD) operations on the business objects.

The five classes you must implement are called BusinessObject, BusinessObjectProvider, InsertCommand, UpdateCommand, and DeleteCommand. The BusinessObjectProvider class provides a method to perform the retrieve operation. Chapter 2, Creating an Enterprise Connector, describes in detail how to implement these classes.

The resource file is an XML file that is used by the underlying JCR implementation. It defines a repository name, a workspace name, and a few node types. All Enterprise Connectors use the same set of node types.

The data to be synchronized takes the form of arbitrary Java objects. The way in which these Java objects are serialized is open-ended and is part of the contract between an Enterprise Connector and its corresponding Java ME client. It is recommended that you use a format that supports data versioning.

Packaging and Deploying Enterprise Connectors

To package an Enterprise Connector, compile the five Java classes and then place them in a JAR file along with the resource file. To see how the sample Enterprise Connectors provided with MEP are packaged, use the jar command to view the contents of any of the following files in the lib directory of the Application Server domain for MEP:

ds-jcr-musicdb.jar

ds-jcr-sap-eway.jar

ds-jcr-siebel-eway.jar

The same Enterprise Connector works equally well in a one-tier or two-tier MEP installation. (See MEP Architecture in Sun Java System Mobile Enterprise Platform 1.0 Architectural Overview for details on these two types of installation.) To deploy the Enterprise Connector, place it in the lib directory of the Application Server domain that contains your MEP installation.

Figure 1–1 shows the location of the Enterprise Connector in a single-tier deployment. The Gateway Engine communicates with the Enterprise Connector using the Java Content Repository (JCR) API. The Enterprise Connector in turn communicates with an EIS/EAI system using a Sun JCA Adapter (JCA stands for Java Connector Architecture).

There are other uses for an Enterprise Connector in addition to communicating with an EIS/EAI system using a Sun JCA Adapter. For example, you can use it in the following ways:

Figure 1–1 An Enterprise Connector in a Single-tier MEP Deployment

An Enterprise Connector in a Single-tier MEP Deployment

In a two-tier MEP deployment, the Enterprise Connector is deployed on the second tier, as shown in Figure 1–2. In this situation, communication between the Gateway Engine and the Enterprise Connector goes through a web service. The Gateway Engine communicates with the web service client using the Java Content Repository (JCR) API. The web service client communicates with the web service endpoint using SOAP/HTTPS. Finally, the web service endpoint communicates with the Enterprise Connector using the JCR API.

Figure 1–2 An Enterprise Connector in a Two-tier MEP Deployment

An Enterprise Connector in a Two-tier MEP Deployment

To configure your deployed Enterprise Connector, use the MEP Admin Console. For details, see Using the Connectors Tab in Sun Java System Mobile Enterprise Platform 1.0 Administration Guide.