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

Class StarTeamTask

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

Method Summary
protected abstract ViewcreateSnapshotView(View rawview)
Derived classes must override createSnapshotView defining the kind of configured view appropriate to its task.
protected voiddisconnectFromServer()
disconnects from the StarTeam server.
StringgetPassword()
returns the password used for login
StringgetProjectname()
returns the name of the StarTeam project to be acted on
protected ServergetServer()
returns a reference to the server which may be used for informational purposes by subclasses.
StringgetServername()
returns the name of the StarTeamServer
StringgetServerport()
returns the port number of the StarTeam connection
protected TypeNamesgetTypeNames()
returns a list of TypeNames known to the server.
StringgetURL()
a convenience method which returns the whole StarTeam connection information as a single URL string of
StringgetUserName()
returns the name of the StarTeam user
protected StringgetUserName(int userID)
Returns the name of the user with the supplied ID or a blank string if user not found.
StringgetViewname()
returns the name of the StarTeam view to be acted on
protected StringgetViewURL()
returns an URL string useful for interacting with many StarTeamFinder methods.
protected ViewopenView()
All subclasses will call on this method to open the view needed for processing.
voidsetPassword(String password)
set the password to be used for login; required.
voidsetProjectname(String projectname)
set the name of the StarTeam project to be acted on; required if URL is not set.
voidsetServername(String servername)
Set the name of StarTeamServer; required if URL is not set.
voidsetServerport(String serverport)
set the port number of the StarTeam connection; required if URL is not set.
voidsetURL(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.
voidsetUserName(String userName)
set the name of the StarTeam user, needed for the connection
voidsetViewname(String viewname)
set the name of the StarTeam view to be acted on; required if URL is not set.

Method Detail

createSnapshotView

protected abstract View createSnapshotView(View rawview)
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

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

getViewURL

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

Returns: the URL string for this task.

openView

protected View openView()
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 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

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

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

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 setServerport setProjectname setViewname

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

Copyright