com.microsoft.tfs.core
Class TFSTeamProjectCollection

java.lang.Object
  extended by com.microsoft.tfs.core.TFSConnection
      extended by com.microsoft.tfs.core.TFSTeamProjectCollection
All Implemented Interfaces:
com.microsoft.tfs.util.Closable

public class TFSTeamProjectCollection
extends TFSConnection

A connection to a team project collection in a TFS 2010 or later server, or to the entire service area of a TFS 2005 or TFS 2008 server.

See Also:
TFSConnection
Since:
TEE-SDK-10.1
Thread-safety:
thread-safe

Nested Class Summary
 
Nested classes/interfaces inherited from class com.microsoft.tfs.core.TFSConnection
TFSConnection.HTTPClientReference
 
Constructor Summary
protected TFSTeamProjectCollection(java.net.URI serverURI, java.util.concurrent.atomic.AtomicReference<Credentials> credentialsHolder, ConnectionAdvisor advisor)
          Package-protected constructor that allows TFSConfigurationServer and TFSTeamProjectCollections to share credentials (that may be updated at any time) by way of an AtomicReference.
  TFSTeamProjectCollection(java.net.URI serverURI, Credentials credentials)
          A convenience constructor to create a TFSTeamProjectCollection from a URI.
  TFSTeamProjectCollection(java.net.URI serverURI, Credentials credentials, ConnectionAdvisor advisor)
          The most complete way of creating a TFSTeamProjectCollection.
 
Method Summary
 IBuildServer getBuildServer()
          A convenience method to get the Build service client from this TFSConnection.
protected  ICatalogService getCatalogService()
          Gets the ICatalogService for this connection.
 ILocationService getCollectionLocationService()
           
 CommonStructureClient getCommonStructureClient()
          A convenience method to get the common structure service client from this TFSConnection.
 TFSConfigurationServer getConfigurationServer()
           
 TFSEntitySession getConfigurationSession(boolean refresh)
          Gets the catalog service TFSEntitySession for this team project collection.
 RegistrationClient getRegistrationClient()
          Convenience method to get the registration client for this connection.
 ServerDataProvider getServerDataProvider()
          Gets the ServerDataProvider for this connection.
 SourceControlCapabilityFlags getSourceControlCapability(ProjectInfo project)
           
 ProjectCollectionEntity getTeamProjectCollectionEntity(boolean refresh)
          Gets the team ProjectCollectionEntity for this collection.
 VersionControlClient getVersionControlClient()
          A convenience method to get the version control client from this TFSConnection.
 WorkItemClient getWorkItemClient()
          A convenience method to get the WIT client from this TFSConnection.
 boolean hasAuthenticated()
          Tests whether the connection has authenticated.
 
Methods inherited from class com.microsoft.tfs.core.TFSConnection
addConnectivityFailureStatusChangeListener, authenticate, close, connect, ensureAuthenticated, getAuthenticatedIdentity, getAuthorizedAccountName, getAuthorizedDomainName, getAuthorizedIdentity, getAuthorizedTFSUser, getBaseURI, getCaseInsensitiveCollator, getCaseSensitiveCollator, getCatalogNode, getCatalogResourceID, getClient, getConnectionAdvisor, getConnectivityFailureOnLastWebServiceCall, getCredentials, getCredentialsHolder, getHTTPClient, getHTTPClientReference, getInstanceID, getLinkingWebService, getLocale, getLocationServiceURI, getName, getPersistenceStoreProvider, getServerCapabilities, getSessionID, getTFProxyServerSettings, getTimeZone, getURL, getWebService, getWebServiceFactory, getWebServiceURI, getWSSClient, getWSSWebService, isHosted, newHTTPClient, removeConnectivityFailureStatusChangeListener, setConnectivityFailureOnLastWebServiceCall, setHTTPClientReference, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TFSTeamProjectCollection

public TFSTeamProjectCollection(java.net.URI serverURI,
                                Credentials credentials)
A convenience constructor to create a TFSTeamProjectCollection from a URI. A default ConnectionAdvisor is used.

