com.microsoft.tfs.core.config
Interface ConnectionAdvisor

All Known Implementing Classes:
DefaultConnectionAdvisor

public interface ConnectionAdvisor

A ConnectionAdvisor provides services and configuration data for a TFSConnection to use. A ConnectionAdvisor is provided to a TFSConnection at construction time, and the TFSConnection retains the ConnectionAdvisor instance for the lifetime of the TFSConnection.

Any thread may call any of the ConnectionAdvisor methods. TFSConnection allows only a single thread at a time to call a given method. However, since a ConnectionAdvisor is passed to a TFSConnection, controlling all concurrent usage to the ConnectionAdvisor is outside the scope of the TFSConnection's control. Implementations should document their thread safety, and clients who use the implementations and create TFSConnections are responsible for obeying the implementation's threading guidelines.

Each method receives a ConnectionInstanceData object. This object encapsulates all of the instance configuration data that a TFSConnection has. The return value of each method is cached by the TFSConnection if the TFSConnection needs to use it in the future.

See Also:
TFSConnection, ConnectionInstanceData
Since:
TEE-SDK-10.1
Thread-safety:
thread-compatible

Method Summary
 ClientFactory getClientFactory(ConnectionInstanceData instanceData)
          Called by the TFSConnection the first time that a client is requested.
 HTTPClientFactory getHTTPClientFactory(ConnectionInstanceData instanceData)
          Called by the TFSConnection the first time that the TFSConnection's HttpClient is requested.
 java.util.Locale getLocale(ConnectionInstanceData instanceData)
           Called by the TFSConnection the first time that the TFSConnection's Locale is requested.
 PersistenceStoreProvider getPersistenceStoreProvider(ConnectionInstanceData instanceData)
          Called by the TFSConnection the first time that the TFSConnection's PersistenceStoreProvider is requested.
 ServerURIProvider getServerURIProvider(ConnectionInstanceData instanceData)
          Called by the TFSConnection the first time that the TFSConnection's server URI is requested.
 TFProxyServerSettingsFactory getTFProxyServerSettingsFactory(ConnectionInstanceData instanceData)
          Called by the TFSConnection the first time that the TFSConnection's TFProxyServerSettings is requested.
 java.util.TimeZone getTimeZone(ConnectionInstanceData instanceData)
          Called by the TFSConnection the first time that the TFSConnection's TimeZone is requested.
 WebServiceFactory getWebServiceFactory(ConnectionInstanceData instanceData)
          Called by the TFSConnection the first time that a web service is requested.
 

Method Detail

getTimeZone

java.util.TimeZone getTimeZone(ConnectionInstanceData instanceData)
Called by the TFSConnection the first time that the TFSConnection's TimeZone is requested.

Parameters:
instanceData - the TFSConnection's instance data
Returns:
a TimeZone for the TFSConnection to use, never null

getLocale

java.util.Locale getLocale(ConnectionInstanceData instanceData)

Called by the TFSConnection the first time that the TFSConnection's Locale is requested.

This value will be sent to the server with web service requests to identify the client's preferred language and country (via the HTTP Accept-Language header). It is also used by core classes to compare strings, format output, etc., in the correct way for the current connection.

Parameters:
instanceData - the TFSConnection's instance data
Returns:
a Locale for the TFSConnection to use, never null

getPersistenceStoreProvider

PersistenceStoreProvider getPersistenceStoreProvider(ConnectionInstanceData instanceData)
Called by the TFSConnection the first time that the TFSConnection's PersistenceStoreProvider is requested.

Parameters:
instanceData - the TFSConnection's instance data
Returns:
a PersistenceStoreProvider for the TFSConnection to use, never null

getHTTPClientFactory

HTTPClientFactory getHTTPClientFactory(ConnectionInstanceData instanceData)
Called by the TFSConnection the first time that the TFSConnection's HttpClient is requested.

Parameters:
instanceData - the TFSConnection's instance data
Returns:
a HTTPClientFactory for the TFSConnection to use (must not be null)

getServerURIProvider

ServerURIProvider getServerURIProvider(ConnectionInstanceData instanceData)
Called by the TFSConnection the first time that the TFSConnection's server URI is requested.

Parameters:
instanceData - the TFSConnection's instance data
Returns:
a ServerURIProvider for the TFSConnection to use (must not be null)

getWebServiceFactory

WebServiceFactory getWebServiceFactory(ConnectionInstanceData instanceData)
Called by the TFSConnection the first time that a web service is requested.

Parameters:
instanceData - the TFSConnection's instance data
Returns:
a WebServiceFactory for the TFSConnection to use (must not be null)

getClientFactory

ClientFactory getClientFactory(ConnectionInstanceData instanceData)
Called by the TFSConnection the first time that a client is requested.

Parameters:
instanceData - the TFSConnection's instance data
Returns:
a ClientFactory for the TFSConnection to use (must not be null)

getTFProxyServerSettingsFactory

TFProxyServerSettingsFactory getTFProxyServerSettingsFactory(ConnectionInstanceData instanceData)
Called by the TFSConnection the first time that the TFSConnection's TFProxyServerSettings is requested.

Parameters:
instanceData - the TFSConnection's instance data (never null )
Returns:
a TFProxyServerSettings object for the TFSConnection to use, or null to not use a TFS proxy server


© 2015 Microsoft. All rights reserved.