65 private $concurrencyManager = null;
86 parent::__construct($session, $persistenceFacade, $permissionManager,
87 $actionMapper, $localization, $message, $configuration);
88 $this->concurrencyManager = $concurrencyManager;
100 ['invalidOids' => [$request->getValue('oid')]]));
106 ['invalidParameters' => ['type']]));
122 if ($request->getAction() == 'lock') {
123 $this->concurrencyManager->aquireLock($oid, $lockType);
124 $lock = $this->concurrencyManager->getLock($oid);
125 $response->setValue('type', $lock->getType());
127 elseif ($request->getAction() == 'unlock') {
128 $this->concurrencyManager->releaseLock($oid, $lockType);
133 ['lockedOids' => [$oid->__toString()]]));
136 $response->setValue('oid', $oid);
137 $response->setAction('ok');
Session is the interface for session implementations and defines access to session variables.
ConcurrencyController is used to lock/unlock objects.
__construct(Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration, ConcurrencyManager $concurrencyManager)
Constructor.
PessimisticLockException signals an exception when trying to create an pessimistic lock.
ObjectId is the unique identifier of an object.
Implementations of Configuration give access to the application configuration.
ApplicationError is used to signal errors that occur while processing a request.
static parse($oid)
Parse a serialized object id string into an ObjectId instance.
Lock represents a lock on an object.
static get($code, $data=null)
Factory method for retrieving a predefined error instance.
PersistenceFacade defines the interface for PersistenceFacade implementations.
ConcurrencyManager is used to handle concurrency for objects.
getRequest()
Get the Request instance.
Controller is the base class of all controllers.
ActionMapper implementations are responsible for instantiating and executing Controllers based on the...
getResponse()
Get the Response instance.
PermissionManager implementations are used to handle all authorization requests.
Localization defines the interface for storing localized entity instances and retrieving them back.
Message is used to get localized messages to be used in the user interface.