org.apache.tools.ant.taskdefs.optional.starteam
Class StarTeamTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.optional.starteam.StarTeamTask
Direct Known Subclasses:
StarTeamLabel, TreeBasedTask

public abstract class StarTeamTask
extends Task

Common super class for all StarTeam tasks. At this level of the hierarchy we are concerned only with obtaining a connection to the StarTeam server. The subclass TreeBasedTask, also abstract defines the tree-walking behavior common to many subtasks.

Version:
1.1
See Also:
TreeBasedTask

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
StarTeamTask()
           
 
Method Summary
protected abstract  com.starbase.starteam.View createSnapshotView(com.starbase.starteam.View rawview)
          Derived classes must override createSnapshotView defining the kind of configured view appropriate to its task.
protected  void disconnectFromServer()
          disconnects from the StarTeam server.
 java.lang.String getPassword()
          returns the password used for login
 java.lang.String getProjectname()
          returns the name of the StarTeam project to be acted on
protected  com.starbase.starteam.Server getServer()
          returns a reference to the server which may be used for informational purposes by subclasses.
 java.lang.String getServername()
          returns the name of the StarTeamServer
 java.lang.String getServerport()
          returns the port number of the StarTeam connection
protected  com.starbase.starteam.TypeNames getTypeNames()
          returns a list of TypeNames known to the server.
 java.lang.String getURL()
          a convenience method which returns the whole StarTeam connection information as a single URL string of
 java.lang.String getUserName()
          returns the name of the StarTeam user
protected  java.lang.String getUserName(int userID)
          Returns the name of the user with the supplied ID or a blank string if user not found.
 java.lang.String getViewname()
          returns the name of the StarTeam view to be acted on
protected  java.lang.String getViewURL()
          returns an URL string useful for interacting with many StarTeamFinder methods.
protected  com.starbase.starteam.View openView()
          All subclasses will call on this method to open the view needed for processing.
 void setPassword(java.lang.String password)
          set the password to be used for login; required.
 void setProjectname(java.lang.String projectname)
          set the name of the StarTeam project to be acted on; required if URL is not set.
 void setServername(java.lang.String servername)
          Set the name of StarTeamServer; required if URL is not set.
 void setServerport(java.lang.String serverport)
          set the port number of the StarTeam connection; required if URL is not set.
 void setURL(java.lang.String url)
          Set the server name, server port, project name and project folder in one shot; optional, but the server connection must be specified somehow.
 void setUserName(java.lang.String userName)
          set the name of the StarTeam user, needed for the connection
 void setViewname(java.lang.String viewname)
          set the name of the StarTeam view to be acted on; required if URL is not set.
 
Methods inherited from class org.apache.tools.ant.Task
execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StarTeamTask

public StarTeamTask()
Method Detail

setServername

public final void setServername(java.lang.String servername)
Set the name of StarTeamServer; required if URL is not set.

Parameters:
servername - a String value
See Also:
setURL(String)

getServername

public final java.lang.String getServername()
returns the name of the StarTeamServer

Returns:
the name of the StarTeam server
See Also:
getURL()

setServerport

public final void setServerport(java.lang.String serverport)
set the port number of the StarTeam connection; required if URL is not set.

Parameters:
serverport - port number to be set
See Also:
setURL(String)

getServerport

public final java.lang.String getServerport()
returns the port number of the StarTeam connection

Returns:
the port number of the StarTeam connection
See Also:
getURL()

setProjectname

public final void setProjectname(java.lang.String projectname)
set the name of the StarTeam project to be acted on; required if URL is not set.

Parameters:
projectname - the name of the StarTeam project to be acted on
See Also:
setURL(String)

getProjectname

public final java.lang.String getProjectname()
returns the name of the StarTeam project to be acted on

Returns:
the name of the StarTeam project to be acted on
See Also:
getURL()

setViewname

public final void setViewname(java.lang.String viewname)
set the name of the StarTeam view to be acted on; required if URL is not set.

Parameters:
viewname - the name of the StarTeam view to be acted on
See Also:
setURL(String)

getViewname

public final java.lang.String getViewname()
returns the name of the StarTeam view to be acted on

Returns:
the name of the StarTeam view to be acted on
See Also:
getURL()

setURL

public final void setURL(java.lang.String url)
Set the server name, server port, project name and project folder in one shot; optional, but the server connection must be specified somehow.

Parameters:
url - a String of the form "servername:portnum/project/view"
See Also:
setServername(String), setServerport(String), setProjectname(String), setViewname(String)

getURL

public final java.lang.String getURL()
a convenience method which returns the whole StarTeam connection information as a single URL string of

Returns:
a String of the form "servername:portnum/project/view"
See Also:
getServername(), getServerport(), getProjectname(), getViewname()

getViewURL

protected final java.lang.String getViewURL()
returns an URL string useful for interacting with many StarTeamFinder methods.

Returns:
the URL string for this task.

setUserName

public final void setUserName(java.lang.String userName)
set the name of the StarTeam user, needed for the connection

Parameters:
userName - name of the user to be logged in

getUserName

public final java.lang.String getUserName()
returns the name of the StarTeam user

Returns:
the name of the StarTeam user

setPassword

public final void setPassword(java.lang.String password)
set the password to be used for login; required.

Parameters:
password - the password to be used for login

getPassword

public final java.lang.String getPassword()
returns the password used for login

Returns:
the password used for login

getServer

protected final com.starbase.starteam.Server getServer()
returns a reference to the server which may be used for informational purposes by subclasses.

Returns:
a reference to the server

disconnectFromServer

protected final void disconnectFromServer()
disconnects from the StarTeam server. Should be called from the finally clause of every StarTeamTask-based execute method.


getTypeNames

protected final com.starbase.starteam.TypeNames getTypeNames()
returns a list of TypeNames known to the server.

Returns:
a reference to the server's TypeNames

createSnapshotView

protected abstract com.starbase.starteam.View createSnapshotView(com.starbase.starteam.View rawview)
                                                          throws BuildException
Derived classes must override createSnapshotView defining the kind of configured view appropriate to its task.

Parameters:
rawview - the unconfigured View
Returns:
the snapshot View appropriately configured.
BuildException

openView

protected com.starbase.starteam.View openView()
                                       throws BuildException
All subclasses will call on this method to open the view needed for processing. This method also saves a reference to the Server that may be accessed for information at various points in the process.

Returns:
the View that will be used for processing.
BuildException
See Also:
createSnapshotView(View), getServer()

getUserName

protected final java.lang.String getUserName(int userID)
Returns the name of the user with the supplied ID or a blank string if user not found.

Parameters:
userID - a user's ID
Returns:
the name of the user with ID userID


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.