[Zope-CVS] CVS: Products/AdaptableStorage/mapper/interfaces - IAspectEvent.py:1.1 IAspectSerializer.py:1.1 IClassifier.py:1.1 IConfigurableObjectMapper.py:1.1 IDeserializationEvent.py:1.1 IFullDeserializationEvent.py:1.1 IFullSerializationEvent.py:1.1 IGateway.py:1.1 IKeychainGenerator.py:1.1 IKeyedObjectSystem.py:1.1 IMapperEvent.py:1.1 IObjectMapper.py:1.1 IObjectSerializer.py:1.1 ISchema.py:1.1 ISerializationEvent.py:1.1 ITPCConnection.py:1.1 __init__.py:1.1 public.py:1.1

Shane Hathaway shane@zope.com
Tue, 31 Dec 2002 16:47:48 -0500


Update of /cvs-repository/Products/AdaptableStorage/mapper/interfaces
In directory cvs.zope.org:/tmp/cvs-serv18282/mapper/interfaces

Added Files:
	IAspectEvent.py IAspectSerializer.py IClassifier.py 
	IConfigurableObjectMapper.py IDeserializationEvent.py 
	IFullDeserializationEvent.py IFullSerializationEvent.py 
	IGateway.py IKeychainGenerator.py IKeyedObjectSystem.py 
	IMapperEvent.py IObjectMapper.py IObjectSerializer.py 
	ISchema.py ISerializationEvent.py ITPCConnection.py 
	__init__.py public.py 
Log Message:
Changed the name of the "serial" package to "mapper".  It's a more
appropriate name, since mappers are the focus of this software.

Sorry about the flood of checkins.


=== Added File Products/AdaptableStorage/mapper/interfaces/IAspectEvent.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.
#
##############################################################################
"""Aspect-related event interface base.

$Id: IAspectEvent.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from IMapperEvent import IMapperEvent

class IAspectEvent (IMapperEvent):

    def getKeyedObjectSystem():
        """Returns the IKeyedObjectSystem that generated the event."""

    def getObject():
        """Returns the object being (de)serialized."""

    def setAspectName(name):
        """Sets the name of the aspect being (de)serialized."""

    def getAspectName():
        """Returns the name of the aspect being (de)serialized."""

    def addUnmanagedPersistentObjects(obs):
        """Notifies that there are unmanaged persistent objects in the object.

        If no attention is paid to unmanaged persistent objects, they
        will not notify ZODB when they are changed, and hence can be a
        challenge for the application programmer.  Use this method to
        tell ZODB about the unmanaged persistent objects so that ZODB
        can deal with them specially.
        """

    def getUnmanagedPersistentObjects():
        """Returns the list of unmanaged persistent objects."""



=== Added File Products/AdaptableStorage/mapper/interfaces/IAspectSerializer.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.
#
##############################################################################
"""Serialization / deserialization interfaces.

$Id: IAspectSerializer.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface

class IAspectSerializer(Interface):
    """Object aspect serializer / deserializer"""

    def getSchema():
        """Returns the schema of records (de)serialized by this aspect.
        """

    def serialize(object, event):
        """Returns the state of this aspect of the object.

        Use the ISerializationEvent to set up internal and external
        references.
        """

    def deserialize(object, event, state):
        """Fills in the state of this aspect of the object.

        Use the IDeserializationEvent to resolve external references.
        Returns nothing.
        """



