The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XML::DB::DatabaseManager - an approximation to the XML:DB DatabaseManager

SYNOPSIS

use XML::DB::DatabaseManager;

my $driver = 'Xindice'; my $url = 'http://localhost:4080';

eval{ $dbm = new XML::DB::DatabaseManager(); $dbm->registerDatabase($driver); $col = $dbm->getCollection("xmldb:$driver:$url/db/test"); ...... };

if ($@){ die $@; }

deregisterDatabase($driver);

DESCRIPTION

This is the initial class to use to get access to the XML:DB modules, an approximate implementation of the XML:DB API defined for Java at http://www.xmldb.org. This implementation is designed to give a uniform Perl access over XML-RPC to both of the current free native XML databases, eXist and Xindice, as well as providing the same front-end for a plain file-system.

Unlike the DatabaseManager defined in the XML:DB API (which is a Factory), this simply registers driver names, generating a new Database instance for each request. Multiple database drivers can be used simultaneously (eg. to transfer data from one database to another). The drivers themselves are rather confusingly called 'Databases' in this system.

Only one DatabaseManager can be instantiated in a program.

AUTHOR

        Graham Seaman
        CPAN ID: GSEAMAN
        graham@opencollector.org

COPYRIGHT

Copyright (c) 2002 Graham Seaman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

BUGS

SEE ALSO

XML::DB::Collection, XML::DB::Resource, XML::DB::Database, XML::DB::ResourceSet, XML::DB::Resource::XMLResource, XML::DB::Service::XPathQueryService, XML::DB::Service::XUpdateQueryService, XML::DB::Database::File, XML::DB::Database::Xindice, XML::DB::Database::Exist.

PUBLIC METHODS

new

    Usage : $databaseManager = new DatabaseManager;

    Purpose : Constructor for singleton

    Returns : The DatabaseManager

    Argument : None

registerDatabase

    Usage : $databaseManager->registerDatabase($database);

    Purpose : Stores names of database drivers in $self

    Returns : void

    Argument : Database name

deregisterDatabase

    Usage : $databaseManager->deregisterDatabase($driverName);

    Purpose : Remove database driver name from $self

    Returns : void

    Argument : Driver name

getCollection

    Usage : $databaseManager->getCollection($uri, $name, $passwd);

    Purpose : Stores names of database drivers in $self

    Returns : void

    Argument : full uri for a collection

    Comment : username and password are ignored, but here for possible future drivers.

PRIVATE METHODS

_parseURI