com.microsoft.tfs.core.config.webservice
Class DefaultWebServiceFactory

java.lang.Object
  extended by com.microsoft.tfs.core.config.webservice.DefaultWebServiceFactory
All Implemented Interfaces:
WebServiceFactory

public class DefaultWebServiceFactory
extends java.lang.Object
implements WebServiceFactory

A default implementation of the WebServiceFactory interface.

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

Constructor Summary
DefaultWebServiceFactory(java.util.Locale acceptLanguageLocale, com.microsoft.tfs.core.ws.runtime.client.TransportRequestHandler transportRequestHandler)
          Creates a DefaultWebServiceFactory that configures each new web service it creates with an HTTP Accept-Language header with a value derived from the given Locale.
 
Method Summary
 java.net.URI getWebServiceURI(java.lang.Object webService)
          Called to obtain the URI that a web service previously created by this WebServiceFactory is connected to.
 ms.tfs.services.linking._03._IntegrationServiceSoap newLinkingWebService(TFSConnection connection, java.lang.String linkingEndpoint, java.net.URI connectionBaseURI, HttpClient httpClient, RegistrationClient registrationClient)
          Creates a new _IntegrationServiceSoap web service.
 ms.ws._LocationWebServiceSoap newLocationWebService(java.net.URI fullLocationServiceURI, HttpClient httpClient)
          Creates a new location web service, which cannot be created via WebServiceFactory.newWebService(TFSConnection, Class, URI, HttpClient, ServerDataProvider, RegistrationClient) because that method might require a working location web service.
 ms.tfs.services.registration._03._RegistrationSoap newRegistrationWebService(java.net.URI connectionBaseURI, HttpClient httpClient)
          Creates a new registration web service, which cannot be created via WebServiceFactory.newWebService(TFSConnection, Class, URI, HttpClient, ServerDataProvider, RegistrationClient) because that method requires a working registration web service.
 java.lang.Object newWebService(TFSConnection connection, java.lang.Class<?> webServiceInterfaceType, java.net.URI connectionBaseURI, HttpClient httpClient, ServerDataProvider serverDataProvider, RegistrationClient registrationClient)
          Creates a new web service implementation.
 ms.wss._ListsSoap newWSSWebService(TFSConnection connection, ProjectInfo projectInfo, java.net.URI connectionBaseURI, HttpClient httpClient, RegistrationClient registrationClient)
          Creates a new _ListsSoap web service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWebServiceFactory

public DefaultWebServiceFactory(java.util.Locale acceptLanguageLocale,
                                com.microsoft.tfs.core.ws.runtime.client.TransportRequestHandler transportRequestHandler)
Creates a DefaultWebServiceFactory that configures each new web service it creates with an HTTP Accept-Language header with a value derived from the given Locale.

Parameters:
acceptLanguageLocale - the Locale to use to set the Accept-Language HTTP header for requests made by web service proxies created by this factory. Specify null to not set the HTTP header.
transportRequestHandler - handles transport authentication to hosted TFS so a web request can be prepared properly or can be retried with new credentials. Specify null to cause the FederatedAuthException to be rethrown.
Method Detail

newRegistrationWebService

public ms.tfs.services.registration._03._RegistrationSoap newRegistrationWebService(java.net.URI connectionBaseURI,
                                                                                    HttpClient httpClient)
                                                                             throws java.net.URISyntaxException
Creates a new registration web service, which cannot be created via WebServiceFactory.newWebService(TFSConnection, Class, URI, HttpClient, ServerDataProvider, RegistrationClient) because that method requires a working registration web service.

Specified by:
newRegistrationWebService in interface WebServiceFactory
Parameters:
connectionBaseURI - the connection's base URI (must not be null)
httpClient - the HttpClient to use for accessing the web service (must not be null)
Returns:
a _RegistrationSoap (never null)
Throws:
java.net.URISyntaxException

newLocationWebService

public ms.ws._LocationWebServiceSoap newLocationWebService(java.net.URI fullLocationServiceURI,
                                                           HttpClient httpClient)
                                                    throws java.net.URISyntaxException
