+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Migrate existing adapters to work under MobileFirst Server V8.0.0

Starting with V8.0.0 of MobileFirst Server, adapters are Maven projects. Learn how to upgrade adapters that were developed under earlier versions of MobileFirst Server.


Before you begin

This page describes the steps to take to migrate adapters that were developed to work with MobileFirst Server V6.2 or later so that they work with MobileFirst Server V8.0.0.

To start, study the changes in adapter APIs that are described in Deprecated features and API elements and Server-side API changes in V8.0.0.

Parent topic: Migrating apps from earlier releases


Using older adapters as-is under MobileFirst Server V8.0.0

An existing adapter can be deployed as-is under MobileFirst Server V8.0.0, unless it matches any of the following criteria:

Table 1. Adapter conditions
Adapter type Condition
Java Uses the PushAPI or SecurityAPI interfaces
JavaScript Was built using IBM® Worklight® V6.2 or earlier
Uses a connection type that is not HTTP or SQL
Contains procedures with securityTest customization
Contains procedures that use the user identity to connect to the back end
Uses any of the following APIs:

  • WL.Device.*
  • WL.Geo.*
  • WL.Server.readSingleJMSMessage
  • WL.Server.readAllJMSMessages
  • WL.Server.writeJMSMessage
  • WL.Server.requestReplyJMSMessage
  • WL.Server.getActiveUser
  • WL.Server.setActiveUser
  • WL.Server.getCurrentUserIdentity
  • WL.Server.getCurrentDeviceIdentity
  • WL.Server.createEventSource
  • WL.Server.createDefaultNotification
  • WL.Server.getUserNotificationSubscription
  • WL.Server.notifyAllDevices
  • WL.Server.notifyDeviceToken
  • WL.Server.notifyDeviceSubscription
  • WL.Server.sendMessage
  • WL.Server.createEventHandler
  • WL.Server.setEventHandlers
  • WL.Server.setApplicationContext
  • WL.Server.fetchNWBusinessObject
  • WL.Server.createNWBusinessObject
  • WL.Server.deleteNWBusinessObject
  • WL.Server.updateNWBusinessObject
  • WL.Server.getBeaconsAndTriggers
  • WL.Server.signSoapMessage
  • WL.Server.createSQLStatement


Migrating Java adapters to Maven projects for MobileFirst Server V8.0.0


Procedure

  1. Create a Maven adapter project with the archetype adapter-maven-archetype-java. When setting the parameter artifactId use the adapter name and for the parameter package use the same package as the one in the existing Java adapter. For more information, see Create Java adapters.
  2. Overwrite the adapter-descriptor file (adapter.xml) under src/main/adapter-resources in the created project from the existing Java adapter. For more details about the descriptor, see The Java adapter-descriptor file.
  3. Remove all the files under src/main/java in the created project from the existing Java adapter, then copy all the Java files under the old adapter's src folder, but preserve the same folder structure. Copy all the non-Java files under the src folder of the old adapter to the src/main/resources of the new adapter. By default, src/main/resources does not exist, so if the adapter contains non-Java files, create it. For the changes in Java adapter APIs, see Server-side API changes in V8.0.0. The following diagrams illustrate the structure of adapters up to V7.1 and Maven adapters, starting from V8.0:

    Figure 1. Adapter folder structure up to V7.1

    Shows the folder structure in adapters up to V7.1

    Figure 2. Maven adapter structure, starting from V8.0.0

    Shows Maven adapter structure, starting from V8.0.0

  4. Using either of the following methods, add any JAR files that are not in the Maven repository:


Migrating JavaScript adapters to Maven projects for MobileFirst Server V8.0.0


Procedure

  1. Create a Maven adapter project with the archetype adapter-maven-archetype-http or adapter-maven-archetype-sql. When setting the parameter artifactId use the adapter name. For more information, see Create JavaScript adapters.
  2. Overwrite the adapter-descriptor file (adapter.xml) under src/main/adapter-resources in the created project from the existing JavaScript adapter. For details about the descriptor, see The JavaScript adapter-descriptor file.
  3. Overwrite the JavaScript files src/main/adapter-resources/js in the created project from the existing JavaScript adapter JavaScript files.