com.perforce.p4java.ant.tasks
Class JobsTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.perforce.p4java.ant.tasks.PerforceTask
              extended by com.perforce.p4java.ant.tasks.ServerTask
                  extended by com.perforce.p4java.ant.tasks.ClientTask
                      extended by com.perforce.p4java.ant.tasks.JobsTask
All Implemented Interfaces:
java.lang.Cloneable

public class JobsTask
extends ClientTask

Reports the list of all jobs currently known to the system. If a file (pattern) is given, only fixes for submitted changelists affecting that file (or set of files) are listed. The file pattern may include wildcards and/or a revision number range. See 'p4 help revisions' for help specifying revisions.

See Also:
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 includeIntegrated
          If true, include any fixes made by changelists integrated into the specified files.
protected  java.lang.String jobView
          If not null, this should be a string in format detailed by "p4 help jobview" used to restrict jobs to those satisfying the job view expression.
protected  boolean longDescriptions
          If true, return full descriptions, otherwise show only a subset (typically the first 128 characters, but this is not guaranteed).
protected  int maxJobs
          If greater than zero, limit the output to the first maxJobs jobs.
protected  boolean reverseOrder
          If true, reverse the normal sort order.
 
Fields inherited from class com.perforce.p4java.ant.tasks.ClientTask
p4Client
 
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
JobsTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce jobs command with file specs and options.
 java.util.List<IJob> getRetJobs()
          Gets the ret jobs.
 void setIncludeIntegrated(boolean includeIntegrated)
          Sets the include integrated.
 void setJobView(java.lang.String jobView)
          Sets the job view.
 void setLongDescriptions(boolean longDescriptions)
          Sets the long descriptions.
 void setMaxJobs(int maxJobs)
          Sets the max jobs.
 void setReverseOrder(boolean reverseOrder)
          Sets the reverse order.
 
Methods inherited from class com.perforce.p4java.ant.tasks.ClientTask
cleanupP4, getP4Client, initP4, setP4Client
 
Methods inherited from class com.perforce.p4java.ant.tasks.ServerTask
cleanupP4Server, createGlobalOption, getGlobalOptions, getP4Server, 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

maxJobs

protected int maxJobs
If greater than zero, limit the output to the first maxJobs jobs. Corresponds to the -m flag.


longDescriptions

protected boolean longDescriptions
If true, return full descriptions, otherwise show only a subset (typically the first 128 characters, but this is not guaranteed). Corresponds to the -l flag.


reverseOrder

protected boolean reverseOrder
If true, reverse the normal sort order. Corresponds to the -r flag.


includeIntegrated

protected boolean includeIntegrated
If true, include any fixes made by changelists integrated into the specified files. Corresponds to the -i flag.


jobView

protected java.lang.String jobView
If not null, this should be a string in format detailed by "p4 help jobview" used to restrict jobs to those satisfying the job view expression. Corresponds to the -e flag.

Constructor Detail

JobsTask

public JobsTask()
Default constructor.

Method Detail

setMaxJobs

public void setMaxJobs(int maxJobs)
Sets the max jobs.

Parameters:
maxJobs - the new max jobs

setLongDescriptions

public void setLongDescriptions(boolean longDescriptions)
Sets the long descriptions.

Parameters:
longDescriptions - the new long descriptions

setReverseOrder

public void setReverseOrder(boolean reverseOrder)
Sets the reverse order.

Parameters:
reverseOrder - the new reverse order

setIncludeIntegrated

public void setIncludeIntegrated(boolean includeIntegrated)
Sets the include integrated.

Parameters:
includeIntegrated - the new include integrated

setJobView

public void setJobView(java.lang.String jobView)
Sets the job view.

Parameters:
jobView - the new job view

getRetJobs

public java.util.List<IJob> getRetJobs()
Gets the ret jobs.

Returns:
the ret jobs

execP4Command

protected void execP4Command()
                      throws org.apache.tools.ant.BuildException
Execute the Perforce jobs command with file specs and options. Log the returned jobs.

Return a list of Perforce jobs. Note that (as discussed in the IJob comments) Perforce jobs can have a wide variety of fields, formats, semantics, etc., and this method can return a list that may have to be unpacked at the map level by the consumer to make any sense of it.

Specified by:
execP4Command in class PerforceTask
Throws:
org.apache.tools.ant.BuildException - the build exception
See Also:
PerforceTask.execP4Command()


Copyright (c) 2010 Perforce Software. All rights reserved.