Max Berger

Personal information and more...
  • Home
  • Research
  • Teaching
  • OpenSource
  • HOWTOs
  • Security
  • Blog

Home

Research

  • Bibliography

  • SILENUS

  • SyncML

Internal
Prev Chapter 9. Libsyncml Next

Internal

SMLTreeNode

XML defines a standard way to describe tree like structures. To keep them in memory a standard approach is used: each tree node is an object, with a reference to its parent and a list of children.

Figure 9.2. A tree node object

A tree node object

All SyncML packages are internally represented in this tree notation. A tree is represented by a pointer to its head node.

SMLNamespaceContainer

To mix XML documents from different sources, the XML specification defines namespaces. The SyncML protocol itself uses three different namespaces: One for the protocol itself, one for device information, and one for meta information. But these are not the only namespaces that can occur in a package: If the data itself is represented in XML, then it might also have its own tags and namespaces.

Internally, however, a tree node type is not represented by the actual string and its namespace. This would be way to expensive for comparison. Therefore internally a numeric representation is used.

The SMLNamespaceContainer takes care of all this. It maps the numerical representation to its string representation and vice versa. It has all SyncML namespaces built in and extends itself for foreign tags and namespaces.

SMLFlattener

Keeping the tree in memory is nice, but sometimes it has to be sent out to another device or maybe saved to disc. The SMLFlattener is responsible for creating an XML representation of the SyncML package tree. This class can be extended: The SMLNiceFlattener for example takes care of formatting the output with line breaks and indention.

SMLResponsePacket

Before a response package can be sent out, it has to be built first. The SMLResponsePacket class handles the creation of the response packets. It starts out with a reasonable default that can be changed. It also makes sure that the resulting packet conforms with the specification. It even handles such things as the actual sending.

SyncMLParserCallback

This is an interface class for callback from SyncMLParser. It is used so that the actual XML parser can be exchanged, and no other code would have to be changed in the library.

SyncMLParser

The SyncMLParser class is an adapter for an XML parser. It currently uses Libxml from the gnome project. But it is planned to also support Xerces (from the Apache project) in the future.

SMLSession

The SMLSession class does the actual session handling. It knows about the incoming and outgoing connection. It receives the SyncML commands and calls the appropriate functions from the session handler or the database adapter. It is also responsible for error handling.


Prev Up Next
User visible Home Chapter 10. Sync Server Engine
Content copyright Jun 2018 by Max Berger Design: TEMPLATED Images: Unsplash (CC0) Privacy Policy