[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/RDB - IZopeDatabaseAdapter.py:1.1 ZopeDatabaseAdapter.py:1.1 __init__.py:1.1 IConnectionService.py:1.2

Stephan Richter srichter@cbu.edu
Mon, 24 Jun 2002 12:13:45 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/RDB
In directory cvs.zope.org:/tmp/cvs-serv15646

Modified Files:
	IConnectionService.py 
Added Files:
	IZopeDatabaseAdapter.py ZopeDatabaseAdapter.py __init__.py 
Log Message:
initial sprint work on the database connection jaunx


=== Added File Zope3/lib/python/Zope/App/RDB/IZopeDatabaseAdapter.py ===
from Interface import Interface

class IZopeDatabaseAdapter(Interface):
    """ interface for persistent object that returns
    volatile IConnections.

    This object is internal to the connection service."""

    def __call__():
        """return an Iconnection object"""



=== Added File Zope3/lib/python/Zope/App/RDB/ZopeDatabaseAdapter.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
# 
##############################################################################
"""The connection adapters contained by ConnectionService.

$Id: ZopeDatabaseAdapter.py,v 1.1 2002/06/24 16:13:44 srichter Exp $
"""

from Zope.Configuration.name import resolve

class ZopeDatabaseAdapter(Persistent):

    __implements__ = IZopeDatabaseAdapter
    _v_connection =  None

    def __init__(self, id, title, factory, user, password, host, database):
        self.id       = id
        self.title    = title
        self.factory  = factory
        self.user     = user
        self.password = password
        self.host     = host
        self.database = database
        
    def __call__(self):

        if self._v_connection is not None:
            return self._v_connection

        factory = resolve(self.factory)
        self._v_connection = factory(user=self.user,
                                     password=self.password,
                                     host=self.host,
                                     database=self.database)
        return self._v_connection

    


=== Added File Zope3/lib/python/Zope/App/RDB/__init__.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
# 
##############################################################################
"""XXX short summary goes here.

XXX longer description goes here.

$Id: __init__.py,v 1.1 2002/06/24 16:13:44 srichter Exp $
"""


=== Zope3/lib/python/Zope/App/RDB/IConnectionService.py 1.1 => 1.2 ===
     def getAvailableConnections():
         """returns the connections known to this connection service"""
-
-