org.tmatesoft.svn.core.wc2
Class SvnSetLock

java.lang.Object
  extended by org.tmatesoft.svn.core.wc2.SvnOperation<T>
      extended by org.tmatesoft.svn.core.wc2.SvnReceivingOperation<SVNLock>
          extended by org.tmatesoft.svn.core.wc2.SvnSetLock
All Implemented Interfaces:
ISvnObjectReceiver<SVNLock>, ISvnOperationOptionsProvider

public class SvnSetLock
extends SvnReceivingOperation<SVNLock>

Represents operation for locking files. Locks file items in a working copy as well as in a repository so that no other user can commit changes to them.

SvnOperation.run() method returns SVNLock object that represents information of lock. SvnOperation.run() method throws SVNException if one of the following is true:


Constructor Summary
protected SvnSetLock(SvnOperationFactory factory)
           
 
Method Summary
 java.lang.String getLockMessage()
          Gets the optional comment for the lock.
protected  int getMaximumTargetsCount()
           
 boolean isChangesWorkingCopy()
          Gets whether the operation changes working copy
 boolean isStealLock()
          Gets whether or not all existing locks on the specified targets will be "stolen" from another user or working copy.
 void setLockMessage(java.lang.String lockMessage)
          Sets the optional comment for the lock.
 void setStealLock(boolean stealLock)
          Sets whether or not all existing locks on the specified targets will be "stolen" from another user or working copy.
 
Methods inherited from class org.tmatesoft.svn.core.wc2.SvnReceivingOperation
first, getReceiver, initDefaults, last, receive, run, setReceiver
 
Methods inherited from class org.tmatesoft.svn.core.wc2.SvnOperation
addTarget, cancel, ensureArgumentsAreValid, ensureEnoughTargets, ensureHomohenousTargets, getApplicableChangelists, getAuthenticationManager, getCanceller, getDepth, getEventHandler, getFirstTarget, getMinimumTargetsCount, getOperationalWorkingCopy, getOperationFactory, getOptions, getRepositoryPool, getRevision, getTargets, hasFileTargets, hasLocalTargets, hasRemoteTargets, isCancelled, isSleepForTimestamp, isUseParentWcFormat, needsHomohenousTargets, run, setApplicalbeChangelists, setDepth, setRevision, setSingleTarget, setSleepForTimestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SvnSetLock

protected SvnSetLock(SvnOperationFactory factory)
Method Detail

isStealLock

public boolean isStealLock()
Gets whether or not all existing locks on the specified targets will be "stolen" from another user or working copy.

Returns:
true if locks should be "stolen", otherwise false

setStealLock

public void setStealLock(boolean stealLock)
Sets whether or not all existing locks on the specified targets will be "stolen" from another user or working copy.

Parameters:
stealLock - true if locks should be "stolen", otherwise false

getLockMessage

public java.lang.String getLockMessage()
Gets the optional comment for the lock.

Returns:
comment for the lock

setLockMessage

public void setLockMessage(java.lang.String lockMessage)
Sets the optional comment for the lock.

Parameters:
lockMessage - comment for the lock

getMaximumTargetsCount

protected int getMaximumTargetsCount()
Overrides:
getMaximumTargetsCount in class SvnOperation<SVNLock>

isChangesWorkingCopy

public boolean isChangesWorkingCopy()
Gets whether the operation changes working copy

Overrides:
isChangesWorkingCopy in class SvnOperation<SVNLock>
Returns:
true if the operation changes the working copy, otherwise false