Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.clearcase

public Class CCLock

extends ClearCase
Class Inheritance
Imports
java.util.Optional, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.Execute, org.apache.tools.ant.types.Commandline

Performs a ClearCase Lock command.

The following attributes are interpreted:

Task attributes
Attribute Values Required
replace Specifies replacing an existing lock No
nusers Specifies user(s) who can still modify the object/pname No
obsolete Specifies that the object/pname should be marked obsolete No
comment Specifies how to populate comments fields No
pname Specifies the pathname to be locked. No
objselect This variable is obsolete. Should use objsel instead. No
objsel Specifies the object(s) to be unlocked. No
failonerr Throw an exception if the command fails. Default is true No

Field Summary

Modifier and TypeField and Description
public static final String
FLAG_COMMENT

-comment flag -- method to use for commenting events

public static final String
FLAG_NUSERS

-nusers flag -- list of users to exclude from lock

public static final String
FLAG_OBSOLETE

-obsolete flag -- mark locked object as obsolete

public static final String
FLAG_PNAME

-pname flag -- pathname to lock

public static final String
FLAG_REPLACE

-replace flag -- replace existing lock on object(s)

private String
private String
private String
private boolean
private String
private boolean
Inherited from org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase:
COMMAND_CHECKINCOMMAND_CHECKOUTCOMMAND_LOCKCOMMAND_LSCOCOMMAND_MKATTRCOMMAND_MKBLCOMMAND_MKDIRCOMMAND_MKELEMCOMMAND_MKLABELCOMMAND_MKLBTYPECOMMAND_RMTYPECOMMAND_UNCHECKOUTCOMMAND_UNLOCKCOMMAND_UPDATE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
checkOptions(Commandline cmd)

Check the command line options.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Executes the task.
public String

Returns:

String containing the desired comment method
getComment
()

Get comment method

private void
getCommentCommand(Commandline
containing the command line string with or without the comment flag and value appended
cmd
)

Get the 'comment' command

public String

Returns:

String containing the list of users excluded from lock
getNusers
()

Get nusers list

private void
getNusersCommand(Commandline
containing the command line string with or without the nusers flag and value appended
cmd
)

Get the 'nusers' command

public String

Returns:

String containing the objects to be locked
getObjselect
()

Get list of objects to be locked

public boolean

Returns:

boolean containing status of obsolete flag
getObsolete
()

Get obsolete flag status

private String

Returns:

String containing the object/pname being worked on
getOpType
()

Return which object/pname is being operated on

public String

Returns:

String containing the pathname to be locked
getPname
()

Get the pathname to be locked

private void
getPnameCommand(Commandline
containing the command line string with or without the pname flag and value appended
cmd
)

Get the 'pname' command

public boolean

Returns:

boolean containing status of replace flag
getReplace
()

Get replace flag status

public void
setComment(String
comment method to use
comment
)

Sets how comments should be written for the event record(s)

public void
setNusers(String
users excluded from lock
nusers
)

Sets the users who may continue to edit the object while it is locked.

public void
setObjSel(String
objects to be locked
objsel
)

Sets the object(s) to be locked

public void
setObjselect(String
objects to be locked
objselect
)

Sets the object(s) to be locked

public void
setObsolete(boolean
the status to set the flag to
obsolete
)

If true, mark object as obsolete.

public void
setPname(String
pathname to be locked
pname
)

Sets the pathname to be locked

public void
setReplace(boolean
the status to set the flag to
replace
)

If true, replace an existing lock.

Inherited from org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase:
getClearToolCommandgetFailOnErrgetObjSelectgetViewPathgetViewPathBasenamerunrunSrunSsetClearToolDirsetFailOnErrsetObjSelectsetViewPath

Field Detail

FLAG_COMMENTback to summary
public static final String FLAG_COMMENT

-comment flag -- method to use for commenting events

FLAG_NUSERSback to summary
public static final String FLAG_NUSERS

-nusers flag -- list of users to exclude from lock

FLAG_OBSOLETEback to summary
public static final String FLAG_OBSOLETE

-obsolete flag -- mark locked object as obsolete

FLAG_PNAMEback to summary
public static final String FLAG_PNAME

-pname flag -- pathname to lock

FLAG_REPLACEback to summary
public static final String FLAG_REPLACE

-replace flag -- replace existing lock on object(s)

mCommentback to summary
private String mComment
mNusersback to summary
private String mNusers
mObjselectback to summary
private String mObjselect
mObsoleteback to summary
private boolean mObsolete
mPnameback to summary
private String mPname
mReplaceback to summary
private boolean mReplace

Constructor Detail

CCLockback to summary
public CCLock()

Method Detail

checkOptionsback to summary
private void checkOptions(Commandline cmd)

Check the command line options.

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Executes the task.

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

Annotations
@Override
Exceptions
BuildException:
if the command fails and failonerr is set to true
getCommentback to summary
public String getComment()

Get comment method

Returns:String

String containing the desired comment method

getCommentCommandback to summary
private void getCommentCommand(Commandline cmd)

Get the 'comment' command

Parameters
cmd:Commandline

containing the command line string with or without the comment flag and value appended

getNusersback to summary
public String getNusers()

Get nusers list

Returns:String

String containing the list of users excluded from lock

getNusersCommandback to summary
private void getNusersCommand(Commandline cmd)

Get the 'nusers' command

Parameters
cmd:Commandline

containing the command line string with or without the nusers flag and value appended

getObjselectback to summary
public String getObjselect()

Get list of objects to be locked

Returns:String

String containing the objects to be locked

getObsoleteback to summary
public boolean getObsolete()

Get obsolete flag status

Returns:boolean

boolean containing status of obsolete flag

getOpTypeback to summary
private String getOpType()

Return which object/pname is being operated on

Returns:String

String containing the object/pname being worked on

getPnameback to summary
public String getPname()

Get the pathname to be locked

Returns:String

String containing the pathname to be locked

getPnameCommandback to summary
private void getPnameCommand(Commandline cmd)

Get the 'pname' command

Parameters
cmd:Commandline

containing the command line string with or without the pname flag and value appended

getReplaceback to summary
public boolean getReplace()

Get replace flag status

Returns:boolean

boolean containing status of replace flag

setCommentback to summary
public void setComment(String comment)

Sets how comments should be written for the event record(s)

Parameters
comment:String

comment method to use

setNusersback to summary
public void setNusers(String nusers)

Sets the users who may continue to edit the object while it is locked.

Parameters
nusers:String

users excluded from lock

setObjSelback to summary
public void setObjSel(String objsel)

Sets the object(s) to be locked

Parameters
objsel:String

objects to be locked

Since
ant 1.6.1
setObjselectback to summary
public void setObjselect(String objselect)

Sets the object(s) to be locked

Parameters
objselect:String

objects to be locked

setObsoleteback to summary
public void setObsolete(boolean obsolete)

If true, mark object as obsolete.

Parameters
obsolete:boolean

the status to set the flag to

setPnameback to summary
public void setPname(String pname)

Sets the pathname to be locked

Parameters
pname:String

pathname to be locked

setReplaceback to summary
public void setReplace(boolean replace)

If true, replace an existing lock.

Parameters
replace:boolean

the status to set the flag to