Chapter 6. Funambol PIM Data Push

Funambol is not only able to push e-mails to a device, but it can also push updates of the address book or calendar. For example, Anna, Maria's manager, would like to receive changes to her calendar every time her assistant changes an appointment. As illustrated in the following screenshot, when Anna is away, her assistant can access her calendar using Thunderbird.

Funambol PIM Data Push

Changes to Anna's appointments are synchronized to the Funambol server and from there the changes are pushed to her mobile phone. The same is true if Anna's assistant makes any changes to Anna's address book.

As for e-mail, this requires a bit of infrastructure setup, which is the next task Maria is going to perform. This chapter explains how Maria can make sure her users get PIM updates on their mobile phones.

The PIM connector

This section focuses on the PIM Connector, as shown in the following figure. Before reading through this section, have a look at the figure in Chapter 2 that shows the Funambol architecture.

The PIM connector

The PIM Connector has two main components:

  • The PIM server extension (represented in the image by the E-mail Connector block)

  • The PIM Listener Service

The former is the extension of the Funambol Data Synchronization Service that allows PIM synchronization via the Funambol database; the latter is the service that detects changes in the user's PIM database and notifies the user's devices.

When the Funambol DS Service receives sync requests for PIM data, the service calls the PIM Connector that updates the server database with the changes sent by the client and sends back to the client the changes made in the database since the last synchronization.

While the server database can be changed from external sources in addition to Funambol itself, changes to the user's PIM data are detected by the PIM Listener Service. When a change is detected, the PIM Listener Service triggers a notification calling the Funambol DS Service that in turn tells the user's device to start a new synchronization.

If, for any reason, the notification cannot be delivered, Funambol remembers that there are changes that have not been synchronized so that as soon as the mobile device becomes available again, the notification will be delivered and the synchronization will take place.

The PIM Listener Service

For PIM push to work, the PIM Listener Service must be up and running.

The default installation of Funambol is already set up to start the PIM Listener Service at startup, when executing the command:

$FUNAMBOL_HOME/bin/funambol start

However, Maria knows that for her environment, it is recommended that this service be installed on a separate server to support the desired number of users. The easiest way to do this is to install Funambol on a dedicated system and start the PIM Listener Service only.

This is done by executing the following command:

> $FUNAMBOL_HOME/bin/pim-listener start

As in the case of the Inbox Listener Service, Maria can check that the service is running by issuing the Linux ps command and checking that the output is similar to the following:

> ps -ef |grep java
maria 16514 1 36 00:59 pts/1 00:00:03 /opt/Funambol/tools/jre-1.5.0/jre/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Dfunambol.pushlistener.config.bean=com/funambol/pimlistener/PIMListenerConfiguration.xml -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.funambol.pimlistener.service.PimListener

Similar to the Inbox Listener Service, logging in the PIM Listener is configured via the configuration file log4j-pimlistener.xml located under the configuration directory $FUNAMBOL_HOME/config and not in the Funambol Administration Tool as described in Chapter 3.

For example, to enable full logging, Maria needs to turn the level of the Funambol logger to ALL:

<logger name="funambol">
<level value="ALL"/>
</logger>

By default, the PIM Listener log file is located under $FUNAMBOL_HOME/logs/pim-listener.

PIM push at work

Maria has seen how to configure a mobile phone for push e-mail. She will now see how PIM push works using the same device.

First, push is totally configurable on the device. Selecting Settings from the Menu, the following panel appears:

PIM push at workPIM ConnectorPIM Listener Service

There are three Sync Method options available.

  • Manual sync: When push is on manual, the synchronization takes place only upon request by the user.

  • Scheduled sync: With scheduled sync, Maria can select an interval from 15 minutes to once a day. This means that the synchronization will automatically start at periodic intervals based on the selected time lapse.

  • Push service: For the rest of this chapter, Maria will select the push service so that the synchronization will automatically start whenever updates needing synchronization are present.

Note that the Sync Method not only controls server-to-client push, but also client-to-server push. In fact, when the sync method is scheduled or push, all changes on the device are automatically synchronized to the server, even if there aren't any changes on the server.

To see a simple example of PIM push working, Anna adds a new appointment for the morning of July 21 on her device. Her assistant adds a new appointment for the same day in the afternoon in Thunderbird, as shown in the following screenshot:

