tiger.broker
Class PersistBroker

java.lang.Object
  |
  +--tiger.broker.PersistBroker

public class PersistBroker
extends java.lang.Object

The PersistBroker have the responibility for finding and storing persistent objects.

Author:
Fredrik Bertilsson

Constructor Summary
PersistBroker(LocalObjectBase anObjectBase, java.lang.String aPath)
           
 
Method Summary
 void bind(RelationMetaData aRelation, ID anID1, ID anID2)
          Binds two objects together.
 void close()
          Closes this broker.
 void commitChanges(Transaction aTrans)
          Commits changes to the object store.
 PersistObject createObject(ID anID)
          Creates a persistent object with the given id.
 void deleteObject(ID anID)
          Deletes the object given by the id.
 ObjectSet findAll(java.lang.String aClassname)
          Returns all objects for the given class.
 ObjectSet findByIndex(java.lang.String aClassname, java.lang.String aIndexname, java.lang.Comparable aFromKey, java.lang.Comparable aToKey)
          Returns the objects that have index values between given start and stop value.
 PersistObject findByUniqueIndex(java.lang.String aClassname, java.lang.String aIndexname, java.lang.Comparable aKey)
          Returns the object given by a index value for a unique index.
 ObjectSet findChildren(PersistObject anObj, java.lang.String anAggregatename)
          Returns the childs, given by the aggregatename, to the given object.
 PersistObject findObject(ID anID)
          Returns the persistent object that have the specified id.
 ObjectSet findObjects(ID aStartID, ID aStopID)
          Returns the persistent objects that have a id between the specified start and stop id.
 PersistObject findParent(PersistObject anObj, java.lang.String anAggregatename)
          Returns the parent, given by the aggregatename, of the given object.
 PersistObject findRelatedObject(ID anID, java.lang.String aRelationname)
          Returns the related object, given the relationname, to the object the the given id.
 PersistObject findRelatedObject(PersistObject anObj, java.lang.String aRelationname)
          Returns the related objects, given the relationname, to the object the the given id.
 ObjectSet findRelatedObjects(ID anID, java.lang.String aRelationname)
           
 ObjectSet findRelatedObjects(PersistObject anObj, java.lang.String aRelationname)
           
 ObjectStore getObjectStore()
           
 void recover(TransactionLog aLog)
           
 void save(PersistObject anObj)
          Saves the given persistent object.
 void unbind(RelationMetaData aRelation, ID anID1, ID anID2)
          Unbinds two objects together.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistBroker

public PersistBroker(LocalObjectBase anObjectBase,
                     java.lang.String aPath)
Method Detail

findObject

public PersistObject findObject(ID anID)
Returns the persistent object that have the specified id.


findObjects

public ObjectSet findObjects(ID aStartID,
                             ID aStopID)
Returns the persistent objects that have a id between the specified start and stop id.


createObject

public PersistObject createObject(ID anID)
Creates a persistent object with the given id.


save

public void save(PersistObject anObj)
Saves the given persistent object.


findParent

public PersistObject findParent(PersistObject anObj,
                                java.lang.String anAggregatename)
Returns the parent, given by the aggregatename, of the given object.


findChildren

public ObjectSet findChildren(PersistObject anObj,
                              java.lang.String anAggregatename)
Returns the childs, given by the aggregatename, to the given object.


findRelatedObject

public PersistObject findRelatedObject(ID anID,
                                       java.lang.String aRelationname)
Returns the related object, given the relationname, to the object the the given id.


findRelatedObject

public PersistObject findRelatedObject(PersistObject anObj,
                                       java.lang.String aRelationname)
Returns the related objects, given the relationname, to the object the the given id.


findRelatedObjects

public ObjectSet findRelatedObjects(ID anID,
                                    java.lang.String aRelationname)

findRelatedObjects

public ObjectSet findRelatedObjects(PersistObject anObj,
                                    java.lang.String aRelationname)

findByIndex

public ObjectSet findByIndex(java.lang.String aClassname,
                             java.lang.String aIndexname,
                             java.lang.Comparable aFromKey,
                             java.lang.Comparable aToKey)
Returns the objects that have index values between given start and stop value. The flag tells if the interval should be considered as open or closed.


findByUniqueIndex

public PersistObject findByUniqueIndex(java.lang.String aClassname,
                                       java.lang.String aIndexname,
                                       java.lang.Comparable aKey)
Returns the object given by a index value for a unique index.


findAll

public ObjectSet findAll(java.lang.String aClassname)
Returns all objects for the given class.


bind

public void bind(RelationMetaData aRelation,
                 ID anID1,
                 ID anID2)
Binds two objects together.


unbind

public void unbind(RelationMetaData aRelation,
                   ID anID1,
                   ID anID2)
Unbinds two objects together.


deleteObject

public void deleteObject(ID anID)
Deletes the object given by the id.


commitChanges

public void commitChanges(Transaction aTrans)
Commits changes to the object store.


recover

public void recover(TransactionLog aLog)

close

public void close()
Closes this broker.


getObjectStore

public ObjectStore getObjectStore()