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

Class StarTeamTask

Known Direct 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

Method Summary

protected View
createSnapshotView(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.
String
getPassword()
returns the password used for login
String
getProjectname()
returns the name of the StarTeam project to be acted on
protected Server
getServer()
returns a reference to the server which may be used for informational purposes by subclasses.
String
getServername()
returns the name of the StarTeamServer
String
getServerport()
returns the port number of the StarTeam connection
protected TypeNames
getTypeNames()
returns a list of TypeNames known to the server.
String
getURL()
a convenience method which returns the whole StarTeam connection information as a single URL string of
String
getUserName()
returns the name of the StarTeam user
protected String
getUserName(int userID)
Returns the name of the user with the supplied ID or a blank string if user not found.
protected String
getViewURL()
returns an URL string useful for interacting with many StarTeamFinder methods.
String
getViewname()
returns the name of the StarTeam view to be acted on
protected View
openView()
All subclasses will call on this method to open the view needed for processing.
void
setPassword(String password)
set the password to be used for login; required.
void
setProjectname(String projectname)
set the name of the StarTeam project to be acted on; required if URL is not set.
void
setServername(String servername)
Set the name of StarTeamServer; required if URL is not set.
void
setServerport(String serverport)
set the port number of the StarTeam connection; required if URL is not set.
void
setURL(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(String userName)
set the name of the StarTeam user, needed for the connection
void
setViewname(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, log, log, setProject

Method Details

createSnapshotView

protected View createSnapshotView(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.


disconnectFromServer

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


getPassword

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

Returns:
the password used for login


getProjectname

public final 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()


getServer

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

Returns:
a reference to the server


getServername

public final String getServername()
returns the name of the StarTeamServer

Returns:
the name of the StarTeam server

See Also:
getURL()


getServerport

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

Returns:
the port number of the StarTeam connection

See Also:
getURL()


getTypeNames

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

Returns:
a reference to the server's TypeNames


getURL

public final 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()


getUserName

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

Returns:
the name of the StarTeam user


getUserName

protected final 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


getViewURL

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

Returns:
the URL string for this task.


getViewname

public final 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()


openView

protected 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.

See Also:
createSnapshotView(View), getServer()


setPassword

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

Parameters:
password - the password to be used for login


setProjectname

public final void setProjectname(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)


setServername

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

Parameters:
servername - a String value

See Also:
setURL(String)


setServerport

public final void setServerport(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)


setURL

public final void setURL(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)


setUserName

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

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


setViewname

public final void setViewname(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)


Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.