Methods 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 final void | disconnectFromServer()disconnects from the StarTeam server. Should be called from the
finally clause of every StarTeamTask-based execute method.
if (null != this.server) {
this.server.disconnect();
log("successful disconnect from StarTeam Server " + servername,
Project.MSG_VERBOSE);
}
|
public final java.lang.String | getPassword()returns the password used for login
return this.password;
|
public final java.lang.String | getProjectname()returns the name of the StarTeam project to be acted on
return this.projectname;
|
protected final com.starbase.starteam.Server | getServer()returns a reference to the server which may be used for informational
purposes by subclasses.
return this.server;
|
public final java.lang.String | getServername()returns the name of the StarTeamServer
return this.servername;
|
public final java.lang.String | getServerport()returns the port number of the StarTeam connection
return this.serverport;
|
protected final com.starbase.starteam.TypeNames | getTypeNames()returns a list of TypeNames known to the server.
return this.server.getTypeNames();
|
public final java.lang.String | getURL()a convenience method which returns the whole StarTeam
connection information as a single URL string of
return this.servername + ":"
+ this.serverport + "/"
+ this.projectname + "/"
+ ((null == this.viewname) ? "" : this.viewname);
|
public final java.lang.String | getUserName()returns the name of the StarTeam user
return this.userName;
|
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.
User u = this.server.getUser(userID);
if (null == u) {
return "";
}
return u.getName();
|
protected final java.lang.String | getViewURL()returns an URL string useful for interacting with many StarTeamFinder
methods.
return getUserName() + ":" + getPassword() + "@" + getURL();
|
public final java.lang.String | getViewname()returns the name of the StarTeam view to be acted on
return this.viewname;
|
private void | logStarteamVersion()
log("StarTeam version: "
+ BuildNumber.getDisplayString(), Project.MSG_VERBOSE);
|
protected com.starbase.starteam.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.
logStarteamVersion();
View view = null;
try {
view = StarTeamFinder.openView(getViewURL());
} catch (Exception e) {
throw new BuildException(
"Failed to connect to " + getURL(), e);
}
if (null == view) {
throw new BuildException("Cannot find view" + getURL()
+ " in repository()");
}
View snapshot = createSnapshotView(view);
log("Connected to StarTeam view " + getURL(),
Project.MSG_VERBOSE);
this.server = snapshot.getServer();
return snapshot;
|
public final void | setPassword(java.lang.String password)set the password to be used for login; required.
this.password = password;
|
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.
this.projectname = projectname;
|
public final void | setServername(java.lang.String servername)Set the name of StarTeamServer;
required if URL is not set.
this.servername = servername;
|
public final void | setServerport(java.lang.String serverport)set the port number of the StarTeam connection;
required if URL is not set.
this.serverport = serverport;
|
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.
StringTokenizer t = new StringTokenizer(url, "/");
if (t.hasMoreTokens()) {
String unpw = t.nextToken();
int pos = unpw.indexOf(":");
if (pos > 0) {
this.servername = unpw.substring(0, pos);
this.serverport = unpw.substring(pos + 1);
if (t.hasMoreTokens()) {
this.projectname = t.nextToken();
if (t.hasMoreTokens()) {
this.viewname = t.nextToken();
}
}
}
}
|
public final void | setUserName(java.lang.String userName)set the name of the StarTeam user, needed for the connection
this.userName = userName;
|
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.
this.viewname = viewname;
|