wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
LockManager Class Reference
+ Inheritance diagram for LockManager:

Public Member Functions

getInstance ()
 
 handleLocking (&$object, $name)
 
 aquireLock ($oid)
 
 releaseLock ($oid)
 
 releaseLocks ($oid)
 
 releaseAllLocks ()
 
 getLockMessage ($lock, $objectText)
 
 getLock ($oid)
 
getUser ()
 
 aquireLockImpl ($useroid, $sessid, $oid, $lockDate)
 
 releaseLockImpl ($useroid, $sessid, $oid)
 
 releaseAllLocksImpl ($useroid, $sessid)
 
 getLockImpl ($oid)
 

Detailed Description

LockManager is used to handle lock requests on objects.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.LockManager.php 1462 2014-02-04 23:52:27Z iherwig

This class defines abstract methods that subclasses must implement to support different lock storages.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 39 of file class.LockManager.php.

Member Function Documentation

LockManager::handleLocking ( $object,
  $name 
)

Lock a persistent object if it is not locked already and the current user is allowed to modify it.

Note
static method
Parameters
objectThe object to lock
nameThe display name of the object
Returns
A message describing the problem if locking is not possible because another user holds the lock

Definition at line 86 of file class.LockManager.php.

References ACTION_MODIFY, getInstance(), and RightsManager\getInstance().

Referenced by DisplayController\executeKernel().

+ Here is the call graph for this function:

LockManager::aquireLock (   $oid)

Aquire a lock on an OID for the current user.

Parameters
oidobject id of the object to lock.
Returns
True if successfull/False in case of an invalid oid or a Lock instance in case of an existing lock.

Definition at line 115 of file class.LockManager.php.

References aquireLockImpl(), SessionData\getInstance(), getLock(), getUser(), and PersistenceFacade\isValidOID().

+ Here is the call graph for this function:

LockManager::releaseLock (   $oid)

Release a lock on an OID for the current user.

Parameters
oidobject id of the object to release.

Definition at line 137 of file class.LockManager.php.

References SessionData\getInstance(), getUser(), PersistenceFacade\isValidOID(), and releaseLockImpl().

+ Here is the call graph for this function:

LockManager::releaseLocks (   $oid)

Release all locks on an OID regardless of the user.

Parameters
oidobject id of the object to release.

Definition at line 151 of file class.LockManager.php.

References PersistenceFacade\isValidOID(), and releaseLockImpl().

+ Here is the call graph for this function:

LockManager::releaseAllLocks ( )

Release all lock for the current user.

Definition at line 161 of file class.LockManager.php.

References SessionData\getInstance(), getUser(), and releaseAllLocksImpl().

+ Here is the call graph for this function:

LockManager::getLockMessage (   $lock,
  $objectText 
)

Get the default lock message for a lock.

Parameters
lockThe Lock instance to construct the message for.
objectTextThe display text for the locked object.
Returns
The lock message of the form 'objectText is locked by user 'admin' since 12:12:36
'.

Definition at line 174 of file class.LockManager.php.

References Message\get().

+ Here is the call graph for this function:

LockManager::getLock (   $oid)

Get lock data for an OID. This method may also be used to check for an lock.

Note
The method uses the php parameter 'session.gc_maxlifetime' to determine if a lock belongs to an expired session. A lock with a creation date older than 'session.gc_maxlifetime' seconds is regarded to belong to an expired session which results in the removal of all locks attached to that session.
Parameters
oidobject id of the object to get the lock data for.
Returns
A Lock instance or null if no lock exists/or in case of an invalid oid.

Definition at line 190 of file class.LockManager.php.

References getLockImpl(), PersistenceFacade\isValidOID(), and releaseLockImpl().

Referenced by aquireLock().

+ Here is the call graph for this function:

& LockManager::getUser ( )

Get the currently logged in user.

Returns
An instance of AuthUser.

Definition at line 213 of file class.LockManager.php.

References RightsManager\getInstance().

Referenced by aquireLock(), releaseAllLocks(), and releaseLock().

+ Here is the call graph for this function:

LockManager::aquireLockImpl (   $useroid,
  $sessid,
  $oid,
  $lockDate 
)

Aquire a lock on an OID for a given user.

Parameters
useroidThe oid of the user.
sessidThe id of the session of the user.
oidobject id of the object to lock.
lockDatedate of the lock.

Definition at line 225 of file class.LockManager.php.

References WCMFException\throwEx().

Referenced by aquireLock().

+ Here is the call graph for this function:

LockManager::releaseLockImpl (   $useroid,
  $sessid,
  $oid 
)

Release a lock on an OID for a given user or all locks for that user or all locks for the OID. The behaviour depends on the given parameters. A null means that this parameter should be ignored

Parameters
useroidThe oid of the user or null to ignore the userid.
sessidThe id of the session of the user or null to ignore the session id.
oidobject id of the object to release or null top ignore the oid.

Definition at line 236 of file class.LockManager.php.

References WCMFException\throwEx().

Referenced by getLock(), releaseLock(), and releaseLocks().

+ Here is the call graph for this function:

LockManager::releaseAllLocksImpl (   $useroid,
  $sessid 
)

Release all lock for a given user.

Parameters
useroidThe oid of the user.
sessidThe id of the session of the user.

Definition at line 245 of file class.LockManager.php.

References WCMFException\throwEx().

Referenced by releaseAllLocks().

+ Here is the call graph for this function:

LockManager::getLockImpl (   $oid)

Get lock data for an OID. This method may also be used to check for an lock.

Parameters
oidobject id of the object to get the lock data for.
Returns
A Lock instance or null if no lock exists/or in case of an invalid oid.

Definition at line 254 of file class.LockManager.php.

References WCMFException\throwEx().

Referenced by getLock().

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: