com.cassinidivision.oce.users
Class U_Lock
java.lang.Object
com.webobjects.eocontrol.EOCustomObject
com.webobjects.eocontrol.EOGenericRecord
com.cassinidivision.oce.users.base._U_Lock
com.cassinidivision.oce.users.U_Lock
- All Implemented Interfaces:
- _EOPrivateMemento, EODeferredFaulting, EOEnterpriseObject, EOFaulting, EOKeyValueCoding, EOKeyValueCoding._BestBindingCreation._ForwardingBindingCheck, EOKeyValueCoding._KeyBindingCreation, EOKeyValueCodingAdditions, EORelationshipManipulation, EOValidation, NSKeyValueCoding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._ReflectionKeyBindingCreation.Callback, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable
- public class U_Lock
- extends com.cassinidivision.oce.users.base._U_Lock
Provides database-independent locking mechanisms for single primary-keyed enterprise objects.
- See Also:
- Serialized Form
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding |
NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor |
Methods inherited from class com.cassinidivision.oce.users.base._U_Lock |
actor, className, dateSet, lock_ID, setActor, setClassName, setDateSet, setLock_ID |
Methods inherited from class com.webobjects.eocontrol.EOCustomObject |
__classDescription, __clearPendingChanges, __editingContext, __globalID, __hasAuxillaryObservers, __hasPendingChanges, __hasPendingUpdate, __isInitialized, __isPendingDeletion, __isPendingInsertion, __isShared, __lastSnapshot, __originalSnapshot, __retainCount, __setAuxillaryObservers, __setEditingContext, __setGlobalID, __setInitialized, __setLastSnapshot, __setOriginalSnapshot, __setPendingDeletion, __setPendingInsertion, __setPendingUpdate, __setRetainCount, __setShared, _createKeyGetBindingForKey, _createKeySetBindingForKey, _createStoredKeyGetBindingForKey, _createStoredKeySetBindingForKey, _fieldKeyBinding, _forwardingBindingNeededForClass, _methodKeyGetBinding, _methodKeySetBinding, addObjectToBothSidesOfRelationshipWithKey, addObjectToPropertyWithKey, allPropertyKeys, attributeKeys, awakeFromClientUpdate, awakeFromFetch, awakeFromInsertion, canAccessFieldsDirectly, changesFromSnapshot, classDescriptionForDestinationKey, clearFault, clearProperties, deleteRuleForRelationshipKey, editingContext, entityName, eoDescription, eoShallowDescription, equals, faultHandler, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hashCode, inverseForRelationshipKey, invokeRemoteMethod, isFault, isToManyKey, opaqueState, ownsDestinationObjectsForRelationshipKey, prepareValuesForClient, propagateDeleteWithEditingContext, reapplyChangesFromDictionary, removeObjectFromBothSidesOfRelationshipWithKey, removeObjectFromPropertyWithKey, shouldUseStoredAccessors, snapshot, storedValueForKey, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, takeValuesFromDictionaryWithMapping, toManyRelationshipKeys, toOneRelationshipKeys, toString, turnIntoFault, unableToSetNullForKey, updateFromSnapshot, userPresentableDescription, validateClientUpdate, validateForDelete, validateForInsert, validateForSave, validateForUpdate, validateTakeValueForKeyPath, validateValueForKey, valueForKey, valueForKeyPath, valuesForKeys, valuesForKeysWithMapping, willChange, willRead, willReadRelationship |
U_Lock
public U_Lock()
lockForObjectInEditingContext
public static U_Lock lockForObjectInEditingContext(EOEnterpriseObject anObject,
EOEditingContext editingContext)
- Retrieve a lock for an enterprise object instance, if one exists.
- Parameters:
anObject
- The enterprise object in question.editingContext
- The editing context in which the lock will be fetched.
- Returns:
- The lock for the EO, or null if there is no such lock.
newLockForObjectWithUserInEditingContext
public static U_Lock newLockForObjectWithUserInEditingContext(EOEnterpriseObject anObject,
U_Actor anActor,
EOEditingContext editingContext)
- Create a new lock (in-memory, unsaved) for an enterprise object, registered to a particular actor/user.
- Parameters:
anObject
- The enterprise object in question.anActor
- The actor the lock will be associated with.editingContext
- The editing context the new lock instance will be registered in.
- Returns:
- The newly created lock, or null if the EO is not lockable, or any other problem occurred.
isLockable
public static boolean isLockable(EOEnterpriseObject anObject)
- Uncover if a particular enterprise object can be locked or not.
- Parameters:
anObject
- The enterprise object in question.
- Returns:
- true if a lock can be created for the EO, false otherwise.
isLocked
public static boolean isLocked(EOEnterpriseObject anObject)
- Deduce whether an enterprise object is currently locked or not.
- Parameters:
anObject
- The enterprise object in question.
- Returns:
- true if the EO is locked, false otherwise.
lockedInfoForObject
public static NSDictionary lockedInfoForObject(EOEnterpriseObject anObject)
- Convenience method: return lock information regarding a particular object.
The following key-value pairs may be returned in the info dictionary:
- user The actor/user who owns the lock (U_Actor instance).
- time The time the lock was set (NSTimestamp instance).
- Parameters:
anObject
-
- Returns:
- The lock information dictionary, or null if the object is not locked.
unlock
public void unlock()
- Unlock the current instance (removes the lock instance from the database).