com.perforce.p4java.ant.tasks
Class ClientTask

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
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AddTask, ChangesTask, ChangeTask, DeleteTask, Diff2Task, EditTask, FilesTask, FixTask, FstatTask, GrepTask, HaveTask, IntegrateTask, JobsTask, LabelsyncTask, LabelTask, LockTask, MoveTask, ReopenTask, ResolveTask, RevertTask, ShelveTask, SubmitTask, SyncTask, TagTask, UnlockTask, UnshelveTask

public abstract class ClientTask
extends ServerTask

Base class for Perforce client specific Ant tasks. It initializes an instance of the Perforce server and an instance of the Perforce client.

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  IClient p4Client
          Perforce client.
 
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
ClientTask()
          Default constructor.
 
Method Summary
protected  void cleanupP4()
          Override method to cleanup the Perforce client and server instances.
 IClient getP4Client()
          Gets the p4 client.
protected  void initP4()
          Override method to initialize the Perforce server and client, respectively.
 void setP4Client(IClient p4Client)
          Sets the p4 client.
 
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, execP4Command, 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

p4Client

protected IClient p4Client
Perforce client.

Constructor Detail

ClientTask

public ClientTask()
Default constructor.

Method Detail

getP4Client

public IClient getP4Client()
Gets the p4 client.

Returns:
the p4 client

setP4Client

public void setP4Client(IClient p4Client)
Sets the p4 client.

Parameters:
p4Client - the new p4 client

initP4

protected void initP4()
               throws org.apache.tools.ant.BuildException
Override method to initialize the Perforce server and client, respectively. The server is initialized first, since the client is initialized from the server instance.

Overrides:
initP4 in class ServerTask
Throws:
org.apache.tools.ant.BuildException - the build exception
See Also:
ServerTask.initP4()

cleanupP4

protected void cleanupP4()
                  throws org.apache.tools.ant.BuildException
Override method to cleanup the Perforce client and server instances.

Overrides:
cleanupP4 in class ServerTask
Throws:
org.apache.tools.ant.BuildException - the build exception
See Also:
ServerTask.cleanupP4()


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