=== Added File Products/AdaptableStorage/mapper/interfaces/IClassifier.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.
#
##############################################################################
"""Classifier interface.

$Id: IClassifier.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface

class IClassifier(Interface):
    """Object classifier

    Implementations of this interface are a little like biologists.
    During serialization, the classifyObject() method returns a
    mapping containing the classification of subob (like a biologist
    identifying a creature's genus and species).  During
    deserialization, the classifyState() method decides what kind of
    objects to create for a stored state (like a biologist showing you
    a creature of a certain genus and species).

    The keys in the classification mapping are implementation-dependent.
    """

    def classifyObject(value, keychain):
        """Returns a classification and mapper_name.
        """

    def classifyState(event):
        """Returns a classification and mapper_name.

        event is an IMapperEvent.

        May load the classification from storage.
        """

    def store(event, classification):
        """Stores the classification of an object.

        event is an IMapperEvent.
        """


=== Added File Products/AdaptableStorage/mapper/interfaces/IConfigurableObjectMapper.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.
#
##############################################################################
"""Object mapper configuration interface

$Id: IConfigurableObjectMapper.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from IObjectMapper import IObjectMapper


class IConfigurableObjectMapper (IObjectMapper):
    """Adds operations to IObjectMapper for configuration.
    """

    def setSerializer(s):
        """Sets the IObjectSerializer for this mapper."""

    def setGateway(g):
        """Returns the IGateway for this mapper."""

    def setClassifier(c):
        """Sets the IClassifier for this mapper."""

    def setKeychainGenerator(k):
        """Sets the IKeychainGenerator for subobjects."""

    def setVolatile(v):
        """Sets the volatile flag for this mapper."""

    def addSubMapper(name, m=None, replace=0):
        """Adds a named sub-IObjectMapper, returning the mapper added.

        If m is None, a default IConfigurableObjectMapper
        implementation is created.  If replace is not set,
        the implemenation prevents overriding an existing mapper.
        """

    def checkConfiguration(names=(), recursive=1):
        """Verifies the mapper configuration is sane.

        Raises an exception if there are errors.

        'names' gives the path to the mapper, for debugging purposes.
        'recursive' can be turned off to not descend into sub-mappers.
        """



=== Added File Products/AdaptableStorage/mapper/interfaces/IDeserializationEvent.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.
#
##############################################################################
"""Deserialization event interface.

$Id: IDeserializationEvent.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from IAspectEvent import IAspectEvent


class IDeserializationEvent(IAspectEvent):
    """Aspect deserializers call methods of this interface to restore
    internal and external references.
    """

    def notifyDeserialized(name, value):
        """Indicates that a named internal subobject was deserialized.
        """

    def dereference(name, keychain, mapper_names=None):
        """Retrieves a referenced subobject (usually ghosted initially).
        """



=== Added File Products/AdaptableStorage/mapper/interfaces/IFullDeserializationEvent.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.
#
##############################################################################
"""Full deserialization event interface.

$Id: IFullDeserializationEvent.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from IDeserializationEvent import IDeserializationEvent


class IFullDeserializationEvent(IDeserializationEvent):
    """Deserialization event with features for deserializing internal refs
    """

    def loadInternalRef(ref):
        """Returns an object for a reference of the form (aspect_name, name).
        """



=== Added File Products/AdaptableStorage/mapper/interfaces/IFullSerializationEvent.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.
#
##############################################################################
"""Full serialization event interface.

$Id: IFullSerializationEvent.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from ISerializationEvent import ISerializationEvent


class IFullSerializationEvent(ISerializationEvent):
    """Serialization event with features for ensuring complete serialization
    """

    def getSerializedAttributeNames():
        """Returns the name of all attributes serialized."""

    def getInternalRef(ob):
        """Returns (aspect_name, name) or None."""



=== Added File Products/AdaptableStorage/mapper/interfaces/IGateway.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.
#
##############################################################################
"""Gateway interface declaration

$Id: IGateway.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface


class IGateway (Interface):
    """Loads and stores data by keychain.

    Implementations can store in entire tables, pieces of tables, translate
    for storage in joined tables, or store in some entirely different way.

    Based on _Patterns of Enterprise Application Architecture_
    by Martin Fowler.
    """

    def getSchema():
        """Returns the ISchema of data stored by this gateway.

        See serial.interfaces.ISchema.
        """

    def load(event):
        """Loads data.

        event is an IMapperEvent.

        Returns a pair containing the data and an object that acts as
        a serial number or a hash of the data.  The serial number is
        either a time stamp or some other object that can be
        consistently compared to detect conflicts.  The serial must be
        hashable.
        """

    def store(event, data):
        """Stores data.

        event is an IMapperEvent.

        Returns a new serial.
        """



=== Added File Products/AdaptableStorage/mapper/interfaces/IKeychainGenerator.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.
#
##############################################################################
"""Keychain generator interface

$Id: IKeychainGenerator.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface


class IKeychainGenerator (Interface):
    """A utility for generating sub-keychains.
    """

    def makeKeychain(event, name, stored):
        """Returns a new keychain.

        event is an IMapperEvent.

        name is the name of the subobject.

        stored is a flag indicating whether the returned keychain will
        be stored.  If it will not be stored, the generated keychain
        can not be a random label.
        """


=== Added File Products/AdaptableStorage/mapper/interfaces/IKeyedObjectSystem.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.
#
##############################################################################
"""IKeyedObjectSystem interface

$Id: IKeyedObjectSystem.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface

class IKeyedObjectSystem (Interface):
    """A collection of objects identifiable by keychain."""

    def loadStub(keychain, hints=None):
        """Returns a class instance, possibly ghosted.

        hints, a mapping, may be provided as an optimization.
        Without it, implementations of this method may have to load a
        full object rather than a ghosted object.

        Some hints may be:

        classification
        mapper_name (the mapper name for the last item in the keychain)
        mapper_names (a list of all mapper names)
        """

    def identifyObject(object):
        """Returns the keychain of an object.

        Returns None if the object is not in the keyed object system.
        """

    def newKey():
        """Returns a new, unique key (which might be used in a keychain)."""


=== Added File Products/AdaptableStorage/mapper/interfaces/IMapperEvent.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.
#
##############################################################################
"""Mapper event interface.

$Id: IMapperEvent.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface

class IMapperEvent (Interface):

    def getObjectMapper():
        """Returns the object mapper for the object being (de)serialized."""

    def getKeychain():
        """Returns the keychain of the object being (de)serialized."""

    def makeKeychain(name, stored):
        """Generates a keychain for a subobject.
        """


=== Added File Products/AdaptableStorage/mapper/interfaces/IObjectMapper.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.
#
##############################################################################
"""Object mapper interface

$Id: IObjectMapper.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface


class IObjectMapper (Interface):
    """A hub for operations involved in mapping a certain kind of object.
    """

    def getSerializer():
        """Returns the IObjectSerializer for this mapper."""

    def getGateway():
        """Returns the IGateway for this mapper."""

    def getClassifier():
        """Returns the IClassifier for objects referenced by this mapper.

        If this mapper references no other objects, it's safe to
        return None.
        """

    def getSubMapper(name):
        """Returns the named sub-IObjectMapper.

        The name of a sub-mapper is chosen by either a classifier or
        an aspect.
        """

    def getKeychainGenerator():
        """Returns the IKeychainGenerator for subobjects.

        Some serializers and gateways make use of this.  If no serializer
        or gateway needs this, it's safe to return None.
        """

    def isVolatile():
        """Returns true if objects should last only one transaction."""



=== Added File Products/AdaptableStorage/mapper/interfaces/IObjectSerializer.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.
#
##############################################################################
"""Serialization / deserialization interfaces.

$Id: IObjectSerializer.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface


class IObjectSerializer(Interface):
    """Serializes/deserializes objects.

    The serialized state does not need to include the class of the object,
    which is maintained separately.
    """

    def getSchema():
        """Returns the schema of states (de)serialized by this object.
        """

    def canSerialize(object):
        """Returns true if this mapper can serialize the given object.
        """

    def serialize(object, event):
        """Returns the serialization of an object.

        Returns a pair containing the serialized state of the object
        and a list of externally referenced objects of the form
        (keychain, object).  The serialized state should be a
        dictionary mapping aspect names to the serialization of the
        corresponding aspects.
        """

    def deserialize(object, event, full_state):
        """Fills an object based on a previously serialized state.
        """

    def createEmptyInstance(classification=None):
        """Returns a new instance.

        If this serializer works with instances of only one class,
        createEmptyInstance() should not require the use of the
        classification argument.  Implementations that need the
        classification argument can return None when classification is
        None, but doing so may incur a performance penalty.
        """



=== Added File Products/AdaptableStorage/mapper/interfaces/ISchema.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.
#
##############################################################################
"""Data schema interface.

$Id: ISchema.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface

class ISchema(Interface):
    """Data schema"""

    def __eq__(other):
        """Checks equality with another schema.

        The idea is that serializers and data gateways need to agree
        on schemas, and this method allows you to check compatibility.
        """


=== Added File Products/AdaptableStorage/mapper/interfaces/ISerializationEvent.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.
#
##############################################################################
"""Serialization event interface.

$Id: ISerializationEvent.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from IAspectEvent import IAspectEvent


class ISerializationEvent(IAspectEvent):
    """Serialization event.

    Aspect serializers call methods of this interface to create
    internal and external references.
    """

    def notifySerialized(name, value, is_attribute):
        """Indicates that a named internal subobject was serialized.

        This allows a 'remainder pickler' to refer to subobjects by name.
        Be careful to unwrap acquisition and/or context wrappers around
        subob before calling this method.
        """

    def identifyObject(value):
        """Returns the keychain of an existing object.

        Returns None if the object is not yet known.
        """

    def notifySerializedRef(name, value, is_attribute, keychain):
        """Indicates that a reference to an external subobject was serialized.

        TODO: write more here. ;-)
        """

    def ignoreAttribute(name):
        """Indicates that an attribute should be ignored when storing."""

    def getExternalRefs():
        """Returns the list of external references.

        The returned list is of the form [(keychain, subobject)].
        """


=== Added File Products/AdaptableStorage/mapper/interfaces/ITPCConnection.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.
#
##############################################################################
"""Interface for transaction participants.

