org.apache.tools.ant.taskdefs.optional.clearcase

Class CCLock

Implemented Interfaces:
Cloneable

public class CCLock
extends ClearCase

Performs a ClearCase Lock command.

The following attributes are interpreted:

AttributeValuesRequired
replaceSpecifies replacing an existing lockNo
nusersSpecifies user(s) who can still modify the object/pnameNo
obsoleteSpecifies that the object/pname should be marked obsoleteNo
commentSpecifies how to populate comments fieldsNo
pnameSpecifies the pathname to be locked.No
objselectThis variable is obsolete. Should use objsel instead.No
objselSpecifies the object(s) to be unlocked.No
failonerrThrow an exception if the command fails. Default is trueNo

Field Summary

static String
FLAG_COMMENT
-comment flag -- method to use for commenting events
static String
FLAG_NUSERS
-nusers flag -- list of users to exclude from lock
static String
FLAG_OBSOLETE
-obsolete flag -- mark locked object as obsolete
static String
FLAG_PNAME
-pname flag -- pathname to lock
static String
FLAG_REPLACE
-replace flag -- replace existing lock on object(s)

Fields inherited from class org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase

COMMAND_CHECKIN, COMMAND_CHECKOUT, COMMAND_LOCK, COMMAND_LSCO, COMMAND_MKATTR, COMMAND_MKBL, COMMAND_MKDIR, COMMAND_MKELEM, COMMAND_MKLABEL, COMMAND_MKLBTYPE, COMMAND_RMTYPE, COMMAND_UNCHECKOUT, COMMAND_UNLOCK, COMMAND_UPDATE

Fields inherited from class org.apache.tools.ant.Task

target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

description, location, project

Method Summary

void
execute()
Executes the task.
String
getComment()
Get comment method
String
getNusers()
Get nusers list
String
getObjselect()
Get list of objects to be locked
boolean
getObsolete()
Get obsolete flag status
String
getPname()
Get the pathname to be locked
boolean
getReplace()
Get replace flag status
void
setComment(String comment)
Sets how comments should be written for the event record(s)
void
setNusers(String nusers)
Sets the users who may continue to edit the object while it is locked.
void
setObjSel(String objsel)
Sets the object(s) to be locked
void
setObjselect(String objselect)
Sets the object(s) to be locked
void
setObsolete(boolean obsolete)
If true, mark object as obsolete.
void
setPname(String pname)
Sets the pathname to be locked
void
setReplace(boolean replace)
If true, replace an existing lock.

Methods inherited from class org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase

getClearToolCommand, getFailOnErr, getObjSelect, getViewPath, getViewPathBasename, run, runS, setClearToolDir, setFailOnErr, setObjSelect, setViewPath

Methods inherited from class org.apache.tools.ant.Task

bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

Field Details

FLAG_COMMENT

public static final String FLAG_COMMENT
-comment flag -- method to use for commenting events

FLAG_NUSERS

public static final String FLAG_NUSERS
-nusers flag -- list of users to exclude from lock

FLAG_OBSOLETE

public static final String FLAG_OBSOLETE
-obsolete flag -- mark locked object as obsolete

FLAG_PNAME

public static final String FLAG_PNAME
-pname flag -- pathname to lock

FLAG_REPLACE

public static final String FLAG_REPLACE
-replace flag -- replace existing lock on object(s)

Method Details

execute

public void execute()
            throws BuildException
Executes the task.

Builds a command line to execute cleartool and then calls Exec's run method to execute the command line.

Overrides:
execute in interface Task
Throws:
BuildException - if the command fails and failonerr is set to true

getComment

public String getComment()
Get comment method
Returns:
String containing the desired comment method

getNusers

public String getNusers()
Get nusers list
Returns:
String containing the list of users excluded from lock

getObjselect

public String getObjselect()
Get list of objects to be locked
Returns:
String containing the objects to be locked

getObsolete

public boolean getObsolete()
Get obsolete flag status
Returns:
boolean containing status of obsolete flag

getPname

public String getPname()
Get the pathname to be locked
Returns:
String containing the pathname to be locked

getReplace

public boolean getReplace()
Get replace flag status
Returns:
boolean containing status of replace flag

setComment

public void setComment(String comment)
Sets how comments should be written for the event record(s)
Parameters:
comment - comment method to use

setNusers

public void setNusers(String nusers)
Sets the users who may continue to edit the object while it is locked.
Parameters:
nusers - users excluded from lock

setObjSel

public void setObjSel(String objsel)
Sets the object(s) to be locked
Parameters:
objsel - objects to be locked
Since:
ant 1.6.1

setObjselect

public void setObjselect(String objselect)
Sets the object(s) to be locked
Parameters:
objselect - objects to be locked

setObsolete

public void setObsolete(boolean obsolete)
If true, mark object as obsolete.
Parameters:
obsolete - the status to set the flag to

setPname

public void setPname(String pname)
Sets the pathname to be locked
Parameters:
pname - pathname to be locked

setReplace

public void setReplace(boolean replace)
If true, replace an existing lock.
Parameters:
replace - the status to set the flag to