PIM push at workPIM ConnectorPIM Listener Service

After a while, synchronization takes place—either because of the change detected on Anna's device or because the PIM listener detected the change made by Anna's assistant on Thunderbird calendar—and both the device and the desktop calendars have the same appointments, as shown in the following screenshot:

PIM push at workPIM ConnectorPIM Listener Service

Note

Note that to make sure Thunderbird calendar is automatically synchronized, it must be configured with scheduled synchronization on, as described in Chapter 1.

What if connection-less push is impossible

Depending on the mobile environment or carrier infrastructure available for Maria's users as described in Chapter 2, Funambol's connection-less push may be unavailable. This may be due to security restrictions or network configuration, but in some cases the carrier does not provide mobile phones with an IP address that a Funambol server can reach. In these cases, connection-less push becomes impossible and the clients use connection-oriented push instead.

As explained in Chapter 2, connection-oriented push is based on the ability of the clients to establish a constant connection to the Push Connection Service. This is a service that Maria needs to set up and start in her environment. Similarly to other services, it is good practice to have a dedicated system for this service, particularly because the Push Connection Service has a different scalability profile compared to other Funambol services. Given the service it provides, this process is not memory or CPU consuming, but it potentially uses a lot of network resources. This depends on the number of users that needs to be supported, because each device using connection-oriented push will keep a connection open with this system.

The default installation of Funambol is already set up to start the Push Connection Service at startup, when launching the following command:

$FUNAMBOL_HOME/bin/funambol start

However, in a more scalable environment, it is recommended that this service be installed on a separate server (potentially more than one, depending on the number of users that the system must serve). The easiest way to do this is to install Funambol on the dedicated system and start only the Push Connection Service.

This is done by executing the following command:

> $FUNAMBOL_HOME/bin/ctp-server start


Note

If the Push Connection Service is not running, users will not be notified of updates using connection-oriented push.

Maria can easily check if the service is up and running by issuing the Linux ps command and checking that the output is similar to the following:

maria 13194 1 5 10:52 pts/2 00:00:04 /opt/Funambol/tools/jre-1.5.0/jre/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.funambol.ctp.server.CTPServer

Push Connection Service configuration

When a client connects to the Push Connection Service, the first thing the service does is authenticate the user. To do this, it connects to the Data Synchronization Service and verifies that the given credentials are correct. Therefore, if the service is running on a different host, the Push Connection Service must be configured with the proper address.

Maria will do this by editing the configuration file $FUNAMBOL_HOME/com/funambol/ctp/server/CTPServerConfiguration.xml as shown in the following example:

<void property="WSServerInformation">
<object class="com.funambol.server.admin.ws.client. ServerInformation">
<void property="url">
<string>http://server:port/funambol/services/admin </string>
</void>
<void property="username">
<string>admin</string>
</void>
<void property="password">
<string>password</string>
</void>
</object>
</void>

Note that after this change, the service must be restarted.

Verifying push activity

To verify that the Push Connection Service is working and pushing users, Maria can review the log file to access a lot of information.

For example, to check that a user device has been pushed, Maria can check for entries like the following:

[2009-07-21 15:54:23,209] [funambol.ctp.server.session-manager] [INFO] [OOB Thread,ctp-notification-group,127.0.0.1:32876] [/217.202.61.89:1028] [95b54666-529d-4f56-a0c6-bb1fe5b39a48] [fwm-35313801010967P7] [anna] Sending notification message to the device ‘fwm-35313801010967P7'

If Maria needs to troubleshoot push issues in more detail, she can increase the log level to find a lot more information in the log file, as seen for other services, by editing the file $FUNAMBOL_HOME/config/log4j-ctpserver.xml and setting the level for the Funambol logger to ALL:

<logger name="funambol">
<level value="ALL"/>
</logger>

Summary

In this chapter, Maria learned how to set up and operate PIM push, both from client to server and from server to client. She learned how to set up and start the PIM Connector and PIM Listener Services and how they work in a complex end-to-end scenario using a Windows Mobile phone.

Maria also learned how to run the Push Connection Service, how to verify that it is delivering push notifications, and how to access the log for more troubleshooting details.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.107.254