Creates a new location web service, which cannot be created via WebServiceFactory.newWebService(TFSConnection, Class, URI, HttpClient, ServerDataProvider, RegistrationClient) because that method might require a working location web service.

Specified by:
newLocationWebService in interface WebServiceFactory
Parameters:
fullLocationServiceURI - the full URI to the location service (must not be null)
httpClient - the HttpClient to use for accessing the web service (must not be null)
Returns:
a _LocationWebServiceSoap (never null)
Throws:
java.net.URISyntaxException

newWebService

public java.lang.Object newWebService(TFSConnection connection,
                                      java.lang.Class<?> webServiceInterfaceType,
                                      java.net.URI connectionBaseURI,
                                      HttpClient httpClient,
                                      ServerDataProvider serverDataProvider,
                                      RegistrationClient registrationClient)
                               throws java.net.URISyntaxException,
                                      UnknownWebServiceException
Creates a new web service implementation.

Specified by:
newWebService in interface WebServiceFactory
webServiceInterfaceType - the web service interface type (for example, _CatalogWebServiceSoap; not an implementation like _CatalogWebServiceSoap12Service) (must not be null)
connectionBaseURI - the connection's base URI (must not be null)
httpClient - the HttpClient to use for accessing the web service (must not be null)
serverDataProvider - the ServerDataProvider (must not be null except when webServiceInterfaceType is _LocationWebServiceSoap.class)
registrationClient - the RegistrationClient (may be null if the web service type is for a TFSConfigurationServer, which does not support the registration service)
Returns:
a web service implementation that implements the web service type specified by the type parameter or null if the web service type is known but no endpoint is appropriate for the current connection (for example, old server which doesn't support the requested service)
Throws:
UnknownWebServiceException - if the specified web service type is unknown
java.net.URISyntaxException

newLinkingWebService

public ms.tfs.services.linking._03._IntegrationServiceSoap newLinkingWebService(TFSConnection connection,
                                                                                java.lang.String linkingEndpoint,
                                                                                java.net.URI connectionBaseURI,
                                                                                HttpClient httpClient,
                                                                                RegistrationClient registrationClient)
                                                                         throws java.net.URISyntaxException
Creates a new _IntegrationServiceSoap web service.

Specified by:
newLinkingWebService in interface WebServiceFactory
Parameters:
connection - the TFSConnection
linkingEndpoint - the endpoint the linking web service should use
connectionBaseURI - the connection's base URI (must not be null)
httpClient - the HttpClient to use for accessing the web service (must not be null)
registrationClient - the RegistrationClient (must not be null)
Returns:
a _IntegrationServiceSoap web service implementation (never null)
Throws:
java.net.URISyntaxException

newWSSWebService

public ms.wss._ListsSoap newWSSWebService(TFSConnection connection,
                                          ProjectInfo projectInfo,
                                          java.net.URI connectionBaseURI,
                                          HttpClient httpClient,
                                          RegistrationClient registrationClient)
                                   throws java.net.URISyntaxException
Creates a new _ListsSoap web service.

Specified by:
newWSSWebService in interface WebServiceFactory
Parameters:
connection - the TFSConnection
projectInfo - the team project to create the web service for (must not be null)
connectionBaseURI - the connection's base URI (must not be null)
httpClient - the HttpClient to use for accessing the web service (must not be null)
registrationClient - the RegistrationClient (must not be null)
Returns:
a _ListsSoap web service implementation (never null)
Throws:
java.net.URISyntaxException

getWebServiceURI

public java.net.URI getWebServiceURI(java.lang.Object webService)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.ClassCastException,
                                     java.net.URISyntaxException
Called to obtain the URI that a web service previously created by this WebServiceFactory is connected to.

Specified by:
getWebServiceURI in interface WebServiceFactory
Parameters:
webService - the web service interface type (for example, _CatalogWebServiceSoap; not an implementation like _CatalogWebServiceSoap12Service) (must not be null)
Returns:
the URI the web service is connected to (never null)
Throws:
java.lang.IllegalArgumentException - if the argument is null or is not a web service previously created by this WebServiceFactory
java.lang.ClassCastException
java.net.URISyntaxException


© 2015 Microsoft. All rights reserved.