|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.Application
public class Application
The StarTeam SDK's interface to the client application.
| Nested Class Summary | |
|---|---|
static class |
Application.ResolveOptions
Options that control the behavior of an Application's resolve operations. |
| Constructor Summary | |
|---|---|
Application()
Create an Application with a default name. |
|
Application(java.lang.String name)
Create an Application with the given name. |
|
Application(java.lang.String name,
ClientContext context)
Create an Application with the given name and client context. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the client application. |
ClientContext |
getClientContext()
Gets the client context associated with this application. |
static java.lang.String |
getDefaultName()
Gets the client application name. |
ServerInfo |
getDefaultServerInfo(java.lang.String address,
int port)
Creates a default ServerInfo for the server at the given address and port. |
java.lang.String |
getDescription()
Gets a verbose description of the client application and runtime environment. |
java.lang.String |
getName()
Gets the client application name. |
StarTeamRepositoryIDs |
getRepositoryIDs()
Returns a StarTeamRepositoryIDs instance, loaded from the local file of server GUIDs |
Application.ResolveOptions |
getResolveOptions()
Gets the options that affect resolve operations for this Application. |
Server[] |
getServers()
Gets the list of Servers that the client application is currently connected to. |
TraceFinder |
getTraceFinder()
Creates a new TraceFinder instance for searching Traces across StarTeam servers. |
Server |
newServer(ServerInfo info)
Creates a new Server object, using the given connection information. |
Server |
newServer(java.lang.String serverName)
Looks up the given server name in starteam-servers.xml, and uses the resulting ServerInfo to construct the server. |
Server |
newServer(java.lang.String address,
int port)
Creates a new Server object, using the given host address and port. |
java.lang.Object |
resolve(java.lang.String url)
Resolves the given StarTeam URL/ALM URI to the corresponding StarTeam resource. |
Folder |
resolveFolder(View view,
java.lang.String folderPath)
Given a view and a path to a sub-folder return the sub-folder if found. |
Project |
resolveProject(Server server,
int projectID)
Resolves the given project ID to a Project object. |
Project |
resolveProject(Server server,
java.lang.String name)
Resolves the project name to a Project object. |
Server |
resolveServer(GUID repositoryID)
Resolves the given repository ID to a Server object that has already been connected and logged on as the given user. |
Server |
resolveServer(GUID repositoryID,
java.lang.String userName,
java.lang.String password)
Resolves the given repository ID to a Server object that has already been connected and logged on as the given user. |
Server |
resolveServer(java.lang.String address,
int port)
Resolves the given address and port to a Server object that has already been connected and logged on as the given user. |
Server |
resolveServer(java.lang.String address,
int port,
java.lang.String userName,
java.lang.String password)
Resolves the given address and port to a Server object that has already been connected and logged on as the given user. |
ServerInfo |
resolveServerInfo(java.lang.String servername)
Obtains a ServerInfo for the server with the given description. |
View |
resolveToView(java.lang.String url)
Resolves the given StarTeam URL/ALM URI down to the view. |
View |
resolveView(Project project,
int viewID)
Resolves the given view ID to a View object. |
View |
resolveView(Project project,
java.lang.String name)
Resolves the view name to a view object. |
static void |
setDefaultName(java.lang.String name)
Sets the client application name. |
void |
setResolveOptions(Application.ResolveOptions options)
Sets the options that affect resolve operations for this Application. |
java.lang.String |
toStarTeamURL(java.lang.Object object)
Resolves the given StarTeam resource to a corresponding URL using an ID based scheme |
java.lang.String |
toStarTeamURL(java.lang.Object object,
boolean useIDBasedScheme,
boolean useGUIDbasedScheme)
Resolves the given StarTeam resource to a corresponding URL |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Application()
public Application(java.lang.String name)
name - The client application name. The application name is reported
to the StarTeam Server at connect time for diagnostic
purposes.
public Application(java.lang.String name,
ClientContext context)
name - The client application name. The application name is reported
to the StarTeam Server at connect time for diagnostic
purposes.context - Describes aspects of the client runtime environment.| Method Detail |
|---|
public static java.lang.String getDefaultName()
public static void setDefaultName(java.lang.String name)
name - The client application name. Default is
"<Unknown Application>". To report a specific
application name to the StarTeam Server for diagnostic
purposes, set the application name prior to connecting.public java.lang.String getName()
public ClientContext getClientContext()
public java.lang.String getDescription()
public TraceFinder getTraceFinder()
TraceFinderpublic Server newServer(ServerInfo info)
The Server is automatically added to the application's server collection by Server.connect(), and is removed from the collection by Server.disconnect().
info - Server connection information.ServerInfo,
Server.connect(),
Server.disconnect(),
Server.enableMPX()public Server newServer(java.lang.String serverName)
The Server is automatically added to the application's server collection by Server.connect(), and is removed from the collection by Server.disconnect().
serverName - A server name in starteam-servers.xml.
public Server newServer(java.lang.String address,
int port)
The Server is automatically added to the application's server collection by Server.connect(), and is removed from the collection by Server.disconnect().
address - The server's host address.port - The server's TCP/IP port.public final Server[] getServers()
Servers are added to the collection automatically via Server.connect(), and are removed from the collection via Server.disconnect(). Only Server object created through one of the Application server factory methods are added to the collection. Servers objects created through one of the Server constructors create a default Application of their own.
public void close()
public Server resolveServer(java.lang.String address,
int port)
The default implementation looks for a matching Server in the application's server collection:
Server server = resolveUsingServerCollection(address, port, userName);
if (server != null) {
return server;
}
If an existing Server cannot be found, then an attempt is made to create a new Server instance:
ServerInfo info = resolveServerInfo(address, port); return resolveToNewServer(info, null, userName, password);
An application that wants to extend this algorithm will probably override resolveToNewServer().
address - The desired server's host address.port - The desired server's port number.
public Server resolveServer(java.lang.String address,
int port,
java.lang.String userName,
java.lang.String password)
The default implementation looks for a matching Server in the application's server collection:
Server server = resolveUsingServerCollection(address, port, userName);
if (server != null) {
return server;
}
If an existing Server cannot be found, then an attempt is made to create a new Server instance:
ServerInfo info = resolveServerInfo(address, port); return resolveToNewServer(info, null, userName, password);
An application that wants to extend this algorithm will probably override resolveToNewServer().
address - The desired server's host address.port - The desired server's port number.userName - The desired user name, or null if any logged on user is
acceptable.password - The desired password, or null if not known.
public Server resolveServer(GUID repositoryID)
The default implementation looks for a matching Server in the application's server collection:
Server server = resolveUsingServerCollection(repositoryID, userName);
if (server != null) {
return server;
}
If an existing Server cannot be found, then an attempt is made to find a connect string for the given repository ID:
String[] candidates = findRepositoryID(repositoryID);We iterate over the candidate connect strings, looking for one that we are able to resolve:
ServerInfo info = resolveServerInfo(candidates[i]); server = resolveToNewServer(info, repositoryID, userName, password);
An application that wants to extend this algorithm will probably override resolveToNewServer().
repositoryID - The desired server's repository ID.
public Server resolveServer(GUID repositoryID,
java.lang.String userName,
java.lang.String password)
The default implementation looks for a matching Server in the application's server collection:
Server server = resolveUsingServerCollection(repositoryID, userName);
if (server != null) {
return server;
}
If an existing Server cannot be found, then an attempt is made to find a connect string for the given repository ID:
String[] candidates = findRepositoryID(repositoryID);We iterate over the candidate connect strings, looking for one that we are able to resolve:
ServerInfo info = resolveServerInfo(candidates[i]); server = resolveToNewServer(info, repositoryID, userName, password);
An application that wants to extend this algorithm will probably override resolveToNewServer().
repositoryID - The desired server's repository ID.userName - The desired user name, or null if any logged on user is
acceptable.password - The desired password, or null if not known.
public StarTeamRepositoryIDs getRepositoryIDs()
throws java.io.IOException
java.io.IOException - if an I/O error occurspublic ServerInfo resolveServerInfo(java.lang.String servername)
Default implementation searches for a matching ServerInfo in the application's default server-list.xml. If no matching entry is found, it tries to find a matching entry by host address.
servername - Target server description.
Application.resolveServerInfo(String,int)public View resolveToView(java.lang.String url)
url - the StarTeam URL/ALM URI to be resolved
public ServerInfo getDefaultServerInfo(java.lang.String address,
int port)
address - Stringport - int
public Project resolveProject(Server server,
int projectID)
The default implementation looks for a matching Project in the server's project collection.
If an existing Project cannot be found, and the Application has enabled auto-refresh for projects, then the Server's project collection is refreshed, and searched again.
If none of these strategies are successful, then resolveProject() returns null.
server - The server that contains the desired project.projectID - The project ID.
Application.ResolveOptions.isAutoRefreshProjectsEnabled()
public Project resolveProject(Server server,
java.lang.String name)
The default implementation looks for a matching Project in the server's project collection.
If an existing Project cannot be found, and the Application has enabled auto-refresh for projects, then the Server's project collection is refreshed, and searched again.
If none of these strategies are successful, then resolveProject() returns null.
server - The server that contains the desired project.name - The project name.
Application.ResolveOptions.isAutoRefreshProjectsEnabled()
public View resolveView(Project project,
int viewID)
The default implementation looks for a matching View in the project's view collection.
If an existing View cannot be found, and the Application has enabled auto-refresh for views, then the Project's view collection is refreshed, and searched again.
If none of these strategies are successful, then resolveView() returns null.
project - The project that contains the desired view.viewID - The view ID.
Application.ResolveOptions.isAutoRefreshViewsEnabled()
public View resolveView(Project project,
java.lang.String name)
The default implementation looks for a matching View in the project's view collection.
If an existing View cannot be found, and the Application has enabled auto-refresh for views, then the Project's view collection is refreshed, and searched again.
If none of these strategies are successful, then resolveView() returns null.
project - The project that contains the desired view.name - The view name.
Application.ResolveOptions.isAutoRefreshViewsEnabled()
public Folder resolveFolder(View view,
java.lang.String folderPath)
view - the view in which the folder is to be foundfolderPath - the path to the sub-folder
public final Application.ResolveOptions getResolveOptions()
public final void setResolveOptions(Application.ResolveOptions options)
options - that affect resolve operations for this Applicationpublic java.lang.Object resolve(java.lang.String url)
url - the StarTeam URL/ALM URI to be resolved
public java.lang.String toStarTeamURL(java.lang.Object object)
object - the StarTeam resource to be resolved
public java.lang.String toStarTeamURL(java.lang.Object object,
boolean useIDBasedScheme,
boolean useGUIDbasedScheme)
object - the StarTeam resource to be resolveduseIDBasedScheme - True to use an ID Based Scheme, False to use a Name Based
SchemeuseGUIDbasedScheme - True to use a GUID Based Scheme, False to use a {host name,
port} Based Scheme
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||