blackboard.persist
Interface Container

All Known Implementing Classes:
DatabaseContainer, RemoteDbContainer

public interface Container

The Container interface provides the basic framework for defining a "data source" against which the persistence framework can operate. A "data source" is a place from which data can be pulled or to which data can be pushed. An example container would be a database.

Since:
Bb 5.5
Version:
$Revision: #1 $ $Date: 2005/06/27 $
See Also:
BbPersistenceManager

Method Summary
 Id generateId(DataType dataType, int nKey1)
          Generates an Id instance specific to this Container.
 Id generateId(DataType dataType, int nKey1, int nKey2)
          Generates an Id instance specific to this Container.
 Id generateId(DataType dataType, java.lang.String strKey)
          Generates an Id instance specific to this Container.
 AppVersion getAppVersion()
          Return the AppVersion associated with this Container .
 boolean isValidId(Id id)
          Determines if the provided Id is a "valid" id for this Container.
 

Method Detail

getAppVersion

AppVersion getAppVersion()
Return the AppVersion associated with this Container . When an AppVersion object is associated with a Container is serves as a default AppVersion for subsequent calls into the persistence framework.

Returns:
the AppVersion defined for this container

generateId

Id generateId(DataType dataType,
              java.lang.String strKey)
              throws PersistenceException
Generates an Id instance specific to this Container. The format of the provided string is determined by the container type and should be of the form produced by the toExternalString() method on the Ids generated through the container. The resulting Id will be valid to use in a load operation from a persistence manager associated with this Contaienr.

Parameters:
dataType - the DataType of the object that the generated Id instance will refer to
strKey - the String value to use when generating the key value of the Id instance
Returns:
an Id implementation instance, appropriate to this Container, whose key value is generated from the given value
Throws:
PersistenceException - if this container does not support the creation of an Id using the given key argument
See Also:
Id.toExternalString()

generateId

Id generateId(DataType dataType,
              int nKey1,
              int nKey2)
              throws PersistenceException
Generates an Id instance specific to this Container. The key value created from the provided integer key values is determined by the container type. The resulting Id will be valid to use in a load operation from a persistence manager associated with this Container.

Parameters:
dataType - the DataType of the object that the generated Id instance will refer to
nKey1 - an integer value to use when generating the key value of the Id instance
nKey2 - another integer value to use when generating the key value of the Id instance
Returns:
an Id implementation instance, appropriate to this Container, whose key value is generated from the given integer values
Throws:
PersistenceException - if this container does not support the creation of an Id using the given key arguments

generateId

Id generateId(DataType dataType,
              int nKey1)
              throws PersistenceException
Generates an Id instance specific to this Container. The key value created from the provided integer key values is determined by the container type. The resulting Id will be valid to use in a load operation from a persistence manager associated with this Contaienr.

Parameters:
dataType - the DataType of the object that the generated Id instance will refer to
nKey1 - an integer value to use when generating the key value of the Id instance
Returns:
an Id implementation instance, appropriate to this Container, whose key value is generated from the given integer values
Throws:
PersistenceException - if this container does not support the creation of an Id using the given key arguments

isValidId

boolean isValidId(Id id)
Determines if the provided Id is a "valid" id for this Container.

An Id is considered valid for this Container if it is "set" (see Id.isSet()), if it originates from this container, and if it is an instance of the appropriate Id subclass for this container.

Parameters:
id - the Id to examine for validity
Returns:
true is the provided id is a valid id for this container, false otherwise


Copyright © 2003 Blackboard, Inc. All Rights Reserved.