$Id: ITPCConnection.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from Interface import Interface

class ITPCConnection(Interface):

    def connect():
        """Opens any resources needed for transactions.  Called only once."""

    def sortKey():
        """Returns a sort key for consistent ordering."""

    def getName():
        """Returns a human-readable name."""

    def begin():
        """Called before the first phase of two-phase commit."""

    def vote():
        """Called upon transition to the second phase of two-phase commit."""

    def abort():
        """Aborts the transaction."""

    def finish():
        """Commits the transaction."""

    def close():
        """Closes resources.  Called only once."""



=== Added File Products/AdaptableStorage/mapper/interfaces/__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.
#
##############################################################################
"""Serialization framework interfaces package

$Id: __init__.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""


=== Added File Products/AdaptableStorage/mapper/interfaces/public.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.
#
##############################################################################
"""Public interfaces

$Id: public.py,v 1.1 2002/12/31 21:47:46 shane Exp $
"""

from IAspectEvent import IAspectEvent
from IAspectSerializer import IAspectSerializer
from IClassifier import IClassifier
from IConfigurableObjectMapper import IConfigurableObjectMapper
from IDeserializationEvent import IDeserializationEvent
from IFullDeserializationEvent import IFullDeserializationEvent
from IFullSerializationEvent import IFullSerializationEvent
from IGateway import IGateway
from IKeychainGenerator import IKeychainGenerator
from IKeyedObjectSystem import IKeyedObjectSystem
from IMapperEvent import IMapperEvent
from IObjectMapper import IObjectMapper
from IObjectSerializer import IObjectSerializer
from ISchema import ISchema
from ISerializationEvent import ISerializationEvent
from ITPCConnection import ITPCConnection