phpcr/src/PHPCR/Lock/LockInfoInterface.php
Copyright 2012 David Buchmann david@liip.ch
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
\PHPCR\Lock\LockInfoInterface
A blank
LockInfoInterface
is acquired through LockManagerInterface::createLockInfo().
The parameters of the LockInfo object can then be set by chaining the set methods, since each method returns the same
LockInfoInterface
with the indicated parameter set.
Once the object is configured, it is passed (along with the path of the node to be locked) to LockManagerInterface::lock.
The lock characteristics are defined according to the following parameters:
-
: IfisDeep
then the lock applies to the specified node and all its descendant nodes; iftrue
, the lock applies only to the specified node. On a successful lock, thefalse
property of the locked node is set to this value.jcr:lockIsDeep
-
: IfisSessionScoped
then the lock will expire upon the expiration of the current session (either through an automatic or explicittrue
); if false, the lock does not expire until it is explicitly unlocked, it times out, or it is automatically unlocked due to a implementation-specific limitation.Session.logout
: Specifies the number of seconds until the lock times out (if it is not refreshed withtimeoutHint
in the meantime). An implementation may use this information as a hint or ignore it altogether. Clients can discover the actual timeout by inspecting the returnedLock.refresh
object.Lock
-
:This parameter can be used to pass a string holding owner information relevant to the client. An implementation may either use or ignore this parameter. If it uses the parameter it must set theownerInfo
property of the locked node to this value and return this value onjcr:lockOwner
. If it ignores this parameter theLock.getLockOwner
property (and the value returned byjcr:lockOwner
) is set to either the value returned byLock.getLockOwner
of the owning session or an implementation-specific string identifying the owner.Session.getUserID
Methods
getIsDeep() : boolean
Returns the isDeep
parameter of the LockInfo
object.
Type | Description |
---|---|
boolean |
getIsSessionScoped() : boolean
Returns the isSessionScoped
parameter of the
LockInfo
object.
Type | Description |
---|---|
boolean |
getOwnerInfo() : string
Returns the ownerInfo
parameter of the LockInfo
object.
Type | Description |
---|---|
string |
getTimeoutHint() : int
Returns the timeoutHint
parameter of the
LockInfo
object.
Type | Description |
---|---|
int |
setIsDeep(boolean $isDeep) : \PHPCR\Lock\LockInfoInterface
Sets the isDeep
parameter of the LockInfo
object.
If left unset, this parameter defaults to
true
.
Name | Type | Description |
---|---|---|
$isDeep | boolean |
Type | Description |
---|---|
\PHPCR\Lock\LockInfoInterface | this object with the <code>isDeep</code> parameter set. |
setIsSessionScoped(boolean $isSessionScoped) : \PHPCR\Lock\LockInfoInterface
Sets the isSessionScoped
parameter of the
LockInfo
object.
If left unset, this parameter defaults to
false
.
Name | Type | Description |
---|---|---|
$isSessionScoped | boolean |
Type | Description |
---|---|
\PHPCR\Lock\LockInfoInterface | this object with the <code>isSessionScoped</code> parameter set. |
setOwnerInfo(string $ownerInfo) : \PHPCR\Lock\LockInfoInterface
Sets the ownerInfo
parameter of the LockInfo
object.
If left unset, this parameter defaults to
null
, meaning no owner information is provided.
Name | Type | Description |
---|---|---|
$ownerInfo | string |
Type | Description |
---|---|
\PHPCR\Lock\LockInfoInterface | this object with the <code>ownerInfo</code> parameter set. |
setTimeoutHint(int $timeoutHint) : \PHPCR\Lock\LockInfoInterface
Sets the timeoutHint
parameter of the LockInfo
object.
If left unset, this parameter defaults to
-1
, meaning no timeout is specified.
Name | Type | Description |
---|---|---|
$timeoutHint | int |
Type | Description |
---|---|
\PHPCR\Lock\LockInfoInterface | this code> object with the <code>timeoutHint</code> parameter set. |