Parameters:
uri - the URI to use to connect (must not be null)
credentials - the Credentials to connect with (or null to attempt to use the best available credentials)

TFSTeamProjectCollection

public TFSTeamProjectCollection(java.net.URI serverURI,
                                Credentials credentials,
                                ConnectionAdvisor advisor)
The most complete way of creating a TFSTeamProjectCollection. A URI, Credentials and a ConnectionAdvisor are specified.

Parameters:
serverURI - the URI to connect to (must not be null)
credentials - the Credentials to connect with (or null to attempt to use the best available credentials)
advisor - the ConnectionAdvisor to use (must not be null)

TFSTeamProjectCollection

protected TFSTeamProjectCollection(java.net.URI serverURI,
                                   java.util.concurrent.atomic.AtomicReference<Credentials> credentialsHolder,
                                   ConnectionAdvisor advisor)
Package-protected constructor that allows TFSConfigurationServer and TFSTeamProjectCollections to share credentials (that may be updated at any time) by way of an AtomicReference.

Parameters:
serverURI - the URI to connect to (must not be null)
credentialsHolder - an AtomicReference to the Credentials to connect with (must not be null)
advisor - the ConnectionAdvisor to use (must not be null)
Method Detail

getServerDataProvider

public ServerDataProvider getServerDataProvider()
Gets the ServerDataProvider for this connection.

Service discovery is often a slow process. Derived classes should cache the result of the first call to ensure subsequent calls to this method finish quickly.

Specified by:
getServerDataProvider in class TFSConnection
Returns:
the ServerDataProvider, which provides information about the server this TFSConnection is connected to (never null)

getCatalogService

protected ICatalogService getCatalogService()
Gets the ICatalogService for this connection. Derived classes must implement this to support TFSConnection.getCatalogNode().

Specified by:
getCatalogService in class TFSConnection

getConfigurationServer

public TFSConfigurationServer getConfigurationServer()
Returns:
this team project collection's configuration server connection.

getCollectionLocationService

public ILocationService getCollectionLocationService()

getConfigurationSession

public TFSEntitySession getConfigurationSession(boolean refresh)
Gets the catalog service TFSEntitySession for this team project collection.

Parameters:
refresh - true to force a refresh of the data from the server, false to use cached data
Returns:
The TFSEntitySession for this project collection

getTeamProjectCollectionEntity

public ProjectCollectionEntity getTeamProjectCollectionEntity(boolean refresh)
Gets the team ProjectCollectionEntity for this collection.

Parameters:
refresh - true to force a refresh of the data from the server, false to use cached data
Returns:
the catalog-service based project collection entity for this team project collection, or null if none could be found (ie, pre-framework server.)

hasAuthenticated

public boolean hasAuthenticated()
Tests whether the connection has authenticated. This is left for derived classes to implement so they can use their knowledge of whether the ServerDataProvider has been initialized to make the test more efficient.

Specified by:
hasAuthenticated in class TFSConnection
Returns:
true if this connection has authenticated to the server, false if it has not

getRegistrationClient

public RegistrationClient getRegistrationClient()
Convenience method to get the registration client for this connection. May return null if this kind of TFSConnection doesn't support the registration service.

Specified by:
getRegistrationClient in class TFSConnection
Returns:
the RegistrationClient (possibly null)

getVersionControlClient

public VersionControlClient getVersionControlClient()
A convenience method to get the version control client from this TFSConnection.

Returns:
the VersionControlClient

getWorkItemClient

public WorkItemClient getWorkItemClient()
A convenience method to get the WIT client from this TFSConnection.

Returns:
the WorkItemClient

getBuildServer

public IBuildServer getBuildServer()
A convenience method to get the Build service client from this TFSConnection.

Returns:
the BuildClient which implements IBuildServer

getCommonStructureClient

public CommonStructureClient getCommonStructureClient()
A convenience method to get the common structure service client from this TFSConnection.

Returns:
the CommonStructureClient

getSourceControlCapability

public SourceControlCapabilityFlags getSourceControlCapability(ProjectInfo project)


© 2015 Microsoft. All rights reserved.