|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.clients.framework.location.LocationService
public class LocationService
The TFS location service. Implements the ILocationService
interface
via the ServerDataProvider
(which extends ILocationService
to
provide some more convenient methods).
Constructor Summary | |
---|---|
LocationService(TFSConnection connection)
Construct the TFS Location Service. |
Method Summary | |
---|---|
void |
authenticate()
|
AccessMapping |
configureAccessMapping(java.lang.String moniker,
java.lang.String displayName,
java.lang.String accessPoint,
boolean makeDefault)
Configures the AccessMapping with the provided moniker to have the provided display name and access point. |
void |
connect(ConnectOptions connectOptions)
Performs all of the steps that are necessary for setting up a connection with a TeamFoundationServer. |
void |
ensureAuthenticated()
|
java.lang.String |
findServerLocation(com.microsoft.tfs.util.GUID serverGuid)
The function finds the location of the server that has the guid passed. |
ServiceDefinition |
findServiceDefinition(java.lang.String serviceType,
com.microsoft.tfs.util.GUID serviceIdentifier)
Finds the ServiceDefinition with the specified service type and service identifier. |
ServiceDefinition[] |
findServiceDefinitions(java.lang.String serviceType)
Finds the ServiceDefinitions for all of the services with the specified service type. |
ServiceDefinition[] |
findServiceDefinitionsByToolType(java.lang.String toolType)
Finds the ServiceDefinitions for all of the services with the specified tool type. |
AccessMapping |
getAccessMapping(java.lang.String moniker)
Gets the AccessMapping with the specified moniker. |
TeamFoundationIdentity |
getAuthenticatedIdentity()
|
TeamFoundationIdentity |
getAuthorizedIdentity()
|
com.microsoft.tfs.util.GUID |
getCatalogResourceID()
|
AccessMapping |
getClientAccessMapping()
The AccessMapping for the current connection to the server. |
AccessMapping[] |
getConfiguredAccessMappings()
All of the AccessMappings that this location service knows about. |
AccessMapping |
getDefaultAccessMapping()
All of the AccessMappings that this location service knows about. |
com.microsoft.tfs.util.GUID |
getInstanceID()
|
protected com.microsoft.tfs.core.clients.framework.location.internal.LocationCacheManager |
getLocationCacheManager()
|
ServerCapabilities |
getServerCapabilities()
The capabilities of the TFS server. |
boolean |
hasAuthenticated()
|
java.lang.String |
locationForAccessMapping(ServiceDefinition serviceDefinition,
AccessMapping accessMapping)
Returns the location for the ServiceDefinition for the provided AccessMapping. |
java.lang.String |
locationForAccessMapping(ServiceDefinition serviceDefinition,
AccessMapping accessMapping,
boolean encodeRelativeComponents)
Returns the location for the ServiceDefinition for the provided AccessMapping. |
java.lang.String |
locationForAccessMapping(java.lang.String serviceType,
com.microsoft.tfs.util.GUID serviceIdentifier,
AccessMapping accessMapping)
Returns the location for the ServiceDefinition that has the specified service type and service identifier for the provided AccessMapping. |
java.lang.String |
locationForCurrentConnection(ServiceDefinition serviceDefinition)
Returns the location for the ServiceDefintion that should be used based on the current connection. |
java.lang.String |
locationForCurrentConnection(java.lang.String serviceType,
com.microsoft.tfs.util.GUID serviceIdentifier)
Returns the location for the ServiceDefintion associated with the ServiceType and ServiceIdentifier that should be used based on the current connection. |
void |
reactToPossibleServerUpdate(int serverLastChangeId)
Clears any caches that it has if the server has been updated. |
void |
removeAccessMapping(java.lang.String moniker)
Removes an AccessMapping and all of the locations that are mapped to it within ServiceDefinitions. |
void |
removeServiceDefinition(ServiceDefinition serviceDefinition)
Removes the specified ServiceDefinition from the location service. |
void |
removeServiceDefinition(java.lang.String serviceType,
com.microsoft.tfs.util.GUID serviceIdentifier)
Removes the ServiceDefinition with the specified service type and service identifier from the location service. |
void |
removeServiceDefinitions(ServiceDefinition[] serviceDefinitions)
Removes the specified ServiceDefinitions from the location service. |
void |
saveServiceDefinition(ServiceDefinition serviceDefinition)
Saves the provided ServiceDefinition within the location service. |
void |
saveServiceDefinitions(ServiceDefinition[] serviceDefinitions)
Saves the provided ServiceDefinitions within the location service. |
void |
setDefaultAccessMapping(AccessMapping accessMapping)
Sets the default AccessMapping to the AccessMapping passed in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocationService(TFSConnection connection)
connection
- A TFS connection (must not be null
)Method Detail |
---|
protected com.microsoft.tfs.core.clients.framework.location.internal.LocationCacheManager getLocationCacheManager()
public AccessMapping configureAccessMapping(java.lang.String moniker, java.lang.String displayName, java.lang.String accessPoint, boolean makeDefault)
configureAccessMapping
in interface ILocationService
moniker
- A string that uniquely identifies this AccessMapping. This value
cannot be null or empty.displayName
- Display name for this AccessMapping. This value cannot be null or
empty.accessPoint
- This is the base URL for the server that will map to this
AccessMapping. This value cannot be null or empty.
The access point should consist of the scheme, authority, port and
web application virtual path of the target-able server address.
For example, an access point will most commonly look like this:
http://server:8080/tfs/makeDefault
- If true, this AccessMapping will be made the default
AccessMapping. If false, the default AccessMapping will not
change.
InvalidAccessPointException
- Thrown if the access point for this AccessMapping is invalid
or if it conflicts with an already registered access point.public ServiceDefinition findServiceDefinition(java.lang.String serviceType, com.microsoft.tfs.util.GUID serviceIdentifier)
findServiceDefinition
in interface ILocationService
serviceType
- The service type of the ServiceDefinition to find.serviceIdentifier
- The service identifier of the ServiceDefinition to find.
public ServiceDefinition[] findServiceDefinitions(java.lang.String serviceType)
findServiceDefinitions
in interface ILocationService
serviceType
- The case-insensitive string that identifies what type of service
is being requested. If this value is null, ServiceDefinitions for
all services registered with this location service will be
returned.
public ServiceDefinition[] findServiceDefinitionsByToolType(java.lang.String toolType)
findServiceDefinitionsByToolType
in interface ILocationService
toolType
- The case-insensitive string that will match the tool type of a set
of ServiceDefinitions. If null or empty is passed in for this
value then all of the ServiceDefinitions will be returned.
public AccessMapping getAccessMapping(java.lang.String moniker)
getAccessMapping
in interface ILocationService
moniker
- The moniker for the desired AccessMapping. This value cannot be
null or empty.
public AccessMapping getClientAccessMapping()
getClientAccessMapping
in interface ILocationService
public AccessMapping[] getConfiguredAccessMappings()
getConfiguredAccessMappings
in interface ILocationService
public AccessMapping getDefaultAccessMapping()
getDefaultAccessMapping
in interface ILocationService
public java.lang.String locationForAccessMapping(java.lang.String serviceType, com.microsoft.tfs.util.GUID serviceIdentifier, AccessMapping accessMapping)
locationForAccessMapping
in interface ILocationService
serviceType
- The service type of the ServiceDefinition to find the location
for.serviceIdentifier
- The service identifier of the ServiceDefinition to find the
location for.accessMapping
- The AccessMapping to find the location for.
InvalidServiceDefinitionException
- The associated ServiceDefinition is not valid and no location
can be found.
ServiceDefinitionDoesNotExistException
- A ServiceDefinition with the provided service type and
identifier does not exist.
InvalidAccessPointException
- The AccessMapping passed in does not have a valid access
point.public java.lang.String locationForAccessMapping(ServiceDefinition serviceDefinition, AccessMapping accessMapping)
locationForAccessMapping
in interface ILocationService
serviceDefinition
- The ServiceDefinition to find the location for.accessMapping
- The AccessMapping to find the location for.
InvalidServiceDefinitionException
- The ServiceDefinition passed in is not valid.
InvalidAccessPointException
- The AccessMapping passed in does not have a valid access
point.public java.lang.String locationForAccessMapping(ServiceDefinition serviceDefinition, AccessMapping accessMapping, boolean encodeRelativeComponents)
locationForAccessMapping
in interface ILocationService
serviceDefinition
- The ServiceDefinition to find the location for.accessMapping
- The AccessMapping to find the location for.encodeRelativeComponents
- If true, URI-encode any relative URI path components before
appending to the root URI.
InvalidServiceDefinitionException
- The ServiceDefinition passed in is not valid.
InvalidAccessPointException
- The AccessMapping passed in does not have a valid access
point.public java.lang.String locationForCurrentConnection(java.lang.String serviceType, com.microsoft.tfs.util.GUID serviceIdentifier)
locationForCurrentConnection
in interface ILocationService
serviceType
- The service type of the ServiceDefinition to find the location
for.serviceIdentifier
- The service identifier of the ServiceDefinition to find the
location for.
InvalidServiceDefinitionException
- The associated ServiceDefinition is not valid and no location
can be found.public java.lang.String locationForCurrentConnection(ServiceDefinition serviceDefinition)
locationForCurrentConnection
in interface ILocationService
serviceDefinition
- The ServiceDefinition to find the location for.
InvalidServiceDefinitionException
- The ServiceDefinition passed in is not valid and no location
can be found.public void removeAccessMapping(java.lang.String moniker)
removeAccessMapping
in interface ILocationService
moniker
- The moniker for the AccessMapping to remove.
RemoveAccessMappingException
- Thrown if the caller tries to remove the default AccessMapping
and this location service cannot inherit its default
AccessMapping from a parent.public void removeServiceDefinition(java.lang.String serviceType, com.microsoft.tfs.util.GUID serviceIdentifier)
removeServiceDefinition
in interface ILocationService
serviceType
- The service type of the ServiceDefinition to remove.serviceIdentifier
- The service identifier of the ServiceDefinition to remove.
IllegalDeleteSelfReferenceServiceDefinitionExceptio
- Thrown if the caller tries to delete the self-reference
(location service) ServiceDefinition.public void removeServiceDefinition(ServiceDefinition serviceDefinition)
removeServiceDefinition
in interface ILocationService
serviceDefinition
- The ServiceDefinition to remove. This must be a ServiceDefinition
that is already registered in the location service. Equality is
decided by matching the service type and the identifier.
IllegalDeleteSelfReferenceServiceDefinitionException
- Thrown if the caller tries to delete the self-reference
(location service) ServiceDefinition.public void removeServiceDefinitions(ServiceDefinition[] serviceDefinitions)
removeServiceDefinitions
in interface ILocationService
serviceDefinitions
- The ServiceDefinitions to remove. These must be ServiceDefinitions
that are already registered in the location service. Equality is
decided by matching the service type and the identifier.
IllegalDeleteSelfReferenceServiceDefinitionException
- Thrown if the caller tries to delete the self-reference
(location service) ServiceDefinition.public void saveServiceDefinition(ServiceDefinition serviceDefinition)
saveServiceDefinition
in interface ILocationService
serviceDefinition
- The ServiceDefinition to save. This object will be updated with a
new Identifier if one is not already assigned.
InvalidServiceDefinitionException
- The ServiceDefinition being saved is not valid.
AccessMappingNotRegisteredException
- The ServiceDefinition references an AccessMapping that has not
been registered.
DuplicateLocationMappingException
- Thrown if a given AccessMapping has two or more
LocationMappings on a ServiceDefinition.public void saveServiceDefinitions(ServiceDefinition[] serviceDefinitions)
saveServiceDefinitions
in interface ILocationService
serviceDefinitions
- The ServiceDefinitions to save. These objects will be updated with
a new Identifier if one is not already assigned.
InvalidServiceDefinitionException
- The ServiceDefinition being saved is not valid.
AccessMappingNotRegisteredException
- The ServiceDefinition references an AccessMapping that has not
been registered.
DuplicateLocationMappingException
- Thrown if a given AccessMapping has two or more
LocationMappings on a ServiceDefinitionpublic void setDefaultAccessMapping(AccessMapping accessMapping)
setDefaultAccessMapping
in interface ILocationService
accessMapping
- The AccessMapping that should become the default AccessMapping.
This AccessMapping must already be configured with this location
service.
AccessMappingNotRegisteredException
- The AccessMapping being set to the default has not been
registered.public void connect(ConnectOptions connectOptions)
connect
in interface ServerDataProvider
connectOptions
- Specifies what information that should be returned from the
server.public TeamFoundationIdentity getAuthorizedIdentity()
getAuthorizedIdentity
in interface ServerDataProvider
public TeamFoundationIdentity getAuthenticatedIdentity()
getAuthenticatedIdentity
in interface ServerDataProvider
public boolean hasAuthenticated()
hasAuthenticated
in interface ServerDataProvider
public void ensureAuthenticated()
ensureAuthenticated
in interface ServerDataProvider
public void authenticate()
authenticate
in interface ServerDataProvider
public com.microsoft.tfs.util.GUID getCatalogResourceID()
getCatalogResourceID
in interface ServerDataProvider
public com.microsoft.tfs.util.GUID getInstanceID()
getInstanceID
in interface ServerDataProvider
public ServerCapabilities getServerCapabilities()
ServerDataProvider
getServerCapabilities
in interface ServerDataProvider
public java.lang.String findServerLocation(com.microsoft.tfs.util.GUID serverGuid)
findServerLocation
in interface ServerDataProvider
serverGuid
- the GUID for the server we are looking up
public void reactToPossibleServerUpdate(int serverLastChangeId)
ServerDataProvider
reactToPossibleServerUpdate
in interface ServerDataProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |