|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.perforce.p4java.ant.tasks.PerforceTask
com.perforce.p4java.ant.tasks.ServerTask
com.perforce.p4java.ant.tasks.CounterTask
public class CounterTask
Display, set, or delete a counter. The first form displays the value of the named counter. The second form sets the counter to the given value. The third form deletes the counter. This usually has the same effect as setting the counter to 0.
PerforceTask
,
ServerTask
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
ServerTask.GlobalOption |
Nested classes/interfaces inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
PerforceTask.Field, PerforceTask.File |
Field Summary | |
---|---|
protected boolean |
delete
If true, the counter will be deleted. |
protected java.lang.String |
name
The name of the counter. |
protected boolean |
perforceCounter
If true, this is a Perforce internal counter. |
protected java.lang.String |
property
The property to be set with the value of the counter. |
protected java.lang.String |
value
The new value for the counter. |
Fields inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
allHosts, commandOptions, globaloptions, hostName, P4_SERVER_PROTOCOL_PROPERTIES_FILE, P4_SERVER_USAGE_PROPERTIES_FILE, p4Server, programName, programVersion, protocolPropertiesFile, protocolProps, textLanguage, unsetClientName, unsetUserName, usagePropertiesFile, usageProps, workingDirectory |
Fields inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
charset, client, failOnError, fields, FILE_TOKEN_REGEX_PATTERN, fileList, files, fileSpecs, LINE_PADDING, LINE_SEPARATOR, p4Messages, passwd, port, protocol, retFileSpecs, retStatusMessage, user |
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 |
Constructor Summary | |
---|---|
CounterTask()
Default constructor. |
Method Summary | |
---|---|
protected void |
execP4Command()
Execute the Perforce counter command with the following logical sequence: |
void |
setDelete(boolean delete)
Sets the delete. |
void |
setName(java.lang.String name)
Sets the counter name. |
void |
setPerforceCounter(boolean perforceCounter)
Sets the perforce counter. |
void |
setProperty(java.lang.String property)
Sets the property. |
void |
setValue(java.lang.String value)
Sets the value. |
Methods inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
cleanupP4, cleanupP4Server, createGlobalOption, getGlobalOptions, getP4Server, initP4, initP4Server, initP4ServerOptions, setAllHosts, setHostName, setP4Server, setProgramName, setProgramVersion, setProtocolPropertiesFile, setProtocolProps, setTextLanguage, setUnsetClientName, setUnsetUserName, setUsagePropertiesFile, setUsageProps, setWorkingDirectory |
Methods inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
addFileset, createField, createFile, execute, getFields, getFiles, getFileSpecs, getRetFileSpecs, getRetStatusMessage, init, isEmpty, logChangelistSummaries, logChangelistSummary, logExtendedFileSpec, logExtendedFileSpecs, logFileDiff, logFileDiffs, logFileLineMatch, logFileLineMatches, logFileSpec, logFileSpecs, logFix, logFixes, logJob, logJobs, parseChangelist, setCharset, setClient, setFailOnError, setFiles, setPasswd, setPort, setProtocol, setUser |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, 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, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean delete
protected boolean perforceCounter
protected java.lang.String name
protected java.lang.String value
protected java.lang.String property
Constructor Detail |
---|
public CounterTask()
Method Detail |
---|
public void setDelete(boolean delete)
delete
- the new deletepublic void setPerforceCounter(boolean perforceCounter)
perforceCounter
- the new perforce counterpublic void setName(java.lang.String name)
name
- the new counter namepublic void setValue(java.lang.String value)
value
- the new valuepublic void setProperty(java.lang.String property)
property
- the new propertyprotected void execP4Command() throws org.apache.tools.ant.BuildException
1. Delete the counter, if "delete" is true.
2. Otherwise, retrieve the counter, if "value" is empty.
3. Otherwise, set the counter with new value. 4. Set the counter value to
a specified property.
Get the value of a named Perforce counter from the Perforce server. Note that this method will return a zero string (i.e. "0") if the named counter doesn't exist (rather than throw an exception); use getCounters to see if a counter actually exists before you use it.
execP4Command
in class PerforceTask
org.apache.tools.ant.BuildException
- the build exceptionPerforceTask.execP4Command()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |