com.microsoft.tfs.core
Class TFSConfigurationServer

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

public class TFSConfigurationServer
extends TFSConnection

A connection to the configuration server area of a TFS 2010 or later installation.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class com.microsoft.tfs.core.TFSConnection
TFSConnection.HTTPClientReference
 
Constructor Summary
protected TFSConfigurationServer(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.
  TFSConfigurationServer(java.net.URI serverURI, Credentials credentials)
          A convenience constructor to create a TFSConfigurationServer from a URI and Credentials.
  TFSConfigurationServer(java.net.URI serverURI, Credentials credentials, ConnectionAdvisor advisor)
          The most complete way of creating a TFSConfigurationServer.
 
Method Summary
 ICatalogService getCatalogService()
          Gets the ICatalogService for this connection.
 TFSEntitySession getConfigurationSession(boolean refresh)
          Gets the catalog service TFSEntitySession for this configuration server.
 ILocationService getLocationService()
           
 RegistrationClient getRegistrationClient()
          The registration service is not available for a configuration server instance.
 ServerDataProvider getServerDataProvider()
          Gets the ServerDataProvider for this connection.
 TeamFoundationServerEntity getTeamFoundationServerEntity(boolean refresh)
          Gets the team ProjectCollectionEntity for this configuration server.
 TFSTeamProjectCollection getTeamProjectCollection(com.microsoft.tfs.util.GUID collectionID)
          Gets the TFSTeamProjectCollection for the specified ID.
 boolean hasAuthenticated()
          Tests whether the connection has authenticated.
 void reactToPossibleServerUpdate(int locationServiceLastChangeId)
           
 
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

TFSConfigurationServer

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

Parameters:
serverURI - the URI to connect to (must not be null)
credentials - the Credentials to connect with

TFSConfigurationServer

public TFSConfigurationServer(java.net.URI serverURI,
                              Credentials credentials,
                              ConnectionAdvisor advisor)
The most complete way of creating a TFSConfigurationServer. 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
advisor - the ConnectionAdvisor to use (must not be null)

TFSConfigurationServer

protected TFSConfigurationServer(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

getTeamProjectCollection

public TFSTeamProjectCollection getTeamProjectCollection(com.microsoft.tfs.util.GUID collectionID)
Gets the TFSTeamProjectCollection for the specified ID.

Parameters:
collectionID - the collection's ID (must not be null)
Returns:
the TFSTeamProjectCollection that matches the ID, or null if no matching collection was found

getConfigurationSession

public TFSEntitySession getConfigurationSession(boolean refresh)
Gets the catalog service TFSEntitySession for this configuration server.

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

getTeamFoundationServerEntity

public TeamFoundationServerEntity getTeamFoundationServerEntity(boolean refresh)
Gets the team ProjectCollectionEntity for this configuration server.

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

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

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

Specified by:
getCatalogService in class TFSConnection

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

reactToPossibleServerUpdate

public void reactToPossibleServerUpdate(int locationServiceLastChangeId)

getRegistrationClient

public RegistrationClient getRegistrationClient()
The registration service is not available for a configuration server instance. 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)

getLocationService

public ILocationService getLocationService()


© 2015 Microsoft. All rights reserved.