Amsterdam Xindice 1.0-RC1 API

Xindice XML db adapter, and amsterdam services that uses the adapter.

See:
          Description

Packages
org.backsource.xindice Xindice XML db adapter, and amsterdam services that uses the adapter.
org.backsource.xindice.cursor Cursors for XML:DB ResourseSet.
org.backsource.xindice.server An embedded version of Xindice server to be used in JBoss.

 

Xindice XML db adapter, and amsterdam services that uses the adapter.

This package contains two primary things: an adapter layer against an XML:DB database - currently only tested with Xindice - and a small framework to easilly be able to work with Xindice from Amsterdam

Xindice adapter layer

The adapter XindiceAdapter is a thin wrapper above the XML:DB and Xindice api for accessing a collection. It is much like a JDBC connection, with the exception that it is a connection to a colection and not a complete database.

There is also a simple "one" pool XindicePool. This is a collection pool, which does only ever create one instance of an XindiceAdapter for each colecxtion. If two or more threads wants to work against the same collection, they have to wait until the first thread have left the adapter back into the pool. A pool always cover a base collection expressed as an xindice url: xmldb:xindice:///db. To get a connection to the base collection use "/" as the collection name, to get a connection to a child collection use the name of the child. The adapter does however not work with children och children: that would require another pool implementation.

To make it a little bit easier to work with the xmldb ResourceSet that queries seturn a Cursor interface has been added, see org.backsource.xindice.cursor.

Amsterdam layer

Above the adapter layer we have a prebuilt Amsterdam layer to make it a little bit easier in working with Xindice from Amsterdam. The focus is on building filters and publishers, but there is nothing stoping you from also building an XindiceProtocolHandler.

Since a ServiceFilter and a Publisher in Amsterdam share much of their characteristics, we have chosen to make our base components possible to work both as filter and publisher.The base of this is AmsterdamXindiceBase. This is a baseclass for both filters and publishers, and it helps setting up an XindicePoll and configure wich collections to work againts: either it works agains one preconfigured collections or it fetches the names of the collection(s) to work with from the incomming message through an Xpath expression. When subclassing its possible to use the AmsterdamXindiceBase.getCollections(org.w3c.dom.Document, boolean) method to get the collections to work with. It is then possible to owerride both AmsterdamXindiceBase.getCollectionName(java.lang.String) to map collections names and AmsterdamXindiceBase.validateCollection(java.lang.String, boolean) to chose if the given collection should really be worked on. It also has a helper method to get a DOM Document from the servcice message while retaining the original content in the service message.

The package currently contains two prebuild Amsterdam channel components. The first is a filter to manage collections: AmsterdamXindiceManagementFilter. With this you can prune your collections and keep the size of the database down. The other is a component that writes documents to collections, which may be used both as a filter and a publisher; AmsterdamXindicePublisher.



Copyright © 2003-2004 Backsource. All Rights Reserved.