pax_global_header00006660000000000000000000000064143376364250014527gustar00rootroot0000000000000052 comment=1b78dfa895499108263bd1de88a8ebb10fad9811
buteo-syncml-0.5.15/000077500000000000000000000000001433763642500142405ustar00rootroot00000000000000buteo-syncml-0.5.15/.gitignore000066400000000000000000000001131433763642500162230ustar00rootroot00000000000000Makefile
*.list
*.prl
*.so*
src/pkgconfig
tests_meego/libbuteosyncml-tests
buteo-syncml-0.5.15/Scripts/000077500000000000000000000000001433763642500156675ustar00rootroot00000000000000buteo-syncml-0.5.15/Scripts/tests2junit.xsl000066400000000000000000000052431433763642500207210ustar00rootroot00000000000000
Standard
buteo-syncml-0.5.15/api.file000066400000000000000000000001731433763642500156530ustar00rootroot00000000000000interface: MeeGo syncML
type: library
scope: Platform
state: unstable
libs-pkg: libmeegosyncml
dev-pkg: libmeegosyncml-dev
buteo-syncml-0.5.15/build_project.sh000077500000000000000000000050521433763642500174260ustar00rootroot00000000000000#!/usr/bin/env sh
#/*
#* This file is part of buteo-syncml package
#*
#* Copyright (C) 2010 Nokia Corporation. All rights reserved.
#*
#* Contact: Sateesh Kavuri
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions are met:
#*
#* Redistributions of source code must retain the above copyright notice,
#* this list of conditions and the following disclaimer.
#* Redistributions in binary form must reproduce the above copyright notice,
#* this list of conditions and the following disclaimer in the documentation
#* and/or other materials provided with the distribution.
#* Neither the name of Nokia Corporation nor the names of its contributors may
#* be used to endorse or promote products derived from this software without
#* specific prior written permission.
#*
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
#* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
#* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
#* THE POSSIBILITY OF SUCH DAMAGE.
#*
#*/
# todo add proper exit codes
# This script is for executing (re)building the library from scratch
# and running unit tests
# To create the debian packages, use "dpkg-buildpackage"
export PATH=/home/bamboo2/qt/qtsdk-2009.02/qt/bin:$PATH
if [ -f Makefile ]; then
make distclean
fi
rm -rf tests_meego/results
qmake libmeegosyncml.pro
# For single core envs, maybe remove -j2
make -j3
cd tests_meego
export LD_LIBRARY_PATH=$PWD/../src/
if [ -d results ]; then
rm -f results/*
else
mkdir results
fi
./libmeegosyncml-tests -xml > results/tests.xml
cd results
# todo catch if the parsing fails
# csplit -f test- tests.xml "/<\?xml version=\"1.0\" encoding=\"ISO-8859-1\"\?>/" '{*}'
awk '/^<\?xml/{n++}{print > n "-split.xml" }' tests.xml
# csplit -f test- tests.xml "/^ $i-junit.xml
done
buteo-syncml-0.5.15/debian/000077500000000000000000000000001433763642500154625ustar00rootroot00000000000000buteo-syncml-0.5.15/debian/api000066400000000000000000000001731433763642500161570ustar00rootroot00000000000000interface: MeeGo syncML
type: library
scope: Platform
state: unstable
libs-pkg: libmeegosyncml
dev-pkg: libmeegosyncml-dev
buteo-syncml-0.5.15/debian/changelog000066400000000000000000001004101433763642500173300ustar00rootroot00000000000000libmeegosyncml (0.4.18) stable; urgency=low
* Fixes: NB#238013 - reduce amount of logging and logging impact in sync-fw
-- Deepak Kodihalli Mon, 30 May 2011 11:50:48 +0530
libmeegosyncml (0.4.17) stable; urgency=low
* Fixes: NB#260125 - Remote sync failed with device and sync doesn't end in
transfer-ui
-- Deepak Kodihalli Thu, 26 May 2011 17:27:00 +0530
libmeegosyncml (0.4.16) stable; urgency=low
* Fixes: NB#258951 - msyncd crash when cancel the sync from transfer-ui
-- Deepak Kodihalli Wed, 25 May 2011 11:09:12 +0530
libmeegosyncml (0.4.15) stable; urgency=low
* Fixes: NB#254284 - defects from libmeegosyncml/0.4.14_0m6 .
-- Amit Wed, 18 May 2011 18:11:00 +0300
libmeegosyncml (0.4.14) stable; urgency=low
* Unit test cases updated.
-- Santosh Puranik Mon, 02 May 2011 18:11:00 +0300
libmeegosyncml (0.4.13) stable; urgency=low
* Check if tables exist before removing change logs and anchors.
-- Santosh Puranik Wed, 06 Apr 2011 20:00:00 +0530
libmeegosyncml (0.4.12) stable; urgency=low
* Fixes: NB#223952 - Not all the contacts are syncd from DUT to S60
* Adding changes to remove default configuration and abort sync to take parameter.
-- Amit Thu, 03 Feb 2011 14:40:03 +0530
libmeegosyncml (0.4.11) stable; urgency=low
* 1. Please try to use 3 digits for the version x.y.z - 0.0.1
* 2. When something significant happens (sprint, X-something review) increase second digit - 0.1.0
* 3. When something very significant happens (dali release, etc) increase first digit - 1.0.0
* 4. Whenever regular changes in the code are done (bugfixes, minor
features implemented) please always increment the last digit - 0.0.2.
-- Mallikarjun Hunalli Mon, 31 Jan 2011 18:00:00 +0530
libmeegosyncml (0.4.10-7) stable; urgency=low
* Fixes - Removed the "silent" option set in CONFIG of a pro file
-- Mallikarjun Hunalli Tue, 27 Jan 2011 18:00:00 +0530
libmeegosyncml (0.4.10-6) stable; urgency=low
* Fixes: NB#201619 - Synchronization is stuck in the progress indicator screen when the internet is interrupted while sync.
-- Amit Tue, 25 Jan 2011 18:00:00 +0530
libmeegosyncml (0.4.10-5) stable; urgency=low
* Fixes - Bookmark sync support removed
-- Mallikarjun Hunalli Thu, 20 Jan 2011 18:00:00 +0530
libmeegosyncml (0.4.10-4) stable; urgency=low
* Fixes: NB#204328 - msyncd crashed while resyncing SMS after sync
fails with S40(5310), remote initiated
-- Amit Mon, 17 Jan 2011 10:00:00 +0200
libmeegosyncml (0.4.10-3) stable; urgency=low
* Deleting the waiting bug.
-- Amit Thu, 30 Dec 2010 16:25:00 +0530
libmeegosyncml (0.4.10-1) stable; urgency=low
* Fixes: NB#212083 - Consecutive sync (after a successful sync) with ovi.com always fails.
* Fixes: NB#212465 - Synchronization is stuck in the progress indicator screen when the internet is interrupted while sync.
-- Amit Fri, 17 Dec 2010 16:25:00 +0530
libmeegosyncml (0.4.10-0) stable; urgency=low
* Mark package as stable
-- Santosh Puranik Mon, 13 Dec 2010 16:25:00 +0530
libmeegosyncml (0.4.9-52) unstable; urgency=low
* Fixes: NB#208762 - All data sync from S40 fails. As problem with size for xml.
Now using size calculation based on wbxml for ms size threshold.
-- Amit Wed, 08 Dec 2010 15:14:00 +0530
libmeegosyncml (0.4.9-51) unstable; urgency=low
* Fixes: NB#203771 Conflict set to N95:Calendar entry is deleted in N95
when modified a calendar entry in N95 and deleted the same in DUT
-- Santosh Puranik Thu, 02 Dec 2010 15:14:00 +0530
libmeegosyncml (0.4.9-50) unstable; urgency=low
* Fix tests.xml
-- Santosh Puranik Wed, 01 Dec 2010 15:14:00 +0530
libmeegosyncml (0.4.9-49) unstable; urgency=low
* Support both DS and DM content types in transports.
-- Duggirala Karthik Tue, 30 Nov 2010 18:30:00 +0530
libmeegosyncml (0.4.9-48) unstable; urgency=low
* Fixes: NB#206970 - After synchronising contacts, incorrect number of
contacts synced is reported.
-- Santosh Puranik Wed, 24 Nov 2010 18:30:00 +0530
libmeegosyncml (0.4.9-47) unstable; urgency=low
* Support DMDDF wbxml codepage
-- Duggirala Karthik Wed, 24 Nov 2010 15:15:00 +0530
libmeegosyncml (0.4.9-46) unstable; urgency=low
* Fixes: NB#176179 - Contacts not copied to device during sync. Added a
check for packages to be sent before we dtermine whether the data update
status package can be sent.
* Added Ext parameter support for Storage plugins.
-- Santosh Puranik Mon, 15 Nov 2010 15:15:00 +0530
libmeegosyncml (0.4.9-45) unstable; urgency=low
* Fixes: NB#176179 - Contacts not copied to device during sync.
-- Santosh Puranik Wed, 10 Nov 2010 20:00:00 +0530
libmeegosyncml (0.4.9-44) unstable; urgency=low
* Fixes: NB#198594 - ovi.com contact sync fails with Invalid syncML message.
-- Santosh Puranik Thu, 04 Nov 2010 15:00:00 +0530
libmeegosyncml (0.4.9-43) unstable; urgency=low
* Fixes: NB#180964 - SMS messages synced from N95 all have today's time
stamp
-- Santosh Puranik Fri, 20 Oct 2010 20:45:32 +0530
libmeegosyncml (0.4.9-42) unstable; urgency=low
* Fixes: NB#196459 - Memory leaks when one Note is synced from S60 to Dali.
* Fixes: NB#198456 - Modified contact with avatar in S60 (N95) is duplicated in device after resync from device.
-- Amit Thu, 18 Oct 2010 15:16:32 +0530
libmeegosyncml (0.4.9-41) unstable; urgency=low
* Fixed a couple of issues seen with google sync - not handling percent encoded
respURIs and not updating target LocURIs with the respURIs.
-- Deepak Kodihalli Thu, 14 Oct 2010 15:16:32 +0530
libmeegosyncml (0.4.9-40) unstable; urgency=low
* Refactoring to make handling of SyncML protocol more generic
* Fixes to MD5 authentication
* Graceful handling of unsupported commands
-- Amit Wed, 13 Oct 2010 14:00:00 +0300
libmeegosyncml (0.4.9-39) unstable; urgency=low
* Fixes: NB#194061 - Sync always fails for calendar only data with S40 (6500).
-- Amit Tue, 12 Oct 2010 18:20:00 +0330
libmeegosyncml (0.4.9-38) unstable; urgency=low
* NB#197079 - Existing data in N900 is not transferred to device after
reflashing the device.
-- Santosh Puranik Sat, 09 Oct 2010 18:20:00 +0330
libmeegosyncml (0.4.9-37) unstable; urgency=low
* Tests deb pkg dependency changes to testrunner->testrunner-line
-- Duggirala Karthik Thu, 07 Oct 2010 17:16:14 +0330
libmeegosyncml (0.4.9-36) unstable; urgency=low
* Fixes: NB#195583 Some data not copied message dislayed for any/all data
when sync initiated from S60 to device
-- Duggirala Karthik Mon, 04 Oct 2010 09:00:00 +0300
libmeegosyncml (0.4.9-35) unstable; urgency=low
* Parsing of device information sent by remote device
* Delayed loading of storage plugins in D2D sync
-- Deepak Kodihalli Tue, 21 Sep 2010 09:00:00 +0300
libmeegosyncml (0.4.9-34) unstable; urgency=low
* Fixed installation of default conf file
-- Deepak Kodihalli Mon, 20 Sep 2010 14:30:00 +0300
libmeegosyncml (0.4.9-33) unstable; urgency=low
* Disabled schema-based validation of conf file
-- Deepak Kodihalli Thu, 16 Sep 2010 16:30:00 +0300
libmeegosyncml (0.4.9-32) unstable; urgency=low
* Implemented item data prefetching on idle time
* Added more configuration parameters
-- Deepak Kodihalli Wed, 15 Sep 2010 15:00:00 +0300
libmeegosyncml (0.4.9-31) unstable; urgency=low
* OBEX connectivity updates
-- Deepak Kodihalli Mon, 6 Sep 2010 16:30:00 +0300
libmeegosyncml (0.4.9-30) unstable; urgency=low
* Fixes: NB#188615 - Characters with codes above U+00FF get corrupted
during sync
-- Deepak Kodihalli Tue, 31 Aug 2010 13:30:00 +0530
libmeegosyncml (0.4.9-29) unstable; urgency=low
* Fixes: NB#183589 - Development packages libmeegosyncml-dev and
sync-fw-dev does not contain .pc files
-- Deepak Kodihalli Tue, 31 Aug 2010 09:32:56 +0530
libmeegosyncml (0.4.9-28) unstable; urgency=low
* Tag for Meego
* Made fixes for NB#185704: The bug can't yet be resolved due to
dependencies, though.
* Removed some proprietary HTTP headers.
-- Duggirala Karthik Tue, 24 Aug 2010 16:00:00 +0300
libmeegosyncml (0.4.9-27) unstable; urgency=low
* Fixes: NB#182304 - Some data not transfered message displayed when
all data sync initiated from 5200
* Fixes: NB#185413 - Sync with Nokia 6300i fails with "no content
available for sync" failure when there are three content types enabled
-- Deepak Kodihalli Thu, 19 Aug 2010 11:59:04 +0530
libmeegosyncml (0.4.9-26) unstable; urgency=low
* Fixed a regression in LocalChangesPackage::processRemovedItems : don't
fetch these items from backend, as they have been deleted and don't exist!
* Fixes: NB#185595 - Sync log doesnot display all the content type label names.
-- Deepak Kodihalli Wed, 18 Aug 2010 11:59:04 +0530
libmeegosyncml (0.4.9-25) unstable; urgency=low
* TODO : PR
* Fixes: NB#179954 - It took ~10 minutes to display device contacts from
NOS
-- Deepak Kodihalli Tue, 17 Aug 2010 11:59:04 +0530
libmeegosyncml (0.4.9-24) unstable; urgency=low
* Removed unnecessary stuff from debian/rules which was causing compilation
issues!
* Fixes: NB#183589 - Development packages libmeegosyncml-dev and
sync-fw-dev does not contain .pc files
-- Deepak Kodihalli Mon, 16 Aug 2010 14:06:48 +0530
libmeegosyncml (0.4.9-23) unstable; urgency=low
* Fixes: NB#171728 - Switch needs to fall back to sync if client does not
support one way sync.
-- Deepak Kodihalli Tue, 10 Aug 2010 12:05:04 +0530
libmeegosyncml (0.4.9-22) unstable; urgency=low
* Fixes: NB#183511 - SSU Fails: Packaging conflict between
libmeegosyncml_0.4.9-17+0m6_armel.deb and libmaemosyncml 0.4.9-8+0m6
* Added UT cases for refresh sync.
* Workaround for NB#176070 - QNetworkAccessManager can't be used in
QThreads.
* Fixes: 183009 - Optimize signals from sync backend to UI.
-- Deepak Kodihalli Mon, 09 Aug 2010 10:14:00 +0530
libmeegosyncml (0.4.9-21) unstable; urgency=low
* Fixes: NB#183706 Modified contact in N95 is updated to DUT after
sync when delete the same contact in DUT before sync, when conflict set to DUT
-- Duggirala Karthik Fri, 05 Aug 2010 09:26:52 +0530
libmeegosyncml (0.4.9-20) unstable; urgency=low
* In case of an anchor mismatch, revert to refresh/slow sync based on the
sync direction, sync initiator and remote device sync types.
* Fixes: NB#183279 defects from libmaemosyncml
-- Duggirala Karthik Thu, 05 Aug 2010 09:26:52 +0530
libmeegosyncml (0.4.9-19) unstable; urgency=low
* Fixes: NB#180367 Conflict set to DUT: Modified contact in DUT is
not updated to N95, when modify a contact in DUT and delete the same contact in N95.
* Fixes: NB#180360 Modifications made to device contacts are not reflected in
N900 when conflict is set to device and vice versa
* Fixes: NB#183324 - Unable to integrate SyncScheduleSettingsDialog into MfE
accounts ui plugin.
-- Duggirala Karthik Wed, 04 Aug 2010 11:30:08 +0530
libmeegosyncml (0.4.9-18) unstable; urgency=low
* Implemented refresh sync, merged changes from refresh_sync branch to
nokia_proprietary branch.
* Fixes: NB#180900 - Support refresh sync in client and server modes.
* Fixes: NB#177628 - N900 : Send use case fails when sync initiated from
* Fixes: NB#182959 - Sync failed for Calendar only data when initiated
from S60 (N97mini)
* Don't fail addition/modification for an item that has without a .
-- Duggirala Karthik Mon, 02 Aug 2010 11:30:08 +0530
libmeegosyncml (0.4.9-17) unstable; urgency=low
* Changing package name libmaemosyncml->libmeegosyncml
-- Duggirala Karthik Fri, 23 Jul 2010 14:29:24 +0530
libmaemosyncml (0.4.9-16) unstable; urgency=low
* Fixes: NB#167889 - Sync fails if bluetooth pairing is removed from device
-- Duggirala Karthik Thu, 22 Jul 2010 14:29:24 +0530
libmaemosyncml (0.4.9-15) unstable; urgency=low
* Fixes: NB#181297 - "remote initiated sync from S40/S60/N900 does not end at all"
-- Duggirala Karthik Wed, 21 Jul 2010 14:29:24 +0530
libmaemosyncml (0.4.9-14) unstable; urgency=low
* Fixes: NB#179703 - Syncing calendar data and notes with S60 (N97mini)
fails, initiated from Device
-- Duggirala Karthik Tue, 20 Jul 2010 14:29:24 +0530
libmaemosyncml (0.4.9-13) unstable; urgency=low
* Rebuild
-- Duggirala Karthik Mon, 19 Jul 2010 15:10:24 +0530
libmaemosyncml (0.4.9-12) unstable; urgency=low
* Reverted fix 177628
* Fixes: NB#180426 - Switch fails for all/individual data with S60 phone
-- Duggirala Karthik Fri, 16 Jul 2010 15:10:24 +0530
libmaemosyncml (0.4.9-11) unstable; urgency=low
* Fixes: NB#176944 - Changes required in syncml stack state machine
to handle receiving of mappings while it's sending items.
* Close the obex BT link in client mode when there is a link error.
* Fixes: 177628 - N900 : Send use case fails when sync
initiated from device in particular scenario
-- Duggirala Karthik Wed, 14 Jul 2010 15:10:24 +0530
libmaemosyncml (0.4.9-10) unstable; urgency=low
* Rebuild .
-- Duggirala Karthik Thu, 08 Jul 2010 14:52:24 +0530
libmaemosyncml (0.4.9-9) unstable; urgency=low
* Compilation fixes .
-- Duggirala Karthik Wed, 07 Jul 2010 14:52:24 +0530
libmaemosyncml (0.4.9-8) unstable; urgency=low
* Support for reading configuration from a file
* Modified configuration API to be based on properties, and easier to use
* Added support of http x-headers
* Fixes: NB#176791 - There should be a HTTP patches to sync-app and
libmaemosyncml for AT&T addressbook synch
-- Duggirala Karthik Sat, 03 Jul 2010 14:52:24 +0530
libmaemosyncml (0.4.9-7) unstable; urgency=low
* Fixes: NB#174412 - All data sync from device to N900 does not end
* Fixes: NB#174748 - Remote sync from S40 fails always, if sync application
is open then sync ui crashes too
* Fixes: NB#176871 - msyncd crash when delete a calendar event in N95 and
modify the same event in device.
-- Duggirala Karthik Mon, 28 Jun 2010 14:52:24 +0530
libmaemosyncml (0.4.9-6) unstable; urgency=low
* Fixes: NB#166841 - Contacts in device are not synchronized to S40
device - server client role change
* Dynamic role selection
-- Duggirala Karthik Mon, 21 Jun 2010 14:52:24 +0530
libmaemosyncml (0.4.9-5) unstable; urgency=low
* Removal of profile related changes.
-- Duggirala Karthik Fri, 18 Jun 2010 14:52:24 +0530
libmaemosyncml (0.4.9-3) unstable; urgency=low
* Fixes: 174265 - Msyncd crashed when avatar is added to contact and synced
from DUT to N900
-- Duggirala Karthik Mon, 14 Jun 2010 14:52:24 +0530
libmaemosyncml (0.4.9-2) unstable; urgency=low
* Fixed issues related to storing and cleaning of id mappings
* Fixes: NB#171533 - Device sync to S40-msyncd crashed for all data
-- Duggirala Karthik Sun, 13 Jun 2010 15:42:48 +0530
libmaemosyncml (0.4.9-1) unstable; urgency=low
* Fixes: NB#172829 - Contacts created in DUT does not synchronize to N900
- N900 Initiated
* Accounts related changes.
-- Duggirala Karthik Wed, 09 Jun 2010 14:46:29 +0530
libmaemosyncml (0.4.8-13) unstable; urgency=low
* Fixes: NB#172626 None of the calendar events from S40 gets synchronized to DUT -
S40 Initiated
* Fixes: NB#166780 Syncing combination of any 2 N900 contents failing when
sync initiated from N900 .
-- Duggirala Karthik Fri, 04 Jun 2010 13:35:21 +0530
libmaemosyncml (0.4.8-12) unstable; urgency=low
* Fixes: Phone number is displayed in the Contact application
instead of Name after transferring contacts via switch application.
-- Duggirala Karthik Mon, 02 Jun 2010 13:35:21 +0530
libmaemosyncml (0.4.8-10) unstable; urgency=low
* Fixes: Phone number is displayed in the Contact application
instead of Name after transferring contacts via switch application.
* Fixes: NB#171057 - msyncd crash for calendar data with N95 in conflict
scenario.
-- Duggirala Karthik Mon, 31 May 2010 13:35:21 +0530
libmaemosyncml (0.4.8-9) unstable; urgency=low
* Fixes: NB#171057 - msyncd crash for calendar data with N95 in conflict
scenario.
* Fixes: NB#169487 Phone number is displayed in the Contact application
instead of Name after transferring contacts via switch application
-- Duggirala Karthik Tue, 25 May 2010 13:35:21 +0530
libmaemosyncml (0.4.8-8) unstable; urgency=low
* Added convinience function to ChangeLog to allow external applications to manipulate
and delete sync anchor data
-- Duggirala Karthik Wed, 19 May 2010 13:35:21 +0530
libmaemosyncml (0.4.8-7) unstable; urgency=low
* Added convinience function to ChangeLog to allow external applications to manipulate
and delete sync anchor data
* Fixes: NB#167135 - Modified Calendar/Contact data is added as duplicate
copies in DUT if first sync is initiated from S60
-- Duggirala Karthik Sat, 15 May 2010 13:35:21 +0530
libmaemosyncml (0.4.8-6) unstable; urgency=low
* Week 18 PR
* Large improvements to OBEX transport
* Updates to doxygen documentation
* Fixes: NB161729 - Remote sync from the latest S60 phones does not work due to d2dsettings message
* Fixes: NB164672 None of the bookmarks are synchronized from DUT
to PC via Ovi_suite BT/USB
* Removed SAN package digest check.
-- Duggirala Karthik Wed, 28 Apr 2010 16:11:43 +0300
libmaemosyncml (0.4.8-5) unstable; urgency=low
* Week 17 PR
* Made server URI comparison case insensitive when figuring out MIME type
-- Duggirala Karthik Wed, 21 Apr 2010 13:44:05 +0300
libmaemosyncml (0.4.8-4) unstable; urgency=low
* Week 16 PR
-- Duggirala Karthik Wed, 14 Apr 2010 13:48:45 +0300
libmaemosyncml (0.4.8-3) unstable; urgency=low
* Week 15 PR
-- Duggirala Karthik Wed, 07 Apr 2010 13:39:36 +0300
libmaemosyncml (0.4.8-2) unstable; urgency=low
* Minor fix for crash seen in ovi suite sync with contacts
-- Srikanth Kavoori Thu, 01 Apr 2010 16:21:17 +0300
libmaemosyncml (0.4.8-1) unstable; urgency=low
* Week 14 PR
* Added support for re-sending initialization package for HTTP transport
* Review Comments Changes updated
-- Srikanth Kavoori Wed, 31 Mar 2010 14:17:17 +0300
libmaemosyncml (0.4.8-0) unstable; urgency=low
* Week 13 PR
* Fixes: NB#157296 - Code review for libmaemosyncml
-- Srikanth Kavoori Wed, 24 Mar 2010 17:49:10 +0200
libmaemosyncml (0.4.7-9) unstable; urgency=low
* Week 12 PR
* Added support for server initiated syncing using SyncML 1.2 SAN package
-- Srikanth Kavoori Thu, 18 Mar 2010 19:22:03 +0200
libmaemosyncml (0.4.7-8) unstable; urgency=low
* Fix for properly sending wbxml when requested after receiving SAN message
* Fixes: NB#160190 - 'Some data not copied' message is displayed after synchronizing calendar data/notes/contacts with S60 phone
* Support for multiple CTCap objects per storage
-- Srikanth Kavoori Tue, 16 Mar 2010 14:54:47 +0200
libmaemosyncml (0.4.7-7) unstable; urgency=low
* Week 10 PR
-- Srikanth Kavoori Thu, 11 Mar 2010 11:32:03 +0200
libmaemosyncml (0.4.7-6) unstable; urgency=low
* Week 09 PR
* Fixed some bugs in OBEX transport
* Different MTU's for BT and USB transports
* Fixes: NB#153864 - msyncd constantly consumes ~75% of CPU after transferring 2 GB of data to DUT
-- Srikanth Kavoori Wed, 3 Mar 2010 09:52:47 +0200
libmaemosyncml (0.4.7-5) unstable; urgency=low
* Week 08 PR
* Reinforced OBEX transport to only accept Connect commands with target set to "SYNCML-SYNC"
* Support for hierarchical synchronization added
-- Srikanth Kavoori Wed, 24 Feb 2010 16:04:45 +0200
libmaemosyncml (0.4.7-4) unstable; urgency=low
* Week 07 PR
* Removed dependency to sqlite3 package
* Added support for parsing & initiating sync from SyncML 1.2 SAN package
-- Srikanth Kavoori Thu, 18 Feb 2010 15:44:17 +0200
libmaemosyncml (0.4.7-3) unstable; urgency=low
* Week 07 Release
* Implemented: SWP#Hsync-698: Busy Signalling
* Made upper limit for number of changes as configurable
* Fixes: NB#150562 - in sync
* Fixes: NB#156558 - valgrind returns 2 Invalid Read issues for libmaemosyncml-tests
-- Srikanth Kavoori Mon, 15 Feb 2010 09:24:47 +0200
libmaemosyncml (0.4.7-2) unstable; urgency=low
* Week 06 Release 2
-- Srikanth Kavoori Thu, 11 Feb 2010 13:14:14 +0200
libmaemosyncml (0.4.7-1) unstable; urgency=low
* Week 06 Release
-- Srikanth Kavoori Mon, 8 Feb 2010 10:15:56 +0200
libmaemosyncml (0.4.7-0) unstable; urgency=low
* Week 05 Release
* Fixed itemProcessed() signal not being emitted when items have been added
to remote database
* Fixes: NB#153991 - msyncd crashed while synchronizing all data with N900
-- Srikanth Kavoori Mon, 1 Feb 2010 14:38:16 +0200
libmaemosyncml (0.4.6-4) unstable; urgency=low
* Week 04 Release
* Added the feature to limit the number of messages per syncml message
-- Srikanth Kavoori Mon, 25 Jan 2010 11:44:55 +0200
libmaemosyncml (0.4.6-3) unstable; urgency=low
* Week 03 Release 01
-- Srikanth Kavoori Mon, 18 Jan 2010 11:31:47 +0200
libmaemosyncml (0.4.6-2) unstable; urgency=low
* Week 02 Release 2
-- Srikanth Kavoori Wed, 13 Jan 2010 12:06:10 +0200
libmaemosyncml (0.4.6-1) unstable; urgency=low
* Week 02 Release
* Fixes: NB#150562 - Memory leaks in libmaemosyncml tests
-- Srikanth Kavoori Mon, 11 Jan 2010 14:33:59 +0200
libmaemosyncml (0.4.6-0) unstable; urgency=low
* Week 52 Release
-- Srikanth Kavoori Mon, 21 Dec 2009 14:36:39 +0200
libmaemosyncml (0.4.5-0) unstable; urgency=low
* Week 51 Release
* Fixes: NB#149311 - First sync does not add any data from N900
* Fixes: NB#148705 - Coverity defects for libmaemosyncml
-- Srikanth Kavoori Mon, 14 Dec 2009 14:55:31 +0200
libmaemosyncml (0.4.4-1) unstable; urgency=low
* Week 50 Release 2
* Fixed anchor handling in server initiated syncs
-- Srikanth Kavoori Tue, 8 Dec 2009 15:48:46 +0200
libmaemosyncml (0.4.4-0) unstable; urgency=low
* Week 50 Release
* Fixed hanging issue occurring when in OBEX server mode
* Fixed server initiated one-way syncs
* Fixes: NB#147760 - Unit test problems in CI environment
* Fixes: NB#146321 - Transfer of contacts and calendar fails from Switch UI
-- Srikanth Kavoori Mon, 7 Dec 2009 11:40:39 +0200
libmaemosyncml (0.4.3-0) unstable; urgency=low
* Week 49 Release
* Fixed not sending SyncML Status in response to received Results
-- Srikanth Kavoori Tue, 1 Dec 2009 10:31:46 +0200
libmaemosyncml (0.4.2-0) unstable; urgency=low
* Week 48 Release
* Fixes: NB#146324 - Synchronization fails with S40 devices
* Send MaxGUIDSize in DevInf in client mode
* Fixes: NB#145231 - Code review comments
-- Srikanth Kavoori Tue, 24 Nov 2009 16:32:35 +0200
libmaemosyncml (0.4.1-1) unstable; urgency=low
* Week 47 Release 2
-- Srikanth Kavoori Wed, 18 Nov 2009 15:19:51 +0200
libmaemosyncml (0.4.1-0) unstable; urgency=low
* Week 47 Release
* Fixes: NB#144679 - some major and moderate defects from sync
-- Srikanth Kavoori Mon, 16 Nov 2009 17:23:51 +0200
libmaemosyncml (0.4.0-0) unstable; urgency=low
* Week 46 Release
* Added Optimisation Flags
* Fixes: NB#145558 - Code review comments
* Dedicated CTCaps handling for both SyncML 1.1 and SyncML 1.2
* Database performance improvements
-- Srikanth Kavoori Tue, 10 Nov 2009 18:55:14 +0200
libmaemosyncml (0.3.9-0) unstable; urgency=low
* Week 45 Release 1
* Commit changes to local database in batches
-- Srikanth Kavoori Wed, 4 Nov 2009 12:22:46 +0200
libmaemosyncml (0.3.8-2) unstable; urgency=low
* Week 44 Release 2
-- Srikanth Kavoori Tue, 27 Oct 2009 17:27:13 +0200
libmaemosyncml (0.3.8-1) unstable; urgency=low
* Week 44 Release 1
* Added libmaemosyncml-tests package support to run unit tests during CI
-- Srikanth Kavoori Mon, 26 Oct 2009 18:31:42 +0200
libmaemosyncml (0.3.8-0) unstable; urgency=low
* Week 43 Release
* Direct wbxml encoding using libwbxml2
* Use libwbxml2 instead of xml2wbxml in wbxml conversions
-- Srikanth Kavoori Tue, 20 Oct 2009 17:26:42 +0300
libmaemosyncml (0.3.7-1) unstable; urgency=low
* Week 42 Release 2
* Item format specified under Item Meta now overrides ones specified under
Add/Replace Meta
* Removed BT service from libmaemosyncml as obsolete
-- Srikanth Kavoori Fri, 16 Oct 2009 17:58:17 +0300
libmaemosyncml (0.3.7-0) unstable; urgency=low
* Week 42 Release
* Accept "bin" encoding format as "b64"
* Fixed progress reporting of SyncAgent
-- Srikanth Kavoori Tue, 13 Oct 2009 18:32:56 +0300
libmaemosyncml (0.3.6-1) unstable; urgency=low
* Week 41 Release
* made coverage as an extra target
-- Srikanth Kavoori Mon, 5 Oct 2009 18:29:09 +0300
libmaemosyncml (0.3.6-0) unstable; urgency=low
* Removed debug package installation as the size exceeds the limit
-- Srikanth Kavoori Fri, 2 Oct 2009 11:48:09 +0300
libmaemosyncml (0.3.5-9) unstable; urgency=low
* Week 40 Release 2
* minor changes to session handler
-- Srikanth Kavoori Thu, 1 Oct 2009 18:38:52 +0300
libmaemosyncml (0.3.5-8) unstable; urgency=low
* Week 40 Release
-- Srikanth Kavoori Tue, 29 Sep 2009 17:53:52 +0300
libmaemosyncml (0.3.5-7) unstable; urgency=low
* Week 39 Release 2
-- Srikanth Kavoori Fri, 25 Sep 2009 08:14:26 +0300
libmaemosyncml (0.3.5-6) unstable; urgency=low
* Week 39 Release
* Code review fixes
-- Srikanth Kavoori Tue, 22 Sep 2009 17:43:00 +0300
libmaemosyncml (0.3.5-5) unstable; urgency=low
* Week 38 Release 2
* Changed retrieval of storages from as-supplied to on-demand
-- Srikanth Kavoori Thu, 17 Sep 2009 18:16:19 +0300
libmaemosyncml (0.3.5-4) unstable; urgency=low
* Week 38 Release
* Fixed OBEX transport not to crash in SB
* Optimized SyncML Delete command performance
* Fixed retrieval of item id from Replace/Delete when running in server mode
* Fixes: NB#133670 - No license information for the source files
-- Srikanth Kavoori Wed, 16 Sep 2009 11:46:35 +0300
libmaemosyncml (0.3.5-3) unstable; urgency=low
* week 37 Release 2
-- Srikanth Kavoori Thu, 10 Sep 2009 18:11:05 +0300
libmaemosyncml (0.3.5-2) unstable; urgency=low
* Week 37 Release
* Minor bugfixes to OBEX server operation
-- Lassi Nieminen Tue, 8 Sep 2009 17:35:31 +0300
libmaemosyncml (0.3.5-1) unstable; urgency=low
* Week 36 Release 2
* Last sync time now rounded to the next following second
-- Lassi Nieminen Thu, 3 Sep 2009 14:41:04 +0300
libmaemosyncml (0.3.5-0) unstable; urgency=low
* Week 36 Release
* Fixed issues with database opening warning
-- Lassi Nieminen Tue, 1 Sep 2009 17:12:10 +0300
libmaemosyncml (0.3.4-1) unstable; urgency=low
* Fixed issues in BT disconnect
* Cleaned up StoragePlugin and SyncItem APIs
-- Lassi Nieminen Thu, 27 Aug 2009 16:11:00 +0300
libmaemosyncml (0.3.4-0) unstable; urgency=low
* Week35 Release
-- Lassi Nieminen Tue, 25 Aug 2009 17:43:26 +0300
libmaemosyncml (0.3.3-0) unstable; urgency=low
* Week 34 release:
* Added Suspend/Resume feature
-- Lassi Nieminen Fri, 21 Aug 2009 09:27:11 +0300
libmaemosyncml (0.3.2-1) unstable; urgency=low
* Added MD5 authentication support for server and client
* Added server-side authentication
* Added sync without initialization phase
-- Lassi Nieminen Wed, 19 Aug 2009 18:24:38 +0300
libmaemosyncml (0.3.2-0) unstable; urgency=low
* Week33 release
* Device to Device Sync functionality is checked using 2 harmattan devices.
Note: This Cannot be done from existing UI though
* SyncAgent API Interface has been updated and a new API for setting
the authentication has been added
* BT sync issue with s60 fixed
* ID mapping tracking has been added to the code. yet to verify.
* Week 32 release
* Added device capability sending
* Added authentication challenge handling. MD5 and server side authentication not yet done.
-- Lassi Nieminen Wed, 19 Aug 2009 18:24:27 +0300
* Week 31 release. Fixes: NB#129610,NB#126685
* Removed:
transport/HTTPServerTransport.h
transport/HTTPServerTransport.cpp
-- Lassi Nieminen Thu, 30 Jul 2009 18:00:00 +0200
* Week 29 release
-- Lassi Nieminen Sat, 18 Jul 2009 17:59:50 +0200
* Week 28 release
-- Lassi Nieminen Tue, 08 Jul 2009 17:49:50 +0200
* Week 27 release
-- Lassi Nieminen Thu, 02 Jul 2009 17:49:50 +0200
libmaemosyncml (0.2.5-1) unstable; urgency=low
* Week 26 release
-- Lassi Nieminen Thu, 25 Jun 2009 15:49:50 +0200
libmaemosyncml (0.2.2-0) unstable; urgency=low
* Phase 2 Initial release (Closes: #nnnn)
-- Lassi Nieminen Mon, 1 Jun 2009 15:11:50 +0200
buteo-syncml-0.5.15/debian/compat000066400000000000000000000000021433763642500166600ustar00rootroot000000000000005
buteo-syncml-0.5.15/debian/control000066400000000000000000000027651433763642500170770ustar00rootroot00000000000000Source: libmeegosyncml
Priority: extra
Maintainer: Duggirala Karthik
Build-Depends: debhelper (>= 5),doxygen, cdbs ,libqt4-dev (>= 4.5), libwbxml2-dev, libsqlite3-dev, libopenobex1-dev, libqt4-sql-sqlite, sync-fw-dev
Standards-Version: 3.7.2
Section: libs
Package: libmeegosyncml
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-sql-sqlite (>= 4.5)
Replaces: libmaemosyncml
Conflicts: libmaemosyncml
Description: SyncML library for Harmattan sync.
Package holds SyncmL library for Harmattan sync.
Package: libmeegosyncml-dev
Section: libdevel
Architecture: any
Depends: libmeegosyncml (= ${binary:Version}), libqt4-dev (>= 4.5)
Replaces: libmaemosyncml-dev
Conflicts: libmaemosyncml-dev
Description: Header files for SyncML library for synchronization.
Package holds h-files for Harmattan SyncML.
Package: libmeegosyncml-dbg
Section: libs
Architecture: any
Depends: libmeegosyncml (= ${binary:Version})
Description: Debug symbols for libmeegosyncml.
Debug symbols for libmeegosyncml.
Package: libmeegosyncml-doc
Section: doc
Architecture: any
Description: API documentation for libmeegosyncml.
Empty documentation package for libmeegosyncml.
Package: libmeegosyncml-tests
Section: tests
Priority: optional
Architecture: any
Depends: ${shlibs:Depends},libmeegosyncml, testrunner-lite
XB-Maemo-CI-Stage: staging
XB-Maemo-CI-Packages: libmeegosyncml-tests
Description: Module test package for libmeegosyncml.
Module test package for libmeegosyncml.
buteo-syncml-0.5.15/debian/copyright000066400000000000000000000010521433763642500174130ustar00rootroot00000000000000This package was debianized by Tatu Lahtela on
Wed, 10 Dec 2008 13:53:12 +0200.
It was downloaded from
Upstream Author:
Copyright:
License:
The Debian packaging is (C) 2009, Tatu LahtelaLassi
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
buteo-syncml-0.5.15/debian/libmeegosyncml-dev.install000066400000000000000000000000741433763642500226400ustar00rootroot00000000000000usr/include/*
usr/lib/pkgconfig
usr/lib/libmeegosyncml.prl
buteo-syncml-0.5.15/debian/libmeegosyncml-doc.install000066400000000000000000000000201433763642500226160ustar00rootroot00000000000000usr/share/doc/*
buteo-syncml-0.5.15/debian/libmeegosyncml-tests.install000066400000000000000000000000531433763642500232210ustar00rootroot00000000000000usr/share/libmeegosyncml-tests/*
usr/bin/*
buteo-syncml-0.5.15/debian/libmeegosyncml.install000066400000000000000000000000551433763642500220630ustar00rootroot00000000000000usr/lib/lib*.so.*
usr/lib/lib*.so
etc/sync/*
buteo-syncml-0.5.15/debian/rules000077500000000000000000000077611433763642500165550ustar00rootroot00000000000000#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# # Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
QMAKE = /usr/bin/qmake -makefile libmeegosyncml.pro
CFLAGS += -Wall -Wextra -Wno-unused-parameter --strip-unneeded
CXXFLAGS += -Wall -Wextra -Wno-unused-parameter --strip-unneeded
comma :=,
empty :=
space := $(empty) $(empty)
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
TMP_BUILD_OPTS = $(subst $(comma),$(space),$(DEB_BUILD_OPTIONS))
ifneq (,$(filter parallel=%,$(TMP_BUILD_OPTS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(TMP_BUILD_OPTS)))
PARALLEL_MAKEFLAGS += -j$(NUMJOBS)
endif
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
/usr/bin/qmake -makefile libmeegosyncml.pro
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
$(MAKE) $(PARALLEL_MAKEFLAGS)
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
# $(MAKE) clean
[ ! -f Makefile ] || $(MAKE) distclean
rm -f Makefile src/Makefile
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
make $(PARALLEL_MAKEFLAGS) doc
INSTALL_ROOT=$(CURDIR)/debian/tmp make $(PARALLEL_MAKEFLAGS) install
# Add here commands to install the package into debian/tmp
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
#
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installdirs
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_install --sourcedir=debian/tmp -v
dh_installman
dh_strip --dbg-package=libmeegosyncml-dbg
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps ## TODO Disabled for now so the build succeeds
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
#!/usr/bin/make -f
#include /usr/share/cdbs/1/rules/debhelper.mk
#include /usr/share/cdbs/1/class/qmake.mk
#QMAKE = /usr/bin/qmake -makefile libmeegosyncml.pro
#CFLAGS += -Wall -Wextra -Wno-unused-parameter
#CXXFLAGS += -Wall -Wextra -Wno-unused-parameter
DEB_DESTDIR := $(CURDIR)/debian/tmp
#DEB_DH_INSTALL_SOURCEDIR := debian/tmp
buteo-syncml-0.5.15/doc/000077500000000000000000000000001433763642500150055ustar00rootroot00000000000000buteo-syncml-0.5.15/doc/Doxyfile000066400000000000000000000261551433763642500165240ustar00rootroot00000000000000# Doxyfile 1.5.6-KDevelop
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = buteo-syncml
PROJECT_NUMBER =
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.d \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.py \
*.f90 \
*.f \
*.vhd \
*.vhdl \
*.C \
*.CC \
*.C++ \
*.II \
*.I++ \
*.H \
*.HH \
*.H++ \
*.CS \
*.PHP \
*.PHP3 \
*.M \
*.MM \
*.PY \
*.F90 \
*.F \
*.VHD \
*.VHDL \
*.C \
*.H \
*.tlh \
*.diff \
*.patch \
*.moc \
*.xpm \
*.dox
RECURSIVE = yes
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
HHC_LOCATION =
QTHELP_FILE =
QTHELP_CONFIG =
DOXYGEN2QTHELP_LOC =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NONE
TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = no
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = buteo-syncml.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_FONTNAME = FreeSans
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
buteo-syncml-0.5.15/doc/coverage/000077500000000000000000000000001433763642500166005ustar00rootroot00000000000000buteo-syncml-0.5.15/doc/coverage/build_documentation.sh000077500000000000000000000032751433763642500231760ustar00rootroot00000000000000#!/bin/sh
#/*
#* This file is part of buteo-syncml package
#*
#* Copyright (C) 2010 Nokia Corporation. All rights reserved.
#*
#* Contact: Sateesh Kavuri
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions are met:
#*
#* Redistributions of source code must retain the above copyright notice,
#* this list of conditions and the following disclaimer.
#* Redistributions in binary form must reproduce the above copyright notice,
#* this list of conditions and the following disclaimer in the documentation
#* and/or other materials provided with the distribution.
#* Neither the name of Nokia Corporation nor the names of its contributors may
#* be used to endorse or promote products derived from this software without
#* specific prior written permission.
#*
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
#* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
#* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
#* THE POSSIBILITY OF SUCH DAMAGE.
#*
#*/
./coverage.sh
cd ..
doxygen Doxyfile
buteo-syncml-0.5.15/doc/coverage/coverage-html.sh000077500000000000000000000051521433763642500216770ustar00rootroot00000000000000#!/bin/sh
#/*
#* This file is part of buteo-syncml package
#*
#* Copyright (C) 2010 Nokia Corporation. All rights reserved.
#*
#* Contact: Sateesh Kavuri
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions are met:
#*
#* Redistributions of source code must retain the above copyright notice,
#* this list of conditions and the following disclaimer.
#* Redistributions in binary form must reproduce the above copyright notice,
#* this list of conditions and the following disclaimer in the documentation
#* and/or other materials provided with the distribution.
#* Neither the name of Nokia Corporation nor the names of its contributors may
#* be used to endorse or promote products derived from this software without
#* specific prior written permission.
#*
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
#* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
#* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
#* THE POSSIBILITY OF SUCH DAMAGE.
#*
#*/
#alias echo='echo -e'\E[31;40m
#check for the Makefile
#COVERAGE_LOG=/var/log/libmeegosyncml_coverage.log
#if [ -f $COVERAGE_LOG ]
#then
#rm -f $COVERAGE_LOG
#fi
WD=$PWD
STACKDIR=../../
cd $STACKDIR
if [ -f Makefile ];
then
echo "Makefile Exists.. Removing it and creating one"
find . -name Makefile | xargs rm -f
qmake
else
echo "Makefile does not exist .. Creating one... "
qmake
fi
#run the coverage script
echo "Running the coverage script .. "
sh $WD/coverage.sh
if [ $? -ne 0 ];
then
echo "Coverage Script Failed"
echo "Exiting the script"
exit 1
else
echo "Coverage Script ran successfully "
fi
echo "Running lcov"
lcov -d . -c -o doc/coverage/coverage.info
if [ $? -ne 0 ];
then
echo "Script Failed while using Lcov"
exit 1
else
echo "Lcov successfully Ran"
fi
cd doc/coverage
echo "Generating Documentation"
genhtml -o cov coverage.info
if [ $? -ne 0 ];
then
echo "Documentation Generation Failed"
exit 1
else
echo "Documentation Generation Successful"
fi
buteo-syncml-0.5.15/doc/coverage/coverage.sh000077500000000000000000000043441433763642500207370ustar00rootroot00000000000000#!/bin/sh
#/*
#* This file is part of buteo-syncml package
#*
#* Copyright (C) 2010 Nokia Corporation. All rights reserved.
#*
#* Contact: Sateesh Kavuri
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions are met:
#*
#* Redistributions of source code must retain the above copyright notice,
#* this list of conditions and the following disclaimer.
#* Redistributions in binary form must reproduce the above copyright notice,
#* this list of conditions and the following disclaimer in the documentation
#* and/or other materials provided with the distribution.
#* Neither the name of Nokia Corporation nor the names of its contributors may
#* be used to endorse or promote products derived from this software without
#* specific prior written permission.
#*
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
#* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
#* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
#* THE POSSIBILITY OF SUCH DAMAGE.
#*
#*/
export LD_LIBRARY_PATH=$PWD/meegosyncml
echo -e "PWD is $PWD"
cd meegosyncml
qmake
make clean
echo 'Building meegosyncml with coverage support'
make coverage
if [ $? -ne 0 ];
then
echo "meegosyncml build failed"
exit 1
else
echo "meegosyncml Built Successfully"
fi
cd ../Tests
qmake
make clean
echo 'Building Tests'
make
if [ $? -ne 0 ];
then
echo "Tests build failed"
exit 1
else
echo "Tests Built Successfully"
fi
echo 'Running Tests'
./Tests
if [ $? -ne 0 ];
then
echo "Ran Tests Successfully"
echo "Running Tests Failed"
exit 1
else
echo "Ran Tests Successfully"
exit 0
fi
buteo-syncml-0.5.15/doc/coverage/gcov_info.pl000077500000000000000000000056521433763642500211210ustar00rootroot00000000000000#!/usr/bin/perl
#/*
#* This file is part of buteo-syncml package
#*
#* Copyright (C) 2010 Nokia Corporation. All rights reserved.
#*
#* Contact: Sateesh Kavuri
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions are met:
#*
#* Redistributions of source code must retain the above copyright notice,
#* this list of conditions and the following disclaimer.
#* Redistributions in binary form must reproduce the above copyright notice,
#* this list of conditions and the following disclaimer in the documentation
#* and/or other materials provided with the distribution.
#* Neither the name of Nokia Corporation nor the names of its contributors may
#* be used to endorse or promote products derived from this software without
#* specific prior written permission.
#*
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
#* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
#* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
#* THE POSSIBILITY OF SUCH DAMAGE.
#*
#*/
# Author : Srikanth Kavoori
# Not Tested fully yet. There could be some issues.
# If you see any issues Let me know and i shall fix it :)
open(INPUTFILE, "<$ARGV[0]");
open(EXTRACTED_INFO,">$ARGV[2]");
$exclude_string = "/usr/include/";
$exclude_string2 = ".h";
$coverage_count_string ="Lines executed:";
$count = 0;
$filecount = 0;
$coverage_percent = 0;
while() {
my($line) = $_;
if ($count == 3) {
$count = 0;
}
if(/$exclude_string/ || /$exclude_string2/) {
#print "Found usr_include or header file on line $. \n" ;
$count ++;
}
if ($count == 0) {
# Print the line to the extracted_info and add a newline
print EXTRACTED_INFO "$line\n";
if(/$coverage_count_string/) {
$filecount ++;
$index = rindex($line,':') + 1;
$percent = substr($line,$index);
$perc_index = rindex($percent,'%');
$percent = substr($percent,0,$perc_index);
$coverage_percent += $percent;
}
} else {
#count should be 1 or 2 omit the line
$count ++;
}
}
if($filecount != 0 ) {
$coverage_percent=sprintf("%.2f",$coverage_percent/$filecount);
}
print "Total No. of files : $filecount Coverage Percent : $coverage_percent ";
open(PERCENTFILE,">$ARGV[1]");
print PERCENTFILE "$coverage_percent\n" ;
close(PERCENTFILE);
close(INPUTFILE);
close(EXTRACTED_INFO);
buteo-syncml-0.5.15/doc/coverage/run-tests-libmaemosyncml.sh000077500000000000000000000117001433763642500241130ustar00rootroot00000000000000#!/bin/bash
#/*
#* This file is part of buteo-syncml package
#*
#* Copyright (C) 2010 Nokia Corporation. All rights reserved.
#*
#* Contact: Sateesh Kavuri
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions are met:
#*
#* Redistributions of source code must retain the above copyright notice,
#* this list of conditions and the following disclaimer.
#* Redistributions in binary form must reproduce the above copyright notice,
#* this list of conditions and the following disclaimer in the documentation
#* and/or other materials provided with the distribution.
#* Neither the name of Nokia Corporation nor the names of its contributors may
#* be used to endorse or promote products derived from this software without
#* specific prior written permission.
#*
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
#* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
#* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
#* THE POSSIBILITY OF SUCH DAMAGE.
#*
#*/
#Author - Srikanth Kavoori
# This file should run unittests for libmaemosyncml
# and create the result file with unittest rate
# and coverage to this folder with name
# libmaemosyncml-results
#
# The release number should be in the file
# this script generates the results automatically
# for the latest weekXxX directory under libmaemosyncml
#this script updation should be rarely needed
#Script Specific Variables
TARGET=libmaemosyncml
WD=$PWD
if [ $# == 0 ];
then
echo "Enviroment is set to trunk "
ROOTDIR=$WD/../..
TESTS_DIR=$ROOTDIR/Tests
STACK_DIR=$ROOTDIR/maemosyncml
RESULTS_FILE=$WD/$TARGET-results
else
echo "Enviroment is set to tags"
WD=$1
TARGET_WEEK=$(ls -c $WD/../$TARGET | head -1)
TESTS_DIR=$WD/../$TARGET/$TARGET_WEEK/Tests
STACK_DIR=$WD/../$TARGET/$TARGET_WEEK/maemosyncml
RESULTS_DIR=$2
RESULTS_FILE=$RESULTS_DIR/$TARGET-results_$TARGET_WEEK
export SBOX_USE_CCACHE=no
ccache -c
fi
export LD_LIBRARY_PATH=$STACK_DIR:$LD_LIBRARY_PATH
TEMPFILE1=$WD/.temp_results
if [ -f $TEMPFILE1 ]
then
rm -f $TEMPFILE1
fi
TEMPFILE2=$WD/.gcov_info.txt
if [ -f $TEMPFILE2 ]
then
rm -f $TEMPFILE2
fi
TEMPFILE3=$WD/.percent
if [ -f $TEMPFILE3 ]
then
rm -f $TEMPFILE3
fi
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$STACK_DIR
echo "Running the unit tests for $TARGET..."
echo "Results will be stored in: $RESULTS_FILE ...."
#Build the library with coverage
echo "Building Stack in $STACK_DIR"
cd $STACK_DIR
qmake
make clean
make coverage
echo "tests directory is $TESTS_DIR"
cd $TESTS_DIR
qmake
make clean
make
echo "Running the tests in $PWD"
./libmaemosyncml-tests > $TEMPFILE1
echo "Getting the Coverage Results"
cd $STACK_DIR
echo $PWD
rm -f moc_*
file_list=$(ls *.gcno)
#echo "Printing File List :$file_list "
for file in $file_list
do
echo "Running gcov on $file"
gcov $file >> $TEMPFILE2
done
# get coverage information for the files using perl
echo "executing perl gcov_info.pl $TEMPFILE2 $TEMPFILE3"
GCOV_REPORT=$WD/gcov_report.txt
perl $WD/gcov_info.pl $TEMPFILE2 $TEMPFILE3 $GCOV_REPORT
if [ ! $? -eq 0 ]; then
# echo "Perl Script for gcov information exit normal"
#else
echo "Perl Script for gcov information Failed to execute ... Exiting ... "
exit 0
fi
SUMMARY_FILE=$WD/.summary_file
if [ -f $SUMMARY_FILE ]
then
rm -f $SUMMARY_FILE
fi
perl $WD/test_info.pl $TEMPFILE1 $SUMMARY_FILE
if [ ! $? -eq 0 ]; then
#echo "Perl Script for test information exit normal"
#else
echo "Perl Script for test information Failed to execute ... Exiting ... "
exit 0
fi
echo "Writing the file $RESULTS_FILE"
echo "#Results for $TARGET_WEEK " > $RESULTS_FILE
echo "Results Summary STARTED " >> $RESULTS_FILE
echo "#Current gcov reported coverage (line rate) is" >> $RESULTS_FILE
cat $TEMPFILE3 >> $RESULTS_FILE
echo "Unit test Results Summary " >> $RESULTS_FILE
cat $SUMMARY_FILE >> $RESULTS_FILE
echo "Results Summary ENDED " >> $RESULTS_FILE
echo "(all unit tests are not refactored yet)" >> $RESULTS_FILE
echo "#Coverage report is visible in $WD/gcov_report.txt" >> $RESULTS_FILE
echo "****************UNIT_TEST Results **************" >> $RESULTS_FILE
cat $TEMPFILE1 >> $RESULTS_FILE
rm -f $TEMPFILE1 $TEMPFILE2 $TEMPFILE3 $SUMMARY_FILE
cd $STACK_DIR
rm -f *.gcno *.gcda *.gcov
cd $WD
echo "$RESULTS_FILE created"
buteo-syncml-0.5.15/doc/coverage/run-tests-libmeegosyncml.sh000077500000000000000000000117001433763642500241110ustar00rootroot00000000000000#!/bin/bash
#/*
#* This file is part of buteo-syncml package
#*
#* Copyright (C) 2010 Nokia Corporation. All rights reserved.
#*
#* Contact: Sateesh Kavuri
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions are met:
#*
#* Redistributions of source code must retain the above copyright notice,
#* this list of conditions and the following disclaimer.
#* Redistributions in binary form must reproduce the above copyright notice,
#* this list of conditions and the following disclaimer in the documentation
#* and/or other materials provided with the distribution.
#* Neither the name of Nokia Corporation nor the names of its contributors may
#* be used to endorse or promote products derived from this software without
#* specific prior written permission.
#*
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
#* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
#* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
#* THE POSSIBILITY OF SUCH DAMAGE.
#*
#*/
#Author - Srikanth Kavoori
# This file should run unittests for libmeegosyncml
# and create the result file with unittest rate
# and coverage to this folder with name
# libmeegosyncml-results
#
# The release number should be in the file
# this script generates the results automatically
# for the latest weekXxX directory under libmeegosyncml
#this script updation should be rarely needed
#Script Specific Variables
TARGET=libmeegosyncml
WD=$PWD
if [ $# == 0 ];
then
echo "Enviroment is set to trunk "
ROOTDIR=$WD/../..
TESTS_DIR=$ROOTDIR/Tests
STACK_DIR=$ROOTDIR/meegosyncml
RESULTS_FILE=$WD/$TARGET-results
else
echo "Enviroment is set to tags"
WD=$1
TARGET_WEEK=$(ls -c $WD/../$TARGET | head -1)
TESTS_DIR=$WD/../$TARGET/$TARGET_WEEK/Tests
STACK_DIR=$WD/../$TARGET/$TARGET_WEEK/meegosyncml
RESULTS_DIR=$2
RESULTS_FILE=$RESULTS_DIR/$TARGET-results_$TARGET_WEEK
export SBOX_USE_CCACHE=no
ccache -c
fi
export LD_LIBRARY_PATH=$STACK_DIR:$LD_LIBRARY_PATH
TEMPFILE1=$WD/.temp_results
if [ -f $TEMPFILE1 ]
then
rm -f $TEMPFILE1
fi
TEMPFILE2=$WD/.gcov_info.txt
if [ -f $TEMPFILE2 ]
then
rm -f $TEMPFILE2
fi
TEMPFILE3=$WD/.percent
if [ -f $TEMPFILE3 ]
then
rm -f $TEMPFILE3
fi
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$STACK_DIR
echo "Running the unit tests for $TARGET..."
echo "Results will be stored in: $RESULTS_FILE ...."
#Build the library with coverage
echo "Building Stack in $STACK_DIR"
cd $STACK_DIR
qmake
make clean
make coverage
echo "tests directory is $TESTS_DIR"
cd $TESTS_DIR
qmake
make clean
make
echo "Running the tests in $PWD"
./libmeegosyncml-tests > $TEMPFILE1
echo "Getting the Coverage Results"
cd $STACK_DIR
echo $PWD
rm -f moc_*
file_list=$(ls *.gcno)
#echo "Printing File List :$file_list "
for file in $file_list
do
echo "Running gcov on $file"
gcov $file >> $TEMPFILE2
done
# get coverage information for the files using perl
echo "executing perl gcov_info.pl $TEMPFILE2 $TEMPFILE3"
GCOV_REPORT=$WD/gcov_report.txt
perl $WD/gcov_info.pl $TEMPFILE2 $TEMPFILE3 $GCOV_REPORT
if [ ! $? -eq 0 ]; then
# echo "Perl Script for gcov information exit normal"
#else
echo "Perl Script for gcov information Failed to execute ... Exiting ... "
exit 0
fi
SUMMARY_FILE=$WD/.summary_file
if [ -f $SUMMARY_FILE ]
then
rm -f $SUMMARY_FILE
fi
perl $WD/test_info.pl $TEMPFILE1 $SUMMARY_FILE
if [ ! $? -eq 0 ]; then
#echo "Perl Script for test information exit normal"
#else
echo "Perl Script for test information Failed to execute ... Exiting ... "
exit 0
fi
echo "Writing the file $RESULTS_FILE"
echo "#Results for $TARGET_WEEK " > $RESULTS_FILE
echo "Results Summary STARTED " >> $RESULTS_FILE
echo "#Current gcov reported coverage (line rate) is" >> $RESULTS_FILE
cat $TEMPFILE3 >> $RESULTS_FILE
echo "Unit test Results Summary " >> $RESULTS_FILE
cat $SUMMARY_FILE >> $RESULTS_FILE
echo "Results Summary ENDED " >> $RESULTS_FILE
echo "(all unit tests are not refactored yet)" >> $RESULTS_FILE
echo "#Coverage report is visible in $WD/gcov_report.txt" >> $RESULTS_FILE
echo "****************UNIT_TEST Results **************" >> $RESULTS_FILE
cat $TEMPFILE1 >> $RESULTS_FILE
rm -f $TEMPFILE1 $TEMPFILE2 $TEMPFILE3 $SUMMARY_FILE
cd $STACK_DIR
rm -f *.gcno *.gcda *.gcov
cd $WD
echo "$RESULTS_FILE created"
buteo-syncml-0.5.15/doc/coverage/test_info.pl000077500000000000000000000066051433763642500211410ustar00rootroot00000000000000#!/usr/bin/perl
#/*
#* This file is part of buteo-syncml package
#*
#* Copyright (C) 2010 Nokia Corporation. All rights reserved.
#*
#* Contact: Sateesh Kavuri
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions are met:
#*
#* Redistributions of source code must retain the above copyright notice,
#* this list of conditions and the following disclaimer.
#* Redistributions in binary form must reproduce the above copyright notice,
#* this list of conditions and the following disclaimer in the documentation
#* and/or other materials provided with the distribution.
#* Neither the name of Nokia Corporation nor the names of its contributors may
#* be used to endorse or promote products derived from this software without
#* specific prior written permission.
#*
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
#* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
#* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
#* THE POSSIBILITY OF SUCH DAMAGE.
#*
#*/
# Author : Srikanth Kavoori
# Not Tested fully yet. There could be some issues.
# If you see any issues Let me know and i shall fix it :)
open(INPUTFILE, "<$ARGV[0]");
# Totals: 0 passed, 2 failed, 0 skipped
$tests_string = "Totals:";
$pass_count = 0;
$fail_count = 0;
$skip_count = 0;
$total_count = 0;
while() {
my($line) = $_;
if(/$tests_string/) {
#print $line;
#print "Found usr_include or header file on line $. \n" ;
$pass_start_index = rindex($line,':') + 1;
$passed_index = rindex($line,"passed") - 1;
$length = $passed_index - $start_index;
$pass_count += substr($line,$pass_start_index,$length);
#print "pass_count $pass_count ";
$fail_start_index = rindex($line,'passed,') + 8;
$failed_index = rindex($line,"failed") - 1;
$length = $failed_index - $fail_start_index;
$fail_count += substr($line,$fail_start_index,$length);
#print "fail_count $fail_count ";
$skip_start_index = rindex($line,'failed,') + 8;
$skipped_index = rindex($line,"skipped") - 1;
$length = $failed_index - $skip_start_index;
$skip_count += substr($line,$skip_start_index,$length);
#print "skip_count $skip_count \n";
}
}
#if($filecount != 0 ) {
# $coverage_percent=sprintf("%.2f",$coverage_percent/$filecount);
#}
$total_count += $pass_count + $fail_count + $skip_count;
print "Total No. TESTS: $total_count \n";
print "Passed: $pass_count \n";
print "Failed: $fail_count \n";
print "Skipped: $skip_count \n";
open(SUMMARY_FILE,">$ARGV[1]");
print SUMMARY_FILE "" ;
print SUMMARY_FILE "Total TESTS: $total_count \n";
print SUMMARY_FILE "Passed: $pass_count \n";
print SUMMARY_FILE "Failed: $fail_count \n";
print SUMMARY_FILE "Skipped: $skip_count \n";
close(SUMMARY_FILE);
close(INPUTFILE);
buteo-syncml-0.5.15/doc/doc.pri000066400000000000000000000005741433763642500162740ustar00rootroot00000000000000DOXYGEN_BIN = $$system(command -v doxygen)
isEmpty(DOXYGEN_BIN):error("Unable to detect doxygen in PATH")
doc.CONFIG = phony
doc.commands = cd $${PWD} && $${DOXYGEN_BIN} Doxyfile
QMAKE_EXTRA_TARGETS += doc
QMAKE_CLEAN += $${PWD}/html/* $${PWD}/buteo-syncml.tag
# Install rules
htmldocs.files = $${PWD}/html/
htmldocs.path = /usr/share/doc/buteo-syncml-doc/
INSTALLS += htmldocs
buteo-syncml-0.5.15/libbuteosyncml.pro000066400000000000000000000003211433763642500200110ustar00rootroot00000000000000include(doc/doc.pri)
CONFIG += ordered \
qt \
thread
# Directories
SUBDIRS += src \
tests_meego
QT += core
# Make sure gui is not enabled.
QT -= gui
QTDIR = /usr/lib/qt4
TEMPLATE = subdirs
buteo-syncml-0.5.15/rpm/000077500000000000000000000000001433763642500150365ustar00rootroot00000000000000buteo-syncml-0.5.15/rpm/buteo-syncml-qt5.spec000066400000000000000000000025001433763642500210370ustar00rootroot00000000000000Name: buteo-syncml-qt5
Version: 0.5.13
Release: 1
Summary: SyncML library for MeeGo sync
License: LGPLv2+
URL: https://git.sailfishos.org/mer-core/buteo-syncml
Source0: %{name}-%{version}.tar.gz
BuildRequires: doxygen
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5XmlPatterns)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(Qt5Sql)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(libwbxml2) >= 0.11.6
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(openobex)
BuildRequires: pkgconfig(buteosyncfw5) >= 0.6.24
%description
%{summary}.
%files
%defattr(-,root,root,-)
%config %{_sysconfdir}/buteo/*.xsd
%config %{_sysconfdir}/buteo/*.xml
%{_libdir}/*.so.*
%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
%description devel
%{summary}.
%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/*.prl
%{_libdir}/pkgconfig/*.pc
%package tests
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
%description tests
%{summary}.
%files tests
%defattr(-,root,root,-)
/opt/tests/%{name}/*
%prep
%setup -q
%build
%qmake5 "VERSION=%{version}" -recursive libbuteosyncml.pro
make %{?_smp_mflags}
%install
make INSTALL_ROOT=%{buildroot} install
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
buteo-syncml-0.5.15/rpm/buteo-syncml.changes000066400000000000000000000023531433763642500210140ustar00rootroot00000000000000* Mon Sep 24 2012 Bernd Wachter - 0.5.0
- Update to nemo upstream, contributing to JB#2310
* Thu Sep 06 2012 Bernd Wachter - 0.4.18
- Update to latest upstream
- Move tests to /opt/tests
* Mon Jan 31 2011 Bernd Wachter - 0.4.10.7
- Update version, fixing BMC#13137
* Wed Jan 05 2011 Bernd Wachter - 0.4.10.2
- Update version, fixing BMC#11996
* Fri Dec 17 2010 Bernd Wachter - 0.4.9.52
- Update version, fixing BMC#11096
* Wed Nov 24 2010 Bernd Wachter - 0.4.9.47
- Update version, required for buteo-sync-plugins fixes from BME#3888
* Sun Oct 17 2010 Bernd Wachter - 0.4.9.38
- Update to latest version
* Thu Sep 23 2010 Bernd Wachter - 0.4.9.35
- Update version, fixing BMC#6136
* Tue Aug 24 2010 Bernd Wachter - 0.4.9.28
- Update to latest version
- Change BuildRequires to pkgconfig
* Mon Jun 28 2010 Bernd Wachter - 0.4.9
- Update to latest version
* Fri Jun 18 2010 Bernd Wachter - 0.4.6
- Initial RPM versionbuteo-syncml-0.5.15/src/000077500000000000000000000000001433763642500150275ustar00rootroot00000000000000buteo-syncml-0.5.15/src/AlertPackage.cpp000066400000000000000000000076011433763642500200620ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "AlertPackage.h"
#include "SyncMLMessage.h"
#include "SyncMLAlert.h"
#include "SyncTarget.h"
#include "SyncMode.h"
#include "SyncMLLogging.h"
using namespace DataSync;
AlertPackage::AlertPackage( qint32 aAlertCode )
: iParams( CommandParams::COMMAND_ALERT)
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
iParams.data = QString::number( aAlertCode );
}
AlertPackage::AlertPackage( qint32 aAlertCode, const QString& aSourceDatabase, const QString& aTargetDatabase )
: iParams( CommandParams::COMMAND_ALERT )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
iParams.data = QString::number( aAlertCode );
ItemParams item;
item.source = aSourceDatabase;
item.target = aTargetDatabase;
iParams.items.append(item);
}
AlertPackage::AlertPackage( qint32 aAlertCode, const QString& aSourceDatabase, const QString& aTargetDatabase,
const QString& aLocalLastAnchor, const QString& aLocalNextAnchor )
: iParams( CommandParams::COMMAND_ALERT )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
iParams.data = QString::number( aAlertCode );
ItemParams item;
item.source = aSourceDatabase;
item.target = aTargetDatabase;
item.meta.anchor.last = aLocalLastAnchor;
item.meta.anchor.next = aLocalNextAnchor;
iParams.items.append(item);
// This is needed for S60, do NOT remove
// @todo: should this be here, or in session handling??
if( iParams.items.first().meta.anchor.last.isEmpty() ) {
iParams.items.first().meta.anchor.last = '0';
}
}
AlertPackage::AlertPackage( const QString& aSourceDatabase, const QString& aMIMEType, qint32 aAlertCode )
: iParams( CommandParams::COMMAND_ALERT )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
iParams.data = QString::number( aAlertCode );
ItemParams item;
item.source = aSourceDatabase;
item.meta.type = aMIMEType;
iParams.items.append(item);
}
AlertPackage::~AlertPackage()
{
}
bool AlertPackage::write( SyncMLMessage& aMessage, int& aSizeThreshold, bool aWBXML, const ProtocolVersion& aVersion )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
iParams.cmdId = aMessage.getNextCmdId();
SyncMLAlert* alertObject = new SyncMLAlert( iParams );
aMessage.addToBody( alertObject );
aSizeThreshold -= alertObject->calculateSize(aWBXML, aVersion);
return true;
}
buteo-syncml-0.5.15/src/AlertPackage.h000066400000000000000000000073721433763642500175340ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef ALERTPACKAGE_H
#define ALERTPACKAGE_H
#include "Package.h"
#include "Fragments.h"
class AlertPackageTest;
namespace DataSync {
class SyncTarget;
class SyncMode;
/*! \brief Handles sending an Alert to remote side
*
*/
class AlertPackage : public Package
{
Q_OBJECT;
public:
/*! \brief Constructor for Alerts that include only the alert code
*
*/
AlertPackage( qint32 aAlertCode );
/*! \brief Constructor for Alert that includes source and target databases
*
* This should be used for example which Alerts related to suspend & resume and
* requesting next messages
*
* @param aAlertCode Code of this Alert
* @param aSourceDatabase Source database
* @param aTargetDatabase Target database
*/
AlertPackage( qint32 aAlertCode, const QString& aSourceDatabase, const QString& aTargetDatabase );
/*! \brief Constructor for Alert that includes source/target databases and anchor information
*
* This should be used for Alerts related to sync modes
*
* @param aAlertCode Code of this Alert
* @param aSourceDatabase Source database
* @param aTargetDatabase Target database
* @param aLocalLastAnchor Local last anchor
* @param aLocalNextAnchor Local next anchor
*/
AlertPackage( qint32 aAlertCode, const QString& aSourceDatabase, const QString& aTargetDatabase,
const QString& aLocalLastAnchor, const QString& aLocalNextAnchor );
/*! \brief Constructor for Alert that includes source database and MIME type
*
* This should be used for Alerts related to server initiated sync
*
* @param aSourceDatabase Source database
* @param aMIMEType MIME type
* @param aAlertCode Code of this Alert
*/
AlertPackage( const QString& aSourceDatabase, const QString& aMIMEType, qint32 aAlertCode );
/*! \brief Destructor
*
*/
virtual ~AlertPackage();
virtual bool write( SyncMLMessage& aMessage, int& aSizeThreshold, bool aWBXML, const ProtocolVersion& aVersion);
protected:
private:
CommandParams iParams;
friend class ::AlertPackageTest;
};
}
#endif // ALERTPACKAGE_H
buteo-syncml-0.5.15/src/AuthHelper.cpp000066400000000000000000000054661433763642500176070ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "AuthHelper.h"
#include
#include "SyncMLLogging.h"
using namespace DataSync;
AuthHelper::AuthHelper()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
AuthHelper::~AuthHelper()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
QByteArray AuthHelper::encodeBasicB64Auth( const QString& aUsername, const QString& aPassword ) const
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
QByteArray in;
in.append( aUsername );
in.append( ':' );
in.append( aPassword );
return in.toBase64();
}
QByteArray AuthHelper::encodeMD5Auth( const QString& aUsername, const QString& aPassword,
const QString& aNonce ) const
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
QByteArray in;
in.append( aUsername.toUtf8() );
in.append( ':' );
in.append( aPassword.toUtf8() );
QByteArray tmp = toMD5( in );
tmp = tmp.toBase64();
tmp.append( ':' );
tmp.append( aNonce.toUtf8() );
return toMD5( tmp );
}
QByteArray AuthHelper::toMD5( const QByteArray& aString ) const
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
QCryptographicHash md5Hash( QCryptographicHash::Md5 );
md5Hash.addData( aString );
return md5Hash.result();
}
buteo-syncml-0.5.15/src/AuthHelper.h000066400000000000000000000054731433763642500172520ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef AUTHHELPER_H
#define AUTHHELPER_H
#include
namespace DataSync {
/*! \brief Utility class that is able to encode and decode SyncML basic and
* md5 authentication
*/
class AuthHelper {
public:
/*! \brief Constructor
*
*/
AuthHelper();
/*! \brief Destructor
*
*/
virtual ~AuthHelper();
/*! \brief Encode SyncML basic base64-encoded authentication
*
* @param aUsername Username
* @param aPassword Password
* @return Encoded data
*/
QByteArray encodeBasicB64Auth( const QString& aUsername, const QString& aPassword ) const;
/*! \brief Encode SyncML md5 authentication
*
* Note that this function does not automatically base64-encode the data, so it must be done
* separately if the information is passed through clear-text protocol like XML
*
* @param aUsername Username
* @param aPassword Password
* @param aNonce Nonce to use
* @return Encoded data
*/
QByteArray encodeMD5Auth( const QString& aUsername, const QString& aPassword, const QString& aNonce ) const;
protected:
private:
QByteArray toMD5( const QByteArray& aString ) const;
};
}
#endif // AUTHHELPER_H
buteo-syncml-0.5.15/src/AuthenticationPackage.cpp000066400000000000000000000063641433763642500217770ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "AuthenticationPackage.h"
#include "SyncMLCred.h"
#include "SyncMLMessage.h"
#include "AuthHelper.h"
#include "datatypes.h"
#include "SyncMLLogging.h"
using namespace DataSync;
AuthenticationPackage::AuthenticationPackage( const AuthType& aAuthType,
const QString& aUsername,
const QString& aPassword,
const QByteArray& aNonce )
: iAuthType( aAuthType ), iUsername( aUsername ), iPassword( aPassword ),
iNonce( aNonce )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
AuthenticationPackage::~AuthenticationPackage()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
bool AuthenticationPackage::write( SyncMLMessage& aMessage, int& aSizeThreshold, bool aWBXML, const ProtocolVersion& aVersion )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
SyncMLCred* cred = NULL;
AuthHelper helper;
if( iAuthType == AUTH_BASIC )
{
QByteArray data = helper.encodeBasicB64Auth( iUsername, iPassword );
cred = new SyncMLCred( SYNCML_FORMAT_ENCODING_B64, SYNCML_FORMAT_AUTH_BASIC, data );
}
else if( iAuthType == AUTH_MD5 )
{
QByteArray data = helper.encodeMD5Auth( iUsername, iPassword, iNonce );
// @todo: wouldn't necessarily have to B64-encode over WbXML
data = data.toBase64();
cred = new SyncMLCred( SYNCML_FORMAT_ENCODING_B64, SYNCML_FORMAT_AUTH_MD5, data );
}
else
{
Q_ASSERT( 0 );
}
if(cred) {
aMessage.addToHeader( cred );
aSizeThreshold -= cred->calculateSize(aWBXML, aVersion);
}
return true;
}
buteo-syncml-0.5.15/src/AuthenticationPackage.h000066400000000000000000000053311433763642500214350ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef AUTHENTICATIONPACKAGE_H
#define AUTHENTICATIONPACKAGE_H
#include "Package.h"
#include "SyncAgentConsts.h"
class AuthenticationPackageTest;
namespace DataSync {
/*! \brief Handles sync initialization phase authentication
*/
class AuthenticationPackage : public Package
{
Q_OBJECT
public:
/*! \brief Constructor
*
* @param aAuthType Type of authentication to use (either BASIC or MD5)
* @param aUsername Username to use (BASIC and MD5)
* @param aPassword Password to use (BASIC and MD5)
* @param aNonce Nonce to use (MD5)
*/
AuthenticationPackage( const AuthType& aAuthType, const QString& aUsername, const QString& aPassword, const QByteArray& aNonce = "" );
/*! \brief Destructor
*
*/
virtual ~AuthenticationPackage();
virtual bool write( SyncMLMessage& aMessage, int& aSizeThreshold, bool aWBXML, const ProtocolVersion& aVersion );
protected:
private:
AuthType iAuthType;
QString iUsername;
QString iPassword;
QByteArray iNonce;
friend class ::AuthenticationPackageTest;
};
}
#endif // AUTHENTICATIONPACKAGE_H
buteo-syncml-0.5.15/src/CTCap.cpp000066400000000000000000000037521433763642500164740ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "CTCap.h"
using namespace DataSync;
CTCap::CTCap()
{
}
CTCap::~CTCap()
{
}
void CTCap::setFormat( const ContentFormat& aFormat )
{
iFormat = aFormat;
}
const ContentFormat& CTCap::getFormat() const
{
return iFormat;
}
const QList& CTCap::properties() const
{
return iProperties;
}
QList& CTCap::properties()
{
return iProperties;
}
buteo-syncml-0.5.15/src/CTCap.h000066400000000000000000000072571433763642500161450ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef CTCAPS_H
#define CTCAPS_H
#include
#include
#include "StorageContentFormatInfo.h"
namespace DataSync {
/*! \brief Parameter of a property
*
*/
struct CTCapParameter
{
QString iName; /*!< Name of the parameter*/
QString iType; /*!< Type of the parameter*/
QString iDisplayName; /*!< Human-readable name of the parameter*/
QList iValues; /*!< Allowed values for the parameter*/
};
/*! \brief CTCap property
*
*/
struct CTCapProperty
{
QString iName; /*!< Name of the property*/
QString iType; /*!< Type of the property*/
int iMaxOccur; /*!< Maximum number of times this property can occur*/
int iSize; /*!< Maximum size of the property*/
bool iNoTruncate; /*!< Specifies whether this property can be truncated*/
QString iDisplayName; /*!< Human-readable name of the property*/
QList iValues; /*!< Allowed values for the property*/
QList iParameters; /*!< Parameters of the property*/
CTCapProperty() : iMaxOccur( -1 ), iSize( -1 ), iNoTruncate( false ) { }
};
/*! \brief Describes single content format and its properties
*
*/
class CTCap
{
public:
/*! \brief Constructor
*
*/
CTCap();
/*! \brief Destructor
*
*/
~CTCap();
/*! \brief Set content format
*
* @param aFormat Content format
*/
void setFormat( const ContentFormat& aFormat );
/*! \brief Returns content format
*
* @return
*/
const ContentFormat& getFormat() const;
/*! \brief Returns properties
*
* @return
*/
const QList& properties() const;
/*! \brief Returns properties
*
* @return
*/
QList& properties();
private:
ContentFormat iFormat; /*!< Format*/
QList iProperties; /*!< Properties*/
};
}
#endif // CTCAPS_H
buteo-syncml-0.5.15/src/ChangeLog.cpp000066400000000000000000000351551433763642500173730ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "ChangeLog.h"
#include
#include "SyncMLLogging.h"
using namespace DataSync;
ChangeLog::ChangeLog( const QString& aRemoteDevice, const QString& aSourceDbURI,
SyncDirection aSyncDirection )
: iRemoteDevice( aRemoteDevice ), iSourceDbURI( aSourceDbURI ), iSyncDirection( aSyncDirection )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
ChangeLog::~ChangeLog()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
bool ChangeLog::load( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
qCDebug(lcSyncML) << "Loading changelog information:";
qCDebug(lcSyncML) << "Remote device:" << iRemoteDevice;
qCDebug(lcSyncML) << "Database URI:" << iSourceDbURI;
qCDebug(lcSyncML) << "Sync direction:" << iSyncDirection;
return ( loadAnchors( aDbHandle ) && loadMaps( aDbHandle ) );
}
bool ChangeLog::load( const QString& aDbName )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool success = false;
QString connectionName = generateConnectionName();
QSqlDatabase database = QSqlDatabase::addDatabase( "QSQLITE", connectionName );
database.setDatabaseName( aDbName );
if( database.open() )
{
success = load( database );
database.close();
}
else
{
qCCritical(lcSyncML) << "Could not open database!";
}
database = QSqlDatabase();
QSqlDatabase::removeDatabase( connectionName );
return success;
}
bool ChangeLog::save( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
qCDebug(lcSyncML) << "Saving changelog information:";
qCDebug(lcSyncML) << "Remote device:" << iRemoteDevice;
qCDebug(lcSyncML) << "Database URI:" << iSourceDbURI;
qCDebug(lcSyncML) << "Sync direction:" << iSyncDirection;
if( !ensureAnchorDatabase( aDbHandle ) || !ensureMapsDatabase( aDbHandle ) )
{
return false;
}
bool transaction = aDbHandle.transaction();
bool success = ( saveAnchors( aDbHandle ) && saveMaps( aDbHandle ) );
if( transaction && ( !success || !aDbHandle.commit() ) ) {
success = false;
aDbHandle.rollback();
}
return success;
}
bool ChangeLog::save( const QString& aDbName )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool success = false;
QString connectionName = generateConnectionName();
QSqlDatabase database = QSqlDatabase::addDatabase( "QSQLITE", connectionName );
database.setDatabaseName( aDbName );
if( database.open() )
{
success = save( database );
database.close();
}
else
{
qCCritical(lcSyncML) << "Could not open database!";
}
database = QSqlDatabase();
QSqlDatabase::removeDatabase( connectionName );
return success;
}
bool ChangeLog::remove( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
qCDebug(lcSyncML) << "Removing changelog information:";
qCDebug(lcSyncML) << "Remote device:" << iRemoteDevice;
qCDebug(lcSyncML) << "Database URI:" << iSourceDbURI;
qCDebug(lcSyncML) << "Sync direction:" << iSyncDirection;
return ( removeAnchors( aDbHandle ) && removeMaps( aDbHandle ) );
}
bool ChangeLog::remove( const QString& aDbName )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool success = false;
QString connectionName = generateConnectionName();
QSqlDatabase database = QSqlDatabase::addDatabase( "QSQLITE", connectionName );
database.setDatabaseName( aDbName );
if( database.open() )
{
success = remove( database );
database.close();
}
else
{
qCCritical(lcSyncML) << "Could not open database!";
}
database = QSqlDatabase();
QSqlDatabase::removeDatabase( connectionName );
return success;
}
const QString& ChangeLog::getLastLocalAnchor() const
{
return iLastLocalAnchor;
}
void ChangeLog::setLastLocalAnchor( const QString& aLastLocalAnchor )
{
iLastLocalAnchor = aLastLocalAnchor;
}
const QString& ChangeLog::getLastRemoteAnchor() const
{
return iLastRemoteAnchor;
}
void ChangeLog::setLastRemoteAnchor( const QString& aLastRemoteAnchor )
{
iLastRemoteAnchor = aLastRemoteAnchor;
}
const QDateTime& ChangeLog::getLastSyncTime() const
{
return iLastSyncTime;
}
void ChangeLog::setLastSyncTime( const QDateTime& aLastSyncTime )
{
iLastSyncTime = aLastSyncTime;
}
const QList& ChangeLog::getMaps() const
{
return iMaps;
}
void ChangeLog::setMaps( const QList& aMaps )
{
iMaps = aMaps;
}
QString ChangeLog::generateConnectionName()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
const QString CONNECTIONNAME( "changelog" );
static unsigned connectionNumber = 0;
return CONNECTIONNAME + QString::number( connectionNumber++ );
}
bool ChangeLog::ensureAnchorDatabase( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
const QString queryString( "CREATE TABLE if not exists change_logs(id integer primary key autoincrement, remote_device varchar(512), source_db_uri varchar(512), sync_direction INTEGER, local_sync_anchor varchar(128), remote_sync_anchor varchar(128), last_sync_time timestamp)" );
QSqlQuery query( queryString, aDbHandle );
if( query.exec() ) {
return true;
}
else {
qCCritical(lcSyncML) << "Could not ensure anchor database table:" << query.lastError();
return false;
}
}
bool ChangeLog::ensureMapsDatabase( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
const QString queryString( "CREATE TABLE IF NOT EXISTS id_maps(id integer primary key autoincrement, remote_device varchar(512), source_db_uri varchar(512), sync_direction INTEGER, local_id varchar(128), remote_id varchar(128))" );
QSqlQuery query( queryString, aDbHandle );
if( query.exec() ) {
return true;
}
else {
qCCritical(lcSyncML) << "Could not ensure ID maps database table:" << query.lastError();
return false;
}
}
bool ChangeLog::loadAnchors( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool loaded = false;
const QString queryString( "SELECT local_sync_anchor, remote_sync_anchor, last_sync_time FROM change_logs WHERE remote_device = :remote_device AND source_db_uri = :source_db_uri AND sync_direction = :sync_direction" );
QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
if( query.exec() ) {
if( query.next() ) {
iLastLocalAnchor = query.value(0).toString();
iLastRemoteAnchor = query.value(1).toString();
iLastSyncTime = query.value(2).toDateTime();
qCDebug(lcSyncML) << "Found anchor information:";
qCDebug(lcSyncML) << "Last local anchor:" << iLastLocalAnchor;
qCDebug(lcSyncML) << "Last remote anchor:" << iLastRemoteAnchor;
qCDebug(lcSyncML) << "Sync session end time:" << iLastSyncTime;
loaded = true;
}
else {
qCDebug(lcSyncML) << "No existing anchor entry found from database, creating new";
}
}
else {
qCWarning(lcSyncML) << "Could not load anchors:" << query.lastError();
}
return loaded;
}
bool ChangeLog::saveAnchors( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool success = false;
if( removeAnchors( aDbHandle ) ) {
const QString queryString( "INSERT INTO change_logs(remote_device, source_db_uri, sync_direction, local_sync_anchor, remote_sync_anchor, last_sync_time) VALUES (:remote_device, :source_db_uri, :sync_direction, :local_sync_anchor, :remote_sync_anchor, :last_sync_time)" );
QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
query.bindValue( ":local_sync_anchor", iLastLocalAnchor );
query.bindValue( ":remote_sync_anchor", iLastRemoteAnchor );
query.bindValue( ":last_sync_time", iLastSyncTime );
if( query.exec() ) {
qCDebug(lcSyncML) << "Anchor information saved:";
qCDebug(lcSyncML) << "Last local anchor:" << iLastLocalAnchor;
qCDebug(lcSyncML) << "Last remote anchor:" << iLastRemoteAnchor;
qCDebug(lcSyncML) << "Sync session end time:" << iLastSyncTime;
success = true;
}
else {
qCCritical(lcSyncML) << "Could not save anchors:" << query.lastError();
}
}
else {
qCCritical(lcSyncML) << "Could not save anchors as database cleaning failed";
}
return success;
}
bool ChangeLog::removeAnchors( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool success = false;
QStringList tables = aDbHandle.tables();
if( !tables.contains("change_logs") ) {
qCDebug(lcSyncML) << "Change logs table not present. Considering anchors as removed";
success = true;
}
else {
const QString queryString( "DELETE FROM change_logs WHERE remote_device = :remote_device AND source_db_uri = :source_db_uri AND sync_direction = :sync_direction" );
QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
if( query.exec() ) {
success = true;
}
else {
qCWarning(lcSyncML) << "Could not remove anchors:" << query.lastError();
}
}
return success;
}
bool ChangeLog::loadMaps( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool loaded = false;
const QString queryString("SELECT local_id, remote_id FROM id_maps WHERE remote_device = :remote_device AND source_db_uri = :source_db_uri AND sync_direction = :sync_direction" );
QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
if( query.exec() )
{
iMaps.clear();
while( query.next() )
{
UIDMapping mapping;
mapping.iLocalUID = query.value(0).toString();
mapping.iRemoteUID = query.value(1).toString();
iMaps.append( mapping );
}
loaded = true;
}
else
{
qCCritical(lcSyncML) << "Could not load ID maps:" << query.lastError();
}
return loaded;
}
bool ChangeLog::saveMaps( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool success = false;
if( removeMaps( aDbHandle ) )
{
const QString queryString( "INSERT INTO id_maps(remote_device, source_db_uri, sync_direction, local_id, remote_id) values(:remote_device, :source_db_uri, :sync_direction, :local_id, :remote_id)" );
QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
QVariantList device;
QVariantList sourceDbURI;
QVariantList syncDirection;
QVariantList localId;
QVariantList remoteId;
for( int i = 0; i < iMaps.count(); ++i ) {
device << iRemoteDevice;
sourceDbURI << iSourceDbURI;
syncDirection << iSyncDirection;
localId << iMaps[i].iLocalUID;
remoteId << iMaps[i].iRemoteUID;
}
query.addBindValue( device );
query.addBindValue( sourceDbURI );
query.addBindValue( syncDirection );
query.addBindValue( localId );
query.addBindValue( remoteId );
if( query.execBatch() ) {
qCDebug(lcSyncML) << "ID maps information saved";
success = true;
}
else {
qCWarning(lcSyncML) << "Query failed: " << query.lastError();
}
}
else
{
qCCritical(lcSyncML) << "Could not save ID maps as database cleaning failed";
}
return success;
}
bool ChangeLog::removeMaps( QSqlDatabase& aDbHandle )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool success = false;
QStringList tables = aDbHandle.tables();
if( !tables.contains("id_maps") ) {
qCDebug(lcSyncML) << "id maps table not present";
success = true;
}
else {
const QString queryString( "DELETE FROM id_maps WHERE remote_device = :remote_device AND source_db_uri = :source_db_uri AND sync_direction = :sync_direction" );
QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
if( query.exec() ) {
success = true;
}
else {
qCWarning(lcSyncML) << "Could not remove ID maps:" << query.lastError();
}
}
return success;
}
buteo-syncml-0.5.15/src/ChangeLog.h000066400000000000000000000132301433763642500170260ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef CHANGELOG_H
#define CHANGELOG_H
#include
#include
#include "SyncAgentConsts.h"
#include "SyncMLGlobals.h"
class QSqlDatabase;
namespace DataSync {
/*! \brief Stores the sync anchors and changes of different sync profiles.
*
*/
class ChangeLog
{
public:
/*! \brief Constructor
*
* @param aRemoteDevice Remote device
* @param aSourceDbURI URI of the local database
* @param aSyncDirection Direction of the sync
*/
ChangeLog( const QString& aRemoteDevice, const QString& aSourceDbURI,
SyncDirection aSyncDirection );
/*! \brief Destructor
*
*/
~ChangeLog();
/*! \brief Loads change log information from database
*
* @param aDbHandle Database handle to use
* @return True on success, otherwise false
*/
bool load( QSqlDatabase& aDbHandle );
/*! \brief Loads change log information from database
*
* @param aDbName Name of the database file to open
* @return True on success, otherwise false
*/
bool load( const QString& aDbName );
/*! \brief Saves change log information to database
*
* @param aDbHandle Database handle to use
* @return True on success, otherwise false
*/
bool save( QSqlDatabase& aDbHandle );
/*! \brief Saves change log information to database
*
* @param aDbName Name of the database file to open
* @return True on success, otherwise false
*/
bool save( const QString& aDbName );
/*! \brief Removes change log information from database
*
* @param aDbHandle Database handle to use
* @return True on success, otherwise false
*/
bool remove( QSqlDatabase& aDbHandle );
/*! \brief Removes change log information from database
*
* @param aDbName Name of the database file to open
* @return True on success, otherwise false
*/
bool remove( const QString& aDbName );
/*! \brief Gets the last local anchor of previous successful synchronization
*
* @return Last local anchor if found, otherwise empty
*/
const QString& getLastLocalAnchor() const;
/*! \brief Sets the last local anchor
*
* @param aLastLocalAnchor Last local anchor to set
*/
void setLastLocalAnchor( const QString& aLastLocalAnchor );
/*! \brief Gets the last remote anchor of previous successful synchronization
*
* @return Last remote anchor if found, otherwise empty
*/
const QString& getLastRemoteAnchor() const;
/*! \brief Sets the last remote anchor
*
* @param aLastRemoteAnchor Last remote anchor to set
*/
void setLastRemoteAnchor( const QString& aLastRemoteAnchor );
/*! \brief Returns the time when last sync was completed
*
* @return Last sync time
*/
const QDateTime& getLastSyncTime() const;
/*! \brief Stores the time when last sync was completed
*
* @param aLastSyncTime Last sync time
* @return Operation status code
*/
void setLastSyncTime( const QDateTime& aLastSyncTime );
/*! \brief Returns the ID mappings associated with this ChangeLog
*
* @return
*/
const QList& getMaps() const;
/*! \brief Sets the ID mappings associated with this ChangeLog
*
* @return
*/
void setMaps( const QList& aMaps );
private:
QString generateConnectionName();
bool ensureAnchorDatabase( QSqlDatabase& aDbHandle );
bool ensureMapsDatabase( QSqlDatabase& aDbHandle );
bool loadAnchors( QSqlDatabase& aDbHandle );
bool saveAnchors( QSqlDatabase& aDbHandle );
bool removeAnchors( QSqlDatabase& aDbHandle );
bool loadMaps( QSqlDatabase& aDbHandle );
bool saveMaps( QSqlDatabase& aDbHandle );
bool removeMaps( QSqlDatabase& aDbHandle );
QString iRemoteDevice;
QString iSourceDbURI;
SyncDirection iSyncDirection;
QString iLastLocalAnchor;
QString iLastRemoteAnchor;
QDateTime iLastSyncTime;
QList iMaps;
};
}
#endif
buteo-syncml-0.5.15/src/CommandHandler.cpp000066400000000000000000000664421433763642500204230ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "CommandHandler.h"
#include "StorageHandler.h"
#include "SyncTarget.h"
#include "SyncMLLogging.h"
#include "SyncAgentConfig.h"
#include "ResponseGenerator.h"
#include "ConflictResolver.h"
#include "DevInfPackage.h"
#include "AlertPackage.h"
#include "LocalMappingsPackage.h"
using namespace DataSync;
CommandHandler::CommandHandler( const Role& aRole )
: iRole( aRole )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
CommandHandler::~CommandHandler()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
ResponseStatusCode CommandHandler::handleMap( const MapParams& aMapParams, SyncTarget& aTarget )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
UIDMapping mapping;
for( int i = 0; i < aMapParams.mapItems.count(); ++i ) {
mapping.iRemoteUID = aMapParams.mapItems[i].source;
mapping.iLocalUID = aMapParams.mapItems[i].target;
aTarget.addUIDMapping( mapping );
}
return SUCCESS;
}
void CommandHandler::handleSync( const SyncParams& aSyncParams,
SyncTarget& aTarget,
StorageHandler& aStorageHandler,
ResponseGenerator& aResponseGenerator,
ConflictResolver& aConflictResolver,
bool aFastMapsSend )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if( !aSyncParams.noResp ) {
aResponseGenerator.addStatus( aSyncParams, SUCCESS );
}
QMap responses;
composeBatches( aSyncParams, aTarget, aStorageHandler, aResponseGenerator, responses );
QList newMappings;
commitBatches( aStorageHandler, aConflictResolver, aTarget, aSyncParams, responses, newMappings );
processResults( aSyncParams, responses, aResponseGenerator );
manageNewMappings( aTarget, newMappings, aResponseGenerator, aFastMapsSend );
}
void CommandHandler::rejectSync( const SyncParams& aSyncParams, ResponseGenerator& aResponseGenerator,
ResponseStatusCode aResponseCode )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if( !aSyncParams.noResp )
{
aResponseGenerator.addStatus( aSyncParams, aResponseCode );
}
for( int i = 0; i < aSyncParams.commands.count(); ++i )
{
rejectCommand( aSyncParams.commands[i], aResponseGenerator, aResponseCode );
}
}
void CommandHandler::rejectCommand( const CommandParams& aCommand, ResponseGenerator& aResponseGenerator,
ResponseStatusCode aResponseCode )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if( !aCommand.noResp )
{
aResponseGenerator.addStatus( aCommand, aResponseCode, true );
}
for( int i = 0; i < aCommand.subCommands.count(); ++i )
{
rejectCommand( aCommand.subCommands[i], aResponseGenerator, aResponseCode );
}
}
void CommandHandler::handleStatus(StatusParams* aStatusParams )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
ResponseStatusCode statusCode;
StatusCodeType statusType;
if (aStatusParams != NULL)
statusCode = aStatusParams->data;
else
return;
statusType = getStatusType(statusCode);
switch (statusType) {
case INFORMATIONAL:
{
// an informational message, no actions needed
break;
}
case SUCCESSFUL:
{
// Success, no actions needed
break;
}
case REDIRECTION:
{
handleRedirection( statusCode );
break;
}
case ORIGINATOR_EXCEPTION:
case RECIPIENT_EXCEPTION:
{
handleError(statusCode);
break;
}
default:
{
// Unknown code
qCDebug(lcSyncML) << "Found unknown code: " << statusCode;
break;
}
}
if ( aStatusParams->cmd == SYNCML_ELEMENT_ADD ||
aStatusParams->cmd == SYNCML_ELEMENT_REPLACE ||
aStatusParams->cmd == SYNCML_ELEMENT_DELETE ) {
emit itemAcknowledged( aStatusParams->msgRef, aStatusParams->cmdRef, aStatusParams->sourceRef );
}
}
void CommandHandler::handleError( ResponseStatusCode aErrorCode )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
StatusCodeType statusType = getStatusType( aErrorCode );
if (statusType == ORIGINATOR_EXCEPTION) {
switch (aErrorCode) {
case ALREADY_EXISTS:
{
// This merely an informational error that can happen e.g
// during slow sync. No need to abort the session.
break;
}
default:
{
emit abortSync(aErrorCode);
break;
}
}
}
else if (statusType == RECIPIENT_EXCEPTION) {
if (aErrorCode == REFRESH_REQUIRED) {
/// @todo init resresh sync
}
else {
emit abortSync(aErrorCode);
}
}
}
StatusCodeType CommandHandler::getStatusType(ResponseStatusCode aStatus)
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
const int informationalLowBound = 100;
const int informationalHighBound = 199;
const int succesfullLowBound = 200;
const int successfullHighBound = 299;
const int redirectionLowBound = 300;
const int redirectionHighBound = 399;
const int originatorExceptionLowBound = 400;
const int originatorExceptionHighBound = 499;
const int recipientExceptionLowBound = 500;
const int recipientExceptionHighBound = 599;
StatusCodeType statusType = UNKNOWN;
if (aStatus >= informationalLowBound && aStatus < informationalHighBound) {
statusType = INFORMATIONAL;
}
else if (aStatus >= succesfullLowBound && aStatus < successfullHighBound) {
statusType = SUCCESSFUL;
}
else if (aStatus >= redirectionLowBound && aStatus < redirectionHighBound) {
statusType = REDIRECTION;
}
else if (aStatus >= originatorExceptionLowBound && aStatus < originatorExceptionHighBound) {
statusType = ORIGINATOR_EXCEPTION;
}
else if (aStatus >= recipientExceptionLowBound && aStatus < recipientExceptionHighBound) {
statusType = RECIPIENT_EXCEPTION;
}
else {
statusType = UNKNOWN;
}
return statusType;
}
bool CommandHandler::resolveConflicts()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if( iRole == ROLE_CLIENT ) {
// At the moment, do not try to resolve conflicts on the client side
return false;
}
else {
// Server should resolve conflicts
return true;
}
}
ResponseStatusCode CommandHandler::handleRedirection(ResponseStatusCode /*aRedirectionCode*/)
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
return NOT_IMPLEMENTED;
}
void CommandHandler::composeBatches( const SyncParams& aSyncParams, SyncTarget& aTarget,
StorageHandler& aStorageHandler, ResponseGenerator& aResponseGenerator,
QMap& aResponses )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
// Batch updates
for( int i = 0; i < aSyncParams.commands.count(); ++i ) {
const CommandParams& data = aSyncParams.commands[i];
QString defaultType = data.meta.type;
QString defaultFormat = data.meta.format;
// Process items associated with the command
for( int a = 0; a < data.items.count(); ++a ) {
const ItemParams& item = data.items[a];
// Resolve id of the item
ItemId id;
id.iCmdId = data.cmdId;
id.iItemIndex = a;
// Resolve type of the item
QString type;
if( !item.meta.type.isEmpty() ) {
type = item.meta.type;
}
else {
type = defaultType;
}
// Resolve format of the item
QString format;
if( !item.meta.format.isEmpty() ) {
format = item.meta.format;
}
else {
format = defaultFormat;
}
// Get the version of the item
QString version = item.meta.version;
if( data.commandType == CommandParams::COMMAND_ADD ) {
// Resolve item key
QString remoteKey = item.source;
// Resolve parent
QString parentKey;
if( iRole == ROLE_CLIENT ) {
// Client might receive SourceParent or TargetParent. SourceParent is used
// when server does not yet know the id of parent. TargetParent is used if
// server knows the id of the parent.
if( !item.sourceParent.isEmpty() ) {
parentKey = aTarget.mapToLocalUID( item.sourceParent );
}
else {
parentKey = item.targetParent;
}
}
else if( iRole == ROLE_SERVER && !item.sourceParent.isEmpty() ) {
// Server always receives SourceParent, which must be mapped to local id
parentKey = aTarget.mapToLocalUID( item.sourceParent );
}
// no else
qCDebug(lcSyncML) << "Processing ADD with item URL:" << remoteKey;
// Large object chunk
if( item.moreData ) {
// First chunk of large object
if( !aStorageHandler.buildingLargeObject() ) {
// Size needs to be specified for first chunk
if( item.meta.size == 0 ) {
qCWarning(lcSyncML) << "No size found for large object:" << id.iCmdId
<<"/" << id.iItemIndex;
}
if( !aStorageHandler.startLargeObjectAdd( *aTarget.getPlugin(), remoteKey,
parentKey, type, format,
version, item.meta.size ) ) {
aResponses.insert( id, COMMAND_FAILED );
}
}
if( aStorageHandler.buildingLargeObject() ) {
if( aStorageHandler.appendLargeObjectData( item.data ) ) {
aResponseGenerator.addPackage( new AlertPackage( NEXT_MESSAGE,
aTarget.getSourceDatabase(),
aTarget.getTargetDatabase() ) );
aResponses.insert( id, CHUNKED_ITEM_ACCEPTED );
}
else {
aResponses.insert( id, COMMAND_FAILED );
}
}
}
// Last chunk of large object
else if( aStorageHandler.buildingLargeObject() ) {
if( !aStorageHandler.matchesLargeObject( remoteKey ) ) {
aResponseGenerator.addPackage( new AlertPackage( NO_END_OF_DATA,
aTarget.getSourceDatabase(),
aTarget.getTargetDatabase() ) );
aResponses.insert( id, COMMAND_NOT_ALLOWED );
}
else if( aStorageHandler.appendLargeObjectData( item.data ) ) {
if( !aStorageHandler.finishLargeObject( id ) ) {
aResponses.insert( id, COMMAND_FAILED );
}
}
else {
aResponses.insert( id, COMMAND_FAILED );
}
}
// Normal object
else if( !aStorageHandler.addItem( id, *aTarget.getPlugin(), QString(), parentKey,
type, format, version, item.data ) ) {
aResponses.insert( id, COMMAND_FAILED );
}
}
else if( data.commandType == CommandParams::COMMAND_REPLACE ) {
// Resolve item key
QString localKey;
if( iRole == ROLE_CLIENT ) {
localKey = item.target;
}
else {
localKey = aTarget.mapToLocalUID( item.source );
}
// Resolve parent
QString parentKey;
if( iRole == ROLE_CLIENT ) {
// Client might receive SourceParent or TargetParent. SourceParent is used
// when server does not yet know the id of parent. TargetParent is used if
// server knows the id of the parent.
if( !item.sourceParent.isEmpty() ) {
parentKey = aTarget.mapToLocalUID( item.sourceParent );
}
else {
parentKey = item.targetParent;
}
}
else if( iRole == ROLE_SERVER ) {
// Server always receives SourceParent, which must be mapped to local id
parentKey = aTarget.mapToLocalUID( item.sourceParent );
}
// no else
qCDebug(lcSyncML) << "Processing REPLACE with item URL:" << localKey;
// Large object chunk
if( item.moreData ) {
// First chunk of large object
if( !aStorageHandler.buildingLargeObject() ) {
// Size needs to be specified for first chunk
if( item.meta.size == 0 ) {
qCDebug(lcSyncML) << "No size found for large object:" << id.iCmdId
<<"/" << id.iItemIndex;
}
if( !aStorageHandler.startLargeObjectReplace( *aTarget.getPlugin(), localKey,
parentKey, type, format,
version, item.meta.size ) ) {
aResponses.insert( id, COMMAND_FAILED );
}
}
if( aStorageHandler.buildingLargeObject() ) {
if( aStorageHandler.appendLargeObjectData( item.data.toUtf8() ) ) {
aResponseGenerator.addPackage( new AlertPackage( NEXT_MESSAGE,
aTarget.getSourceDatabase(),
aTarget.getTargetDatabase() ) );
aResponses.insert( id, CHUNKED_ITEM_ACCEPTED );
}
else {
aResponses.insert( id, COMMAND_FAILED );
}
}
}
// Last chunk of large object
else if( aStorageHandler.buildingLargeObject() ) {
if( !aStorageHandler.matchesLargeObject( localKey ) ) {
aResponseGenerator.addPackage( new AlertPackage( NO_END_OF_DATA,
aTarget.getSourceDatabase(),
aTarget.getTargetDatabase() ) );
aResponses.insert( id, COMMAND_NOT_ALLOWED );
}
else if( aStorageHandler.appendLargeObjectData( item.data ) ) {
if( !aStorageHandler.finishLargeObject( id ) ) {
aResponses.insert( id, COMMAND_FAILED );
}
}
else {
aResponses.insert( id, COMMAND_FAILED );
}
}
// Normal object
else if( !aStorageHandler.replaceItem( id, *aTarget.getPlugin(), localKey,
parentKey, type, format, version, item.data ) ) {
aResponses.insert( id, COMMAND_FAILED );
}
}
else if( data.commandType == CommandParams::COMMAND_DELETE ) {
// Resolve item key
QString localKey;
if( iRole == ROLE_CLIENT ) {
localKey = item.target;
}
else {
localKey = aTarget.mapToLocalUID( item.source );
}
qCDebug(lcSyncML) << "Processing REPLACE with item URL:" << localKey;
if( !aStorageHandler.deleteItem( id, localKey ) ) {
aResponses.insert( id, COMMAND_FAILED );
}
}
else {
// @todo: This is OK if we receive Copy/Move inside Sync, but what about
// Atomic/Sequence, should we also send status about the subcommands?
aResponses.insert( id, NOT_IMPLEMENTED );
}
}
}
}
void CommandHandler::commitBatches( StorageHandler& aStorageHandler, ConflictResolver& aConflictResolver,
SyncTarget& aTarget, const SyncParams& aSyncParams,
QMap& aResponses,
QList& aNewMappings )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
// Commit batches
QMap results;
ConflictResolver* resolver = NULL;
if( resolveConflicts() ) {
resolver = &aConflictResolver;
}
else {
resolver = NULL;
}
results.unite( aStorageHandler.commitAddedItems( *aTarget.getPlugin(), resolver ) );
results.unite( aStorageHandler.commitReplacedItems( *aTarget.getPlugin(), resolver ) );
results.unite( aStorageHandler.commitDeletedItems( *aTarget.getPlugin(), resolver ) );
// Process commit results and convert them to result codes
for( int i = 0; i < aSyncParams.commands.count(); ++i ) {
const CommandParams& data = aSyncParams.commands[i];
// Process items associated with the command
for( int a = 0; a < data.items.count(); ++a ) {
const ItemParams& item = data.items[a];
ItemId id;
id.iCmdId = data.cmdId;
id.iItemIndex = a;
if( !aResponses.contains( id ) ) {
if( results.contains( id ) ) {
ResponseStatusCode statusCode = COMMAND_FAILED;
const CommitResult& result = results.value( id );
if( result.iStatus == COMMIT_ADDED || result.iStatus == COMMIT_INIT_ADD) {
if( result.iConflict == CONFLICT_LOCAL_WIN ) {
if( iRole == ROLE_CLIENT ) {
statusCode = RESOLVED_CLIENT_WINNING;
}
else {
statusCode = RESOLVED_WITH_SERVER_DATA;
}
}
else if( result.iConflict == CONFLICT_REMOTE_WIN ) {
if( iRole == ROLE_CLIENT ) {
statusCode = RESOLVED_WITH_SERVER_DATA;
}
else {
statusCode = RESOLVED_CLIENT_WINNING;
}
}
else {
statusCode = ITEM_ADDED;
}
UIDMapping map;
map.iRemoteUID = item.source;
map.iLocalUID = result.iItemKey;
aNewMappings.append( map );
}
else if( result.iStatus == COMMIT_REPLACED || result.iStatus == COMMIT_INIT_REPLACE ) {
if( result.iConflict == CONFLICT_LOCAL_WIN ) {
if( iRole == ROLE_CLIENT ) {
statusCode = RESOLVED_CLIENT_WINNING;
}
else {
statusCode = RESOLVED_WITH_SERVER_DATA;
}
}
else if( result.iConflict == CONFLICT_REMOTE_WIN ) {
if( iRole == ROLE_CLIENT ) {
statusCode = RESOLVED_WITH_SERVER_DATA;
}
else {
statusCode = RESOLVED_CLIENT_WINNING;
}
}
else {
statusCode = SUCCESS;
}
}
else if( result.iStatus == COMMIT_DELETED || result.iStatus == COMMIT_INIT_DELETE ) {
if( result.iConflict == CONFLICT_LOCAL_WIN ) {
if( iRole == ROLE_CLIENT ) {
statusCode = RESOLVED_CLIENT_WINNING;
}
else {
statusCode = RESOLVED_WITH_SERVER_DATA;
}
}
else if( result.iConflict == CONFLICT_REMOTE_WIN ) {
aTarget.removeUIDMapping( result.iItemKey );
if( iRole == ROLE_CLIENT ) {
statusCode = RESOLVED_WITH_SERVER_DATA;
}
else {
statusCode = RESOLVED_CLIENT_WINNING;
}
}
else {
aTarget.removeUIDMapping( result.iItemKey );
statusCode = SUCCESS;
}
}
else if( result.iStatus == COMMIT_DUPLICATE ) {
statusCode = ALREADY_EXISTS;
}
else if( result.iStatus == COMMIT_NOT_DELETED ) {
statusCode = ITEM_NOT_DELETED;
aTarget.removeUIDMapping( result.iItemKey );
}
else if( result.iStatus == COMMIT_UNSUPPORTED_FORMAT ) {
statusCode = UNSUPPORTED_FORMAT;
}
else if( result.iStatus == COMMIT_ITEM_TOO_BIG ) {
statusCode = REQUEST_SIZE_TOO_BIG;
}
else if( result.iStatus == COMMIT_NOT_ENOUGH_SPACE ) {
statusCode = DEVICE_FULL;
}
else {
statusCode = COMMAND_FAILED;
}
aResponses.insert( id, statusCode );
}
else {
aResponses.insert( id, COMMAND_FAILED );
}
}
}
}
}
void CommandHandler::processResults( const SyncParams& aSyncParams, const QMap& aResponses,
ResponseGenerator& aResponseGenerator )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
// Process result codes and write corresponding status elements
for( int i = 0; i < aSyncParams.commands.count(); ++i )
{
const CommandParams& command = aSyncParams.commands[i];
if( command.noResp )
{
continue;
}
QMultiMap responses;
// Process items associated with the command
for( int a = 0; a < command.items.count(); ++a )
{
ItemId id;
id.iCmdId = command.cmdId;
id.iItemIndex = a;
responses.insert( aResponses.value( id ), a );
}
QList codes = responses.uniqueKeys();
for( int b = 0; b < codes.count(); ++b )
{
QList itemIndexes = responses.values( codes[b] );
// values() returns items sorted by most recently added, so we need to
// reverse the list
QList reverseIndexes;
QListIterator iterator( itemIndexes );
for( iterator.toBack(); iterator.hasPrevious(); )
{
reverseIndexes.append( iterator.previous() );
}
aResponseGenerator.addStatus( command, codes[b], reverseIndexes );
}
}
}
void CommandHandler::manageNewMappings( SyncTarget& aTarget, const QList& aNewMappings,
ResponseGenerator& aResponseGenerator, bool aFastMapsSend )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
// Manage new mappings: Save them to persistent storage. Also if we are acting as a client
// and we have been configured to fast-send mappings, compose LocalMappingsPackage
for( int i = 0; i < aNewMappings.size(); ++i )
{
aTarget.addUIDMapping( aNewMappings[i] );
}
if ( (iRole == ROLE_CLIENT) && (aFastMapsSend) && (aNewMappings.size() > 0) )
{
LocalMappingsPackage* localMappingsPackage = new LocalMappingsPackage( aTarget.getSourceDatabase(),
aTarget.getTargetDatabase(),
aNewMappings );
aResponseGenerator.addPackage( localMappingsPackage );
}
}
buteo-syncml-0.5.15/src/CommandHandler.h000066400000000000000000000161371433763642500200640ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef COMMANDHANDLER_H
#define COMMANDHANDLER_H
#include
#include "SyncMLGlobals.h"
#include "SyncAgentConsts.h"
#include "StorageHandler.h"
#include "datatypes.h"
namespace DataSync {
/*! \brief SyncML Status code groups
*
*/
enum StatusCodeType {
UNKNOWN,
INFORMATIONAL,
SUCCESSFUL,
REDIRECTION,
ORIGINATOR_EXCEPTION,
RECIPIENT_EXCEPTION
};
class SyncTarget;
class StoragePlugin;
class StorageHandler;
class ResponseGenerator;
class ConflictResolver;
class DeviceInfo;
struct MapParams;
struct SyncParams;
struct StatusParams;
struct CommandParams;
class CommandHandlerTest;
/*! \brief Responsible for handling and processing individual SyncML commands
*
*/
class CommandHandler : public QObject {
Q_OBJECT
public:
/*! \brief Constructor
*
* @param aRole Role in use
*/
explicit CommandHandler( const Role& aRole );
/*! \brief Destructor
*
*/
virtual ~CommandHandler();
/*! \brief Process SyncML MAP command
*
* @param aMapParams MAP element data
* @param aTarget Target associated with the command
* @return Status code
*/
ResponseStatusCode handleMap( const MapParams& aMapParams, SyncTarget& aTarget );
/*! \brief Process SyncML SYNC command
*
* @param aSyncParams SYNC element data
* @param aTarget Target associated with the command
* @param aStorageHandler Storage handler to use in manipulating local database
* @param aResponseGenerator Response generator to use
* @param aConflictResolver Conflict resolver to use
* @param aFastMapsSend True if possible mappings should be sent immediately
*/
void handleSync( const SyncParams& aSyncParams,
SyncTarget& aTarget,
StorageHandler& aStorageHandler,
ResponseGenerator& aResponseGenerator,
ConflictResolver& aConflictResolver,
bool aFastMapsSend);
/*! \brief Reject SyncML SYNC command
*
* @param aSyncParams SYNC element data
* @param aResponseGenerator Response generator to use
* @param aResponseCode Response code to use
*/
void rejectSync( const SyncParams& aSyncParams, ResponseGenerator& aResponseGenerator,
ResponseStatusCode aResponseCode );
/*! \brief Reject SyncML command (and all it's subcommands)
*
* @param aCommand Command element data
* @param aResponseGenerator Response generator to use
* @param aResponseCode Response code to use
*/
void rejectCommand( const CommandParams& aCommand, ResponseGenerator& aResponseGenerator,
ResponseStatusCode aResponseCode );
/*! \brief Handle incoming status element
*
* @param aStatusParams Status params of the response
*/
void handleStatus(StatusParams* aStatusParams );
signals:
/*! \brief Signal indicating that remote device has acknowledged an item we've sent
*
* @param aMsgRef Message reference to the item
* @param aCmdRef Command reference to the item
* @param aSyncItemKey Key of the item
*/
void itemAcknowledged( int aMsgRef, int aCmdRef, SyncItemKey aSyncItemKey );
/*! \brief Signal indicating that remote device has acknowledged a map we've sent
*
* @param aMsgRef Message reference to the item
* @param aCmdRef Command reference to the item
*/
void mappingAcknowledged( int aMsgRef, int aCmdRef );
/*! \brief Signal indicating that the session should be aborted
*
* @param aAbortReason Abort code
*/
void abortSync(ResponseStatusCode aAbortReason);
protected: // functions
/*! \brief Returns whether conflict resolution is enabled
*
* @return True if conflict resolution should be done, otherwise false
*/
bool resolveConflicts();
private: // functions
/**
* \brief Handles error situation
* @param aErrorCode Error code
*/
void handleError(ResponseStatusCode aErrorCode);
/**
* \brief Handles redirection information message
* @param aRedirectionCode
*/
virtual ResponseStatusCode handleRedirection( ResponseStatusCode aRedirectionCode );
/**
* \brief Return the type of the status code given as parameter
* @param aStatus Status code
* @return The type of the status code
*/
StatusCodeType getStatusType(ResponseStatusCode aStatus);
void composeBatches( const SyncParams& aSyncParams, SyncTarget& aTarget,
StorageHandler& aStorageHandler, ResponseGenerator& aResponseGenerator,
QMap& aResponses );
void commitBatches( StorageHandler& aStorageHandler, ConflictResolver& aConflictResolver,
SyncTarget& aTarget, const SyncParams& aSyncParams,
QMap& aResponses,
QList& aNewMappings );
void processResults( const SyncParams& aSyncParams, const QMap& aResponses,
ResponseGenerator& aResponseGenerator );
void manageNewMappings( SyncTarget& aTarget, const QList& aNewMappings,
ResponseGenerator& aResponseGenerator, bool aFastMapsSend );
private: // data
Role iRole; ///< Role in use
QMap iStatusTypes; ///< A map that is used to find the type of a status code
friend class CommandHandlerTest;
};
}
#endif
buteo-syncml-0.5.15/src/ConflictResolver.cpp000066400000000000000000000105201433763642500210140ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "ConflictResolver.h"
#include "SyncAgentConsts.h"
#include "LocalChanges.h"
#include "SyncMLLogging.h"
using namespace DataSync;
ConflictResolver::ConflictResolver( LocalChanges& aLocalChanges,
ConflictResolutionPolicy aPolicy )
: iLocalChanges( aLocalChanges ), iPolicy( aPolicy )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
ConflictResolver::~ConflictResolver()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
bool ConflictResolver::isConflict( const SyncItemKey& aKey,
bool aDelete ) const
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if (aKey.isEmpty())
return false;
// If item can be found from modified list, it is always a conflict. If item can
// be found from removed list, it is conflict only if command doesn't involve deleting the item
bool removalConflict = iLocalChanges.removed.contains( aKey ) && !aDelete;
bool modificationConflict = iLocalChanges.modified.contains( aKey );
return ( removalConflict || modificationConflict );
}
bool ConflictResolver::localSideWins() const
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if( iPolicy == PREFER_LOCAL_CHANGES )
{
return true;
}
else
{
return false;
}
}
void ConflictResolver::removeLocalChange( const SyncItemKey& aLocalKey )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
bool retval = false;
if (iLocalChanges.removed.contains( aLocalKey ))
retval = iLocalChanges.removed.removeOne( aLocalKey );
else
retval = iLocalChanges.modified.removeOne( aLocalKey );
}
void ConflictResolver::changeLocalModifyToLocalAdd( const SyncItemKey& aLocalKey )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
/* Reason for this is that in the case of a conflict scenario if the remote is delete and local is
* modify and if remote wins the mapping is lost in remote side so a replace returns with an error*/
for (int i = 0; i < iLocalChanges.modified.size(); ++i) {
qCDebug(lcSyncML) << "Key :" << aLocalKey << "Remote" << iLocalChanges.modified.at(i);
if (iLocalChanges.modified.at(i) == aLocalKey){
qCDebug(lcSyncML) << "Change from replace to add ";
iLocalChanges.modified.removeAt(i);
iLocalChanges.added.append(aLocalKey);
break;
}
}
}
void ConflictResolver::revertLocalChange( const SyncItemKey& aLocalKey, ConflictRevertPolicy policy )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
switch (policy) {
case CR_REMOVE_LOCAL:
removeLocalChange ( aLocalKey );
break;
case CR_MODIFY_TO_ADD:
changeLocalModifyToLocalAdd ( aLocalKey );
break;
default:
qCWarning(lcSyncML) << "Wrong ConflictRevertPolicy";
break;
}
}
buteo-syncml-0.5.15/src/ConflictResolver.h000066400000000000000000000100171433763642500204620ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef CONFLICTRESOLVER_H
#define CONFLICTRESOLVER_H
#include "SyncAgentConsts.h"
#include "SyncItemKey.h"
namespace DataSync {
class LocalChanges;
class ConflictResolverTest;
enum ConflictRevertPolicy {
CR_REMOVE_LOCAL, /*!
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "DataStore.h"
using namespace DataSync;
Datastore::Datastore() : iSupportsHierarchicalSync( false )
{
}
Datastore::~Datastore()
{
}
void Datastore::setSourceURI( const QString& aSourceURI )
{
iSourceURI = aSourceURI;
}
const QString& Datastore::getSourceURI() const
{
return iSourceURI;
}
StorageContentFormatInfo& Datastore::formatInfo()
{
return iFormatInfo;
}
const StorageContentFormatInfo& Datastore::formatInfo() const
{
return iFormatInfo;
}
void Datastore::setSupportsHierarchicalSync( bool aSupports )
{
iSupportsHierarchicalSync = aSupports;
}
bool Datastore::getSupportsHierarchicalSync() const
{
return iSupportsHierarchicalSync;
}
const QList& Datastore::syncCaps() const
{
return iSyncCaps;
}
QList& Datastore::syncCaps()
{
return iSyncCaps;
}
const QList& Datastore::ctCaps() const
{
return iCTCaps;
}
QList& Datastore::ctCaps()
{
return iCTCaps;
}
buteo-syncml-0.5.15/src/DataStore.h000066400000000000000000000066471433763642500171030ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef DATASTORE_H
#define DATASTORE_H
#include "CTCap.h"
#include "SyncMLGlobals.h"
namespace DataSync {
/*! \brief Describes the properties of a storage
*
*/
class Datastore
{
public:
/*! \brief Constructor
*
*/
Datastore();
/*! \brief Destructor
*
*/
~Datastore();
/*! \brief Set source URI of this datastore
*
* @param aSourceURI Source URI to set
*/
void setSourceURI( const QString& aSourceURI );
/*! \brief Retrieve source URI of this datastore
*
* @return
*/
const QString& getSourceURI() const;
/*! \brief Access format info
*
* @return
*/
StorageContentFormatInfo& formatInfo();
/*! \brief Access format info
*
* @return
*/
const StorageContentFormatInfo& formatInfo() const;
/*! \brief Sets support hierarchical sync property
*
* @param aSupports Value to set
*/
void setSupportsHierarchicalSync( bool aSupports );
/*! \brief Retrieve support hierarchical sync property
*
* @return
*/
bool getSupportsHierarchicalSync() const;
/*! \brief Access sync caps of this datastore
*
* @return
*/
const QList& syncCaps() const;
/*! \brief Access sync caps of this datastore
*
* @return
*/
QList& syncCaps();
/*! \brief Access CT caps of this datastore
*
* @return
*/
const QList& ctCaps() const;
/*! \brief Access CT caps of this datastore
*
* @return
*/
QList& ctCaps();
private:
QString iSourceURI;
StorageContentFormatInfo iFormatInfo;
bool iSupportsHierarchicalSync;
QList iSyncCaps;
QList iCTCaps;
};
}
#endif // DATASTORE_H
buteo-syncml-0.5.15/src/DatabaseHandler.cpp000066400000000000000000000047601433763642500205440ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "DatabaseHandler.h"
#include "SyncMLLogging.h"
using namespace DataSync;
const QString CONNECTIONNAME( "dbhandler" );
DatabaseHandler::DatabaseHandler( const QString& aDbFilePath )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
static unsigned connectionNumber = 0;
iConnectionName = CONNECTIONNAME + QString::number( connectionNumber++ );
iDb = QSqlDatabase::addDatabase( "QSQLITE", iConnectionName );
iDb.setDatabaseName( aDbFilePath );
if(!iDb.open())
qCCritical(lcSyncML) << "can not open database";
}
DatabaseHandler::~DatabaseHandler()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
iDb.close();
iDb = QSqlDatabase();
QSqlDatabase::removeDatabase( iConnectionName );
}
bool DatabaseHandler::isValid() const
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
return iDb.isOpen();
}
QSqlDatabase& DatabaseHandler::getDbHandle()
{
return iDb;
}
buteo-syncml-0.5.15/src/DatabaseHandler.h000066400000000000000000000050201433763642500201770ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef DATABASEHANDLER_H
#define DATABASEHANDLER_H
#include
namespace DataSync {
/*! \brief Manages Qt's SQL database
*
*/
class DatabaseHandler {
public:
/*! \brief Constructor
*
* @param aDbFile Path of database file to create and open
*
*/
explicit DatabaseHandler( const QString& aDbFilePath );
/*! \brief Destructor
*
*/
virtual ~DatabaseHandler();
/*! \brief Returns true if database handle is currently valid and can be used
*
* @return
*/
bool isValid() const;
/*! \brief Returns a handle to the database connection
*
* @return Handle to the database connection
*/
QSqlDatabase& getDbHandle();
private:
private: // data
QSqlDatabase iDb; ///< Database object
QString iConnectionName; ///< Database connection name
};
}
#endif // DATABASEHANDLER_H
buteo-syncml-0.5.15/src/DevInfHandler.cpp000066400000000000000000000135711433763642500202130ustar00rootroot00000000000000
/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "DevInfHandler.h"
#include "DevInfPackage.h"
#include "ResponseGenerator.h"
#include "Fragments.h"
#include "SyncMLLogging.h"
using namespace DataSync;
DevInfHandler::DevInfHandler( const DeviceInfo& aDeviceInfo )
: iLocalDeviceInfo( aDeviceInfo ), iLocalDevInfSent( false ),
iRemoteDevInfReceived( false )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
DevInfHandler::~DevInfHandler()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
const DeviceInfo& DevInfHandler::getLocalDeviceInfo() const
{
return iLocalDeviceInfo;
}
const RemoteDeviceInfo& DevInfHandler::getRemoteDeviceInfo() const
{
return iRemoteDevInfo;
}
void DevInfHandler::composeLocalInitiatedDevInfExchange(
const QList& aDataStores, const ProtocolVersion& aVersion,
const Role& aRole, ResponseGenerator& aResponseGenerator )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if( !iLocalDevInfSent )
{
DevInfPackage* devInf = new DevInfPackage( aDataStores, iLocalDeviceInfo,
aVersion, aRole );
aResponseGenerator.addPackage( devInf );
iLocalDevInfSent = true;
}
}
ResponseStatusCode DevInfHandler::handleGet( const CommandParams& aGet,
const ProtocolVersion& aVersion,
const QList& aDataStores,
const Role& aRole,
ResponseGenerator& aResponseGenerator )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
ResponseStatusCode status = NOT_IMPLEMENTED;
bool valid = false;
if( aGet.items.count() == 1 ) {
if( aVersion == SYNCML_1_1 && aGet.items.first().target == SYNCML_DEVINF_PATH_11 ) {
valid = true;
}
else if( aVersion == SYNCML_1_2 && aGet.items.first().target == SYNCML_DEVINF_PATH_12 ) {
valid = true;
}
}
if( valid )
{
// If we haven't yet received remote device info, send GET in addition to the
// RESULTS
DevInfPackage* devInf = new DevInfPackage( aResponseGenerator.getRemoteMsgId(),
aGet.cmdId,
aDataStores,
iLocalDeviceInfo,
aVersion,
aRole,
!iRemoteDevInfReceived );
aResponseGenerator.addPackage( devInf );
iLocalDevInfSent = true;
status = SUCCESS;
}
else
{
status = COMMAND_FAILED;
}
return status;
}
ResponseStatusCode DevInfHandler::handlePut( const PutParams& aPut,
const ProtocolVersion& aVersion )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
ResponseStatusCode status = NOT_IMPLEMENTED;
bool valid = false;
if( aVersion == SYNCML_1_1 && aPut.devInf.source == SYNCML_DEVINF_PATH_11 ) {
valid = true;
}
else if( aVersion == SYNCML_1_2 && aPut.devInf.source == SYNCML_DEVINF_PATH_12 ) {
valid = true;
}
if( valid )
{
iRemoteDevInfo = aPut.devInf.devInfo;
iRemoteDevInfReceived = true;
status = SUCCESS;
}
else
{
status = COMMAND_FAILED;
}
return status;
}
ResponseStatusCode DevInfHandler::handleResults( const ResultsParams& aResults,
const ProtocolVersion& aVersion )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
ResponseStatusCode status = NOT_IMPLEMENTED;
bool valid = false;
if( aVersion == SYNCML_1_1 && aResults.devInf.source == SYNCML_DEVINF_PATH_11 )
{
valid = true;
}
else if( aVersion == SYNCML_1_2 && aResults.devInf.source == SYNCML_DEVINF_PATH_12 )
{
valid = true;
}
if( valid )
{
iRemoteDevInfo = aResults.devInf.devInfo;
iRemoteDevInfReceived = true;
status = SUCCESS;
}
else
{
status = COMMAND_FAILED;
}
return status;
}
void DevInfHandler::reset()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
iLocalDevInfSent = false;
iRemoteDevInfReceived = false;
}
buteo-syncml-0.5.15/src/DevInfHandler.h000066400000000000000000000114001433763642500176450ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef DEVINFHANDLER_H
#define DEVINFHANDLER_H
#include "DeviceInfo.h"
#include "RemoteDeviceInfo.h"
#include "SyncAgentConsts.h"
#include "datatypes.h"
class DevInfHandlerTest;
namespace DataSync
{
class StoragePlugin;
class ResponseGenerator;
struct CommandParams;
struct PutParams;
struct ResultsParams;
/*! \brief Class that governs the exchange of device information in
* synchronization session
*/
class DevInfHandler
{
public:
/*! \brief Constructor
*
* @param aDeviceInfo Device information object
*/
DevInfHandler( const DeviceInfo& aDeviceInfo );
/*! \brief Destructor
*
*/
~DevInfHandler();
/*! \brief Retrieves the local device information
*
* @return
*/
const DeviceInfo& getLocalDeviceInfo() const;
/*! \brief Retrieves the remote device information
*
* @return
*/
const RemoteDeviceInfo& getRemoteDeviceInfo() const;
/*! \brief Initiate a device info exchange with remote device
*
* @param aDataStores Data stores to use
* @param aVersion Protocol version in use
* @param aRole Role in use
* @param aResponseGenerator Response generator to use
*/
void composeLocalInitiatedDevInfExchange( const QList& aDataStores,
const ProtocolVersion& aVersion,
const Role& aRole,
ResponseGenerator& aResponseGenerator );
/*! \brief Respond to device info requested by remote device
*
* @param aGet GET element data
* @param aDataStores Data stores to use
* @param aVersion Protocol version in use
* @param aRole Role in use
* @param aResponseGenerator Response generator to use
* @return
*/
ResponseStatusCode handleGet( const CommandParams& aGet,
const ProtocolVersion& aVersion,
const QList& aDataStores,
const Role& aRole,
ResponseGenerator& aResponseGenerator );
/*! \brief Respond to device info sent by remote device
*
* @param aPut PUT element data
* @param aVersion Protocol version in use
* @return
*/
ResponseStatusCode handlePut( const PutParams& aPut,
const ProtocolVersion& aVersion );
/*! \brief Respond to device info received from remote device
*
* @param aResults RESULTS element data
* @param aVersion Protocol version in use
*/
ResponseStatusCode handleResults( const ResultsParams& aResults,
const ProtocolVersion& aVersion );
/*! \brief Resets device information exchange state
*
* Needed for example when initialization package needs to be re-sent
*/
void reset();
protected:
private:
friend class ::DevInfHandlerTest;
DeviceInfo iLocalDeviceInfo;
RemoteDeviceInfo iRemoteDevInfo;
bool iLocalDevInfSent;
bool iRemoteDevInfReceived;
};
}
#endif // DEVINFHANDLER_H
buteo-syncml-0.5.15/src/DevInfPackage.cpp000066400000000000000000000117101433763642500201620ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "DevInfPackage.h"
#include "SyncMLPut.h"
#include "SyncMLGet.h"
#include "SyncMLResults.h"
#include "SyncMLMessage.h"
#include "datatypes.h"
#include "SyncMLLogging.h"
using namespace DataSync;
DevInfPackage::DevInfPackage( const QList& aDataStores,
const DeviceInfo& aDeviceInfo,
const ProtocolVersion& aVersion,
const Role& aRole )
: iMsgRef(0), iCmdRef(0), iDataStores( aDataStores ), iDeviceInfo( aDeviceInfo ),
iVersion( aVersion ), iRole( aRole ), iType( PUTGET )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
DevInfPackage::DevInfPackage( int aMsgRef, int aCmdRef,
const QList& aDataStores,
const DeviceInfo& aDeviceInfo,
const ProtocolVersion& aVersion,
const Role& aRole,
bool aRetrieveRemoteDevInf )
: iMsgRef( aMsgRef ), iCmdRef( aCmdRef ), iDataStores( aDataStores ),
iDeviceInfo( aDeviceInfo ),iVersion( aVersion ), iRole( aRole )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if( aRetrieveRemoteDevInf )
{
iType = RESULTSGET;
}
else
{
iType = RESULTS;
}
}
DevInfPackage::~DevInfPackage()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
bool DevInfPackage::write( SyncMLMessage& aMessage, int& aSizeThreshold, bool aWBXML, const ProtocolVersion& aVersion )
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
if( iType == PUTGET )
{
// Compose PUT
SyncMLPut* put = new SyncMLPut( aMessage.getNextCmdId(), iDataStores,
iDeviceInfo, iVersion, iRole );
// Compose GET
SyncMLGet* get = new SyncMLGet( aMessage.getNextCmdId(), SYNCML_CONTTYPE_DEVINF_XML,
iVersion == SYNCML_1_1 ? SYNCML_DEVINF_PATH_11 : SYNCML_DEVINF_PATH_12 );
aSizeThreshold -= put->calculateSize(aWBXML, aVersion);
aMessage.addToBody( put );
aSizeThreshold -= get->calculateSize(aWBXML, aVersion);
aMessage.addToBody( get );
}
else if( iType == RESULTS )
{
// Compose RESULTS
SyncMLResults* results = new SyncMLResults( aMessage.getNextCmdId(), iMsgRef, iCmdRef,
iDataStores, iDeviceInfo, iVersion,
iRole );
aSizeThreshold -= results->calculateSize(aWBXML, aVersion);
aMessage.addToBody( results );
}
else if( iType == RESULTSGET )
{
// Compose RESULTS
SyncMLResults* results = new SyncMLResults( aMessage.getNextCmdId(), iMsgRef, iCmdRef,
iDataStores, iDeviceInfo, iVersion,
iRole );
// Compose GET
SyncMLGet* get = new SyncMLGet( aMessage.getNextCmdId(), SYNCML_CONTTYPE_DEVINF_XML,
iVersion == SYNCML_1_1 ? SYNCML_DEVINF_PATH_11 : SYNCML_DEVINF_PATH_12 );
aSizeThreshold -= results->calculateSize(aWBXML, aVersion);
aMessage.addToBody( results );
aSizeThreshold -= get->calculateSize(aWBXML, aVersion);
aMessage.addToBody( get );
}
else
{
Q_ASSERT(0);
}
return true;
}
buteo-syncml-0.5.15/src/DevInfPackage.h000066400000000000000000000102011433763642500176210ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef DEVINFPACKAGE_H
#define DEVINFPACKAGE_H
#include "Package.h"
#include "SyncAgentConsts.h"
#include "datatypes.h"
namespace DataSync {
class StoragePlugin;
class DeviceInfo;
/*! \brief DevInfPackage handles exchanging of device information to remote side
*
*/
class DevInfPackage : public Package
{
Q_OBJECT;
public:
/*! \brief Construct device information package using PUT
*
* This constructor should be used when local side is initiating device
* info exchange. Local device info is sent with PUT, and remote device info
* is requested with GET.
*
* @param aDataStores Datastores available to use in generation
* @param aDeviceInfo Device info object
* @param aVersion Protocol version to use
* @param aRole Role in use
*/
DevInfPackage( const QList& aDataStores,
const DeviceInfo& aDeviceInfo,
const ProtocolVersion& aVersion,
const Role& aRole );
/*! \brief Construct device information package using RESULTS
*
* This constructor should be used when remote side is initiating device info
* exchange. Remote device has issued GET, which will be countered with
* RESULTS. If remote device has not yet sent device info, GET can be
* issued to retrieve it.
*
* @param aMsgRef Message reference for RESULTS element
* @param aCmdRef Command reference for RESULTS element
* @param aDataStores Datastores available to use in generation
* @param aDeviceInfo Device info object
* @param aVersion Protocol version to use
* @param aRole Role in use
* @param aRetrieveRemoteDevInf True if GET should be issued to remote side
*/
DevInfPackage( int aMsgRef, int aCmdRef,
const QList& aDataStores,
const DeviceInfo& aDeviceInfo,
const ProtocolVersion& aVersion,
const Role& aRole,
bool aRetrieveRemoteDevInf );
virtual ~DevInfPackage();
virtual bool write( SyncMLMessage& aMessage, int& aSizeThreshold, bool aWBXML, const ProtocolVersion& aVersion );
protected:
private:
enum Type
{
PUTGET,
RESULTS,
RESULTSGET
};
int iMsgRef;
int iCmdRef;
QList iDataStores;
const DeviceInfo& iDeviceInfo;
ProtocolVersion iVersion;
Role iRole;
Type iType;
};
}
#endif // DEVINFPACKAGE_H
buteo-syncml-0.5.15/src/DeviceInfo.cpp000066400000000000000000000125601433763642500175520ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "DeviceInfo.h"
#include
#include
#include "SyncMLLogging.h"
#include "datatypes.h"
using namespace DataSync;
const QString XML_KEY_MANUFACTURER("Manufacturer");
const QString XML_KEY_MODEL("Model");
const QString XML_KEY_OEM("OEM");
const QString XML_KEY_FW_VER("FwVersion");
const QString XML_KEY_HW_VER("HwVersion");
const QString XML_KEY_SW_VER("SwVersion");
const QString XML_KEY_ID("Id");
const QString XML_KEY_DEVICE_TYPE("DeviceType");
DeviceInfo::DeviceInfo()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
DeviceInfo::~DeviceInfo()
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
}
const QString& DeviceInfo::getManufacturer() const
{
return iManufacturer;
}
void DeviceInfo::setManufacturer(const QString &aManufacturer)
{
iManufacturer = aManufacturer;
}
const QString& DeviceInfo::getModel() const
{
return iModel;
}
void DeviceInfo::setModel(const QString &aModel)
{
iModel = aModel;
}
void DeviceInfo::setOEM( const QString& aOEM )
{
iOEM = aOEM;
}
const QString& DeviceInfo::getOEM() const
{
return iOEM;
}
const QString& DeviceInfo::getFirmwareVersion() const
{
return iFirmwareVersion;
}
void DeviceInfo::setFirmwareVersion(const QString &aFirmwareVersion)
{
iFirmwareVersion = aFirmwareVersion;
}
const QString& DeviceInfo::getSoftwareVersion() const
{
return iSoftwareVersion;
}
void DeviceInfo::setSoftwareVersion(const QString& aSoftwareVersion)
{
iSoftwareVersion = aSoftwareVersion;
}
const QString& DeviceInfo::getHardwareVersion() const
{
return iHardwareVersion;
}
void DeviceInfo::setHardwareVersion(const QString& aHardwareVersion)
{
iHardwareVersion = aHardwareVersion;
}
void DeviceInfo::setDeviceID( const QString& aDeviceID )
{
iDeviceID = aDeviceID;
}
const QString& DeviceInfo::getDeviceID() const
{
return iDeviceID;
}
const QString& DeviceInfo::getDeviceType() const
{
return iDeviceType;
}
void DeviceInfo::setDeviceType(const QString& aDeviceType)
{
iDeviceType = aDeviceType;
}
bool DeviceInfo::readFromFile(const QString &aFileName)
{
FUNCTION_CALL_TRACE(lcSyncMLTrace);
QFile file(aFileName);
if( !file.open(QIODevice::ReadOnly) )
{
qCWarning(lcSyncML) << "Failed open file:" << aFileName;
return false;
}
QXmlStreamReader reader(file.readAll());
while(!reader.atEnd()) {
if(reader.tokenType() == QXmlStreamReader::StartElement) {
if(reader.name() == XML_KEY_MANUFACTURER) {
reader.readNext();
setManufacturer(reader.text().toString());
}else if (reader.name() == XML_KEY_MODEL) {
reader.readNext();
setModel(reader.text().toString());
}else if (reader.name() == XML_KEY_OEM) {
reader.readNext();
setOEM(reader.text().toString());
}else if (reader.name() == XML_KEY_SW_VER){
reader.readNext();
setSoftwareVersion(reader.text().toString());
}else if (reader.name() == XML_KEY_HW_VER) {
reader.readNext();
setHardwareVersion(reader.text().toString());
} else if (reader.name() == XML_KEY_FW_VER) {
reader.readNext();
setFirmwareVersion(reader.text().toString());
} else if(reader.name() == XML_KEY_ID) {
reader.readNext();
setDeviceID(reader.text().toString());
} else if (reader.name() == XML_KEY_DEVICE_TYPE ) {
reader.readNext();
setDeviceType(reader.text().toString());
} else {
qCWarning(lcSyncML) << "Ignoring unknown element:" << reader.name();
}
}
reader.readNext();
}
file.close();
return true;
}
buteo-syncml-0.5.15/src/DeviceInfo.h000066400000000000000000000114221433763642500172130ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef DEVICEINFO_H
#define DEVICEINFO_H
#include
namespace DataSync
{
/*! \brief DeviceInfo includes information about a device
*
*/
class DeviceInfo
{
public:
/*! \brief Constructor
*
*/
DeviceInfo();
/*! \brief Destructor
*
*/
~DeviceInfo();
/*! \brief Sets the device manufacturer
*
* @param aManufacturer Device manufacturer
*/
void setManufacturer( const QString& aManufacturer );
/*! \brief Returns the manufacturer
*
* @return
*/
const QString& getManufacturer() const;
/*! \brief Sets the device model
*
* @param aModel Device model
*/
void setModel( const QString& aModel );
/*! \brief Returns the device model
*
* @return
*/
const QString& getModel() const;
/*! \brief Sets the device OEM
*
* @param aOEM Device OEM
*/
void setOEM( const QString& aOEM );
/*! \brief Returns the OEM
*
* @return
*/
const QString& getOEM() const;
/*! \brief Sets the device firmware version
*
* @param aFirmwareVersion Device firmware version
*/
void setFirmwareVersion( const QString& aFirmwareVersion );
/*! \brief Returns the device firmware version
*
* @return
*/
const QString& getFirmwareVersion() const;
/*! \brief Sets the software version
*
* @param aSoftwareVersion Device software version
*/
void setSoftwareVersion( const QString& aSoftwareVersion );
/*! \brief Returns the device software version
*
* @return
*/
const QString& getSoftwareVersion() const;
/*! \brief Sets the device hardware version
*
* @param aHardwareVersion Device hardware version
*/
void setHardwareVersion( const QString& aHardwareVersion );
/*! \brief Returns the device hardware version
*
* @return
*/
const QString& getHardwareVersion() const;
/*! \brief Sets the device type
*
* Possible device types are enumerated in OMA DS Device
* Information document in section 5.3.7
*
* @param aDeviceType Device type
*/
void setDeviceType( const QString& aDeviceType );
/*! \brief Returns the device type
*
* Possible device types are enumerated in OMA DS Device
* Information document in section 5.3.7
*
* @return
*/
const QString& getDeviceType() const;
/*! \brief Sets the globally unique device identification of this device
*
* @param aDeviceID Device identification
*/
void setDeviceID( const QString& aDeviceID );
/*! \brief Returns the globally unique device identification of this device
*
* @return
*/
const QString& getDeviceID() const;
/*! \brief Read device information from a file
*
* @param aFileName File to read
* @return True on success, otherwise false
*/
bool readFromFile(const QString &aFileName);
private:
QString iDeviceID;
QString iManufacturer;
QString iModel;
QString iOEM;
QString iFirmwareVersion;
QString iSoftwareVersion;
QString iHardwareVersion;
QString iDeviceType;
};
}
#endif // DEVICEINFO_H
buteo-syncml-0.5.15/src/FinalPackage.cpp000066400000000000000000000041251433763642500200420ustar00rootroot00000000000000/*
* This file is part of buteo-syncml package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Sateesh Kavuri