org.apache.cocoon.components.source.impl
Class XMLDBSourceFactory

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.source.impl.XMLDBSourceFactory
All Implemented Interfaces:
Configurable, LogEnabled, ThreadSafe, SourceFactory

public final class XMLDBSourceFactory
extends AbstractLogEnabled
implements SourceFactory, Configurable, ThreadSafe

This class implements the xmldb:// pseudo-protocol and allows to get XML content from an XML:DB enabled XML database.

The configuration of this protocol is as follows:

   <source-factory name="xmldb" src="org.apache.cocoon.components.source.impl.XMLDBSourceFactory>
     <driver type="foo" class="org.foomaker.FooXMLDBDriver"
             user="scott" password="tiger"
             collection="//localhost:8080/foo/base-path/"/>
     <driver...
   <source-factory>
 

The type attribute indicates the database type that will be used for URLs (e.g. xmldb:foo:/path/). The collection attribute specifies a base collection for paths that do not start with "//".

The returned sources are traversable, modifiable and xml-izable.

Version:
CVS $Id: XMLDBSourceFactory.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
protected  HashMap baseMap
          An optional base collection for each of the drivers
protected  HashMap credentialMap
          A Map containing the authentication credentials
 
Fields inherited from interface org.apache.excalibur.source.SourceFactory
ROLE
 
Constructor Summary
XMLDBSourceFactory()
           
 
Method Summary
 void configure(Configuration conf)
          Configure the instance and initialize XML:DB connections (load and register the drivers).
 Source getSource(String location, Map parameters)
          Resolve the source
 void release(Source source)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

credentialMap

protected HashMap credentialMap
A Map containing the authentication credentials


baseMap

protected HashMap baseMap
An optional base collection for each of the drivers

Constructor Detail

XMLDBSourceFactory

public XMLDBSourceFactory()
Method Detail

configure

public void configure(Configuration conf)
               throws ConfigurationException
Configure the instance and initialize XML:DB connections (load and register the drivers).

Specified by:
configure in interface Configurable
Throws:
ConfigurationException

getSource

public Source getSource(String location,
                        Map parameters)
                 throws MalformedURLException,
                        IOException
Resolve the source

Specified by:
getSource in interface SourceFactory
Throws:
MalformedURLException
IOException

release

public void release(Source source)
Specified by:
release in interface SourceFactory


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.