net.wotonomy.control
Class EOObjectStoreCoordinator

java.lang.Object
  extended by net.wotonomy.control.EOObjectStore
      extended by net.wotonomy.control.EOObjectStoreCoordinator

public class EOObjectStoreCoordinator
extends EOObjectStore

A representation of a channel of communication to the database.

Version:
$Revision: 894 $
Author:
cgruber@israfil.net, $Author: cgruber $

Field Summary
static java.lang.String CooperatingObjectStoreNeededNotification
           
static java.lang.String CooperatingObjectStoreWasAddedNotification
           
static java.lang.String CooperatingObjectStoreWasRemovedNotification
           
static java.lang.String FetchSpecificationKey
           
static java.lang.String GlobalIDKey
           
static java.lang.String ObjectKey
           
 
Fields inherited from class net.wotonomy.control.EOObjectStore
DeletedKey, InsertedKey, InvalidatedAllObjectsInStoreNotification, InvalidatedKey, ObjectsChangedInStoreNotification, UpdatedKey
 
Constructor Summary
EOObjectStoreCoordinator()
           
 
Method Summary
 void _invalidatedAllObjectsInSubStore(net.wotonomy.foundation.NSNotification nsnotification)
           
 void _objectsChangedInSubStore(net.wotonomy.foundation.NSNotification nsnotification)
           
 void addCooperatingObjectStore(EOCooperatingObjectStore eocooperatingobjectstore)
           
 net.wotonomy.foundation.NSArray arrayFaultWithSourceGlobalID(EOGlobalID eoglobalid, java.lang.String s, EOEditingContext eoeditingcontext)
          Returns a List of objects associated with the object with the specified id for the specified property relationship, or may return a placeholder array that will defer the fetch until accessed (an array fault).
 net.wotonomy.foundation.NSArray cooperatingObjectStores()
           
static EOObjectStoreCoordinator defaultCoordinator()
           
 void dispose()
           
 void editingContextDidForgetObjectWithGlobalID(EOEditingContext eoeditingcontext, EOGlobalID eoglobalid)
          Called by editing contexts when they no longer need to track the specified id.
 java.lang.Object faultForGlobalID(EOGlobalID eoglobalid, EOEditingContext eoeditingcontext)
          Returns the object for the specified id.
 java.lang.Object faultForRawRow(java.util.Map aDictionary, java.lang.String anEntityName, EOEditingContext aContext)
          Returns a fault representing an object of the specified entity type with values from the specified dictionary.
 java.lang.Object faultForRawRow(net.wotonomy.foundation.NSDictionary nsdictionary, java.lang.String s, EOEditingContext eoeditingcontext)
           
 void forwardUpdateForObject(EOEnterpriseObject eoenterpriseobject, net.wotonomy.foundation.NSDictionary nsdictionary)
           
 void initializeObject(java.lang.Object anObject, EOGlobalID aGlobalID, EOEditingContext aContext)
          Given a newly instantiated object, this method initializes its properties to values appropriate for the specified id.
 void invalidateAllObjects()
          Remove all values from all objects in memory, turning them into faults, and posts an NSNotification that all objects have been invalidated.
 void invalidateObjectsWithGlobalIDs(java.util.List aList)
          Removes values with the specified ids from memory, turning them into faults, and posts a notification that those objects have been invalidated.
 void invalidateObjectsWithGlobalIDs(net.wotonomy.foundation.NSArray nsarray)
           
 boolean isObjectLockedWithGlobalID(EOGlobalID eoglobalid, EOEditingContext eoeditingcontext)
          Returns whether the object corresponding to the specified id is locked.
 void lockObjectWithGlobalID(EOGlobalID eoglobalid, EOEditingContext eoeditingcontext)
          Locks the object corresponding to the specified id is locked.
 net.wotonomy.foundation.NSArray objectsForSourceGlobalID(EOGlobalID eoglobalid, java.lang.String s, EOEditingContext eoeditingcontext)
          Returns a List of objects associated with the object with the specified id for the specified property relationship.
 EOCooperatingObjectStore objectStoreForFetchSpecification(EOFetchSpecification eofetchspecification)
           
 EOCooperatingObjectStore objectStoreForGlobalID(EOGlobalID eoglobalid)
           
 EOCooperatingObjectStore objectStoreForObject(EOEnterpriseObject eoenterpriseobject)
           
 net.wotonomy.foundation.NSArray objectsWithFetchSpecification(EOFetchSpecification eofetchspecification, EOEditingContext eoeditingcontext)
          Returns a List of objects the meet the criteria of the supplied specification.
 void refaultObject(java.lang.Object anObject, EOGlobalID aGlobalID, EOEditingContext aContext)
          Removes all values from the specified object, converting it into a fault for the specified id.
 void removeCooperatingObjectStore(EOCooperatingObjectStore eocooperatingobjectstore)
           
 void saveChangesInEditingContext(EOEditingContext eoeditingcontext)
          Writes all changes in the specified editing context to the respository.
static void setDefaultCoordinator(EOObjectStoreCoordinator eoobjectstorecoordinator)
           
 void setUserInfo(net.wotonomy.foundation.NSDictionary nsdictionary)
           
 net.wotonomy.foundation.NSDictionary userInfo()
           
 net.wotonomy.foundation.NSDictionary valuesForKeys(net.wotonomy.foundation.NSArray nsarray, EOEnterpriseObject eoenterpriseobject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CooperatingObjectStoreWasAddedNotification

public static final java.lang.String CooperatingObjectStoreWasAddedNotification
See Also:
Constant Field Values

CooperatingObjectStoreWasRemovedNotification

public static final java.lang.String CooperatingObjectStoreWasRemovedNotification
See Also:
Constant Field Values

CooperatingObjectStoreNeededNotification

public static final java.lang.String CooperatingObjectStoreNeededNotification
See Also:
Constant Field Values

GlobalIDKey

public static final java.lang.String GlobalIDKey
See Also:
Constant Field Values

FetchSpecificationKey

public static final java.lang.String FetchSpecificationKey
See Also:
Constant Field Values

ObjectKey

public static final java.lang.String ObjectKey
See Also:
Constant Field Values
Constructor Detail

EOObjectStoreCoordinator

public EOObjectStoreCoordinator()
Method Detail

defaultCoordinator

public static EOObjectStoreCoordinator defaultCoordinator()

setDefaultCoordinator

public static void setDefaultCoordinator(EOObjectStoreCoordinator eoobjectstorecoordinator)

dispose

public void dispose()

cooperatingObjectStores

public net.wotonomy.foundation.NSArray cooperatingObjectStores()

addCooperatingObjectStore

public void addCooperatingObjectStore(EOCooperatingObjectStore eocooperatingobjectstore)

removeCooperatingObjectStore

public void removeCooperatingObjectStore(EOCooperatingObjectStore eocooperatingobjectstore)

objectStoreForGlobalID

public EOCooperatingObjectStore objectStoreForGlobalID(EOGlobalID eoglobalid)

objectStoreForObject

public EOCooperatingObjectStore objectStoreForObject(EOEnterpriseObject eoenterpriseobject)

objectStoreForFetchSpecification

public EOCooperatingObjectStore objectStoreForFetchSpecification(EOFetchSpecification eofetchspecification)

forwardUpdateForObject

public void forwardUpdateForObject(EOEnterpriseObject eoenterpriseobject,
                                   net.wotonomy.foundation.NSDictionary nsdictionary)

valuesForKeys

public net.wotonomy.foundation.NSDictionary valuesForKeys(net.wotonomy.foundation.NSArray nsarray,
                                                          EOEnterpriseObject eoenterpriseobject)

saveChangesInEditingContext

public void saveChangesInEditingContext(EOEditingContext eoeditingcontext)
Description copied from class: EOObjectStore
Writes all changes in the specified editing context to the respository. The object store is expected to post a notification that should be named with the string constant ObjectsChangedInStoreNotification with this object store as the object and user info containing keys named UpdatedKey, InsertedKey, and DeletedKey that return Lists of the EOGlobalIDs of the corresponding objects.

Specified by:
saveChangesInEditingContext in class EOObjectStore

objectsWithFetchSpecification

public net.wotonomy.foundation.NSArray objectsWithFetchSpecification(EOFetchSpecification eofetchspecification,
                                                                     EOEditingContext eoeditingcontext)
Description copied from class: EOObjectStore
Returns a List of objects the meet the criteria of the supplied specification. Faults are not allowed in the array. Each object is registered with the specified editing context. If any object is already fetched in the specified context, it is not refetched and that object should be used in the array.

Specified by:
objectsWithFetchSpecification in class EOObjectStore

isObjectLockedWithGlobalID

public boolean isObjectLockedWithGlobalID(EOGlobalID eoglobalid,
                                          EOEditingContext eoeditingcontext)
Description copied from class: EOObjectStore
Returns whether the object corresponding to the specified id is locked. The concept of object locking is implementation-specific.

Specified by:
isObjectLockedWithGlobalID in class EOObjectStore

lockObjectWithGlobalID

public void lockObjectWithGlobalID(EOGlobalID eoglobalid,
                                   EOEditingContext eoeditingcontext)
Description copied from class: EOObjectStore
Locks the object corresponding to the specified id is locked. The concept of object locking is implementation-specific. The lock may be released when objects are invalidated or commited, but this behavior is not required.

Specified by:
lockObjectWithGlobalID in class EOObjectStore

faultForGlobalID

public java.lang.Object faultForGlobalID(EOGlobalID eoglobalid,
                                         EOEditingContext eoeditingcontext)
Description copied from class: EOObjectStore
Returns the object for the specified id. The returned object may be a fault. The object will be registered in the specified editing context.

Specified by:
faultForGlobalID in class EOObjectStore

faultForRawRow

public java.lang.Object faultForRawRow(net.wotonomy.foundation.NSDictionary nsdictionary,
                                       java.lang.String s,
                                       EOEditingContext eoeditingcontext)

arrayFaultWithSourceGlobalID

public net.wotonomy.foundation.NSArray arrayFaultWithSourceGlobalID(EOGlobalID eoglobalid,
                                                                    java.lang.String s,
                                                                    EOEditingContext eoeditingcontext)
Description copied from class: EOObjectStore
Returns a List of objects associated with the object with the specified id for the specified property relationship, or may return a placeholder array that will defer the fetch until accessed (an array fault). All objects must be registered the specified editing context. The specified relationship key must produce a result of type Collection for the source object or an exception is thrown.

Specified by:
arrayFaultWithSourceGlobalID in class EOObjectStore

editingContextDidForgetObjectWithGlobalID

public void editingContextDidForgetObjectWithGlobalID(EOEditingContext eoeditingcontext,
                                                      EOGlobalID eoglobalid)
Description copied from class: EOObjectStore
Called by editing contexts when they no longer need to track the specified id. You will not need to call this method, but you use use it for a hint that the specified global id is not in use by that child editing context.

Overrides:
editingContextDidForgetObjectWithGlobalID in class EOObjectStore

objectsForSourceGlobalID

public net.wotonomy.foundation.NSArray objectsForSourceGlobalID(EOGlobalID eoglobalid,
                                                                java.lang.String s,
                                                                EOEditingContext eoeditingcontext)
Description copied from class: EOObjectStore
Returns a List of objects associated with the object with the specified id for the specified property relationship. This method may not return an array fault because array faults call this method to fetch on demand. All objects must be registered the specified editing context. The specified relationship key must produce a result of type Collection for the source object or an exception is thrown.

Specified by:
objectsForSourceGlobalID in class EOObjectStore

invalidateObjectsWithGlobalIDs

public void invalidateObjectsWithGlobalIDs(net.wotonomy.foundation.NSArray nsarray)

invalidateAllObjects

public void invalidateAllObjects()
Description copied from class: EOObjectStore
Remove all values from all objects in memory, turning them into faults, and posts an NSNotification that all objects have been invalidated. The notification should be named with the string constant InvalidatedAllObjectsInStoreNotification with this object store as the object and no user info.

Specified by:
invalidateAllObjects in class EOObjectStore

_objectsChangedInSubStore

public void _objectsChangedInSubStore(net.wotonomy.foundation.NSNotification nsnotification)

_invalidatedAllObjectsInSubStore

public void _invalidatedAllObjectsInSubStore(net.wotonomy.foundation.NSNotification nsnotification)

setUserInfo

public void setUserInfo(net.wotonomy.foundation.NSDictionary nsdictionary)

userInfo

public net.wotonomy.foundation.NSDictionary userInfo()

faultForRawRow

public java.lang.Object faultForRawRow(java.util.Map aDictionary,
                                       java.lang.String anEntityName,
                                       EOEditingContext aContext)
Description copied from class: EOObjectStore
Returns a fault representing an object of the specified entity type with values from the specified dictionary. The fault should belong to the specified editing context.

Specified by:
faultForRawRow in class EOObjectStore
See Also:
EOObjectStore.faultForRawRow(Map, String, EOEditingContext)

initializeObject

public void initializeObject(java.lang.Object anObject,
                             EOGlobalID aGlobalID,
                             EOEditingContext aContext)
Description copied from class: EOObjectStore
Given a newly instantiated object, this method initializes its properties to values appropriate for the specified id. The object should already belong to the specified editing context. This method is called to populate faults.

Specified by:
initializeObject in class EOObjectStore
See Also:
EOObjectStore.initializeObject(Object, EOGlobalID, EOEditingContext)

invalidateObjectsWithGlobalIDs

public void invalidateObjectsWithGlobalIDs(java.util.List aList)
Description copied from class: EOObjectStore
Removes values with the specified ids from memory, turning them into faults, and posts a notification that those objects have been invalidated. The notification should be named with the string constant ObjectsChangedInStoreNotification with this object store as the object and user info containing a key named InvalidateKey that returns a List of the EOGlobalIDs of the invalidated objects.

Specified by:
invalidateObjectsWithGlobalIDs in class EOObjectStore
See Also:
EOObjectStore.invalidateObjectsWithGlobalIDs(List)

refaultObject

public void refaultObject(java.lang.Object anObject,
                          EOGlobalID aGlobalID,
                          EOEditingContext aContext)
Description copied from class: EOObjectStore
Removes all values from the specified object, converting it into a fault for the specified id. New or deleted objects should not be refaulted.

Specified by:
refaultObject in class EOObjectStore
See Also:
EOObjectStore.refaultObject(Object, EOGlobalID, EOEditingContext)


Copyright © 2006 null. All Rights Reserved.