com.microsoft.tfs.core.clients.framework.catalog
Interface ICatalogService

All Known Implementing Classes:
CatalogService

public interface ICatalogService

The service responsible for providing a access to information about available Team Foundation Server resources.

Since:
TEE-SDK-10.1

Method Summary
 CatalogChangeContext createChangeContext()
          Creates a change context in which many changes can be batched
 ILocationService getLocationService()
           
 CatalogNode[] getRootNodes()
           
 CatalogNode[] queryNodes(java.lang.String[] pathSpecs, com.microsoft.tfs.util.GUID[] resourceTypeFilters, CatalogQueryOptions queryOptions)
          Returns the catalog nodes that exist below the parentPath and have a type that is listed in resourceTypeFilters.
 CatalogNode[] queryNodes(java.lang.String[] pathSpecs, com.microsoft.tfs.util.GUID[] resourceTypeFilters, CatalogResourceProperty[] propertyFilters, CatalogQueryOptions queryOptions)
          Returns the catalog nodes that exist below the parentPath and have a type that is listed in resourceTypeFilters.
 CatalogNode[] queryParents(com.microsoft.tfs.util.GUID resourceIdentifier, java.lang.String[] pathFilters, com.microsoft.tfs.util.GUID[] resourceTypeFilters, boolean recurseToRoot, CatalogQueryOptions queryOptions)
          Returns the nodes for the resource provided as well as the parents.
 CatalogResource[] queryResources(com.microsoft.tfs.util.GUID[] resourceIdentifiers, CatalogQueryOptions queryOptions)
          Returns the resource that is associated with the identifier.
 CatalogResource[] queryResources(com.microsoft.tfs.util.GUID[] resourceTypeIdentifiers, CatalogResourceProperty[] propertyFilters, CatalogQueryOptions queryOptions)
          Returns all of the catalog resources of the provided type.
 CatalogResource[] queryResourcesByType(com.microsoft.tfs.util.GUID[] resourceTypeIdentifiers, CatalogQueryOptions queryOptions)
          Returns all of the catalog resources of the provided type.
 CatalogResourceType[] queryResourceTypes(com.microsoft.tfs.util.GUID[] resourceTypeIdentifiers)
          Returns the resource types for all of the specified identifiers.
 CatalogNode queryRootNode(CatalogTree tree)
          Returns the specified root node.
 CatalogNode[] queryUpTree(java.lang.String path, com.microsoft.tfs.util.GUID[] resourceTypeFilters, CatalogQueryOptions queryOptions)
          Queries "up" the tree from the provided path looking for the provided types in its parent nodes' children.
 void saveDelete(CatalogNode node, java.lang.Boolean recurse)
          Deletes this node from the catalog.
 void saveMove(CatalogNode nodeToMove, CatalogNode newParent)
          Adds this move to the change context.
 void saveNode(CatalogNode node)
          Saves the updated node and its resource in the catalog.
 void saveResource(CatalogResource resource)
          Saves the updated resource in the catalog.
 

Method Detail

queryResourceTypes

CatalogResourceType[] queryResourceTypes(com.microsoft.tfs.util.GUID[] resourceTypeIdentifiers)
Returns the resource types for all of the specified identifiers. If null or an empty list is passed in, all resource types will be returned.

Parameters:
resourceTypeIdentifiers - Identifiers for the resource types that should be returned. If this has a value of null or empty, all resource types will be returned.
Returns:
Resource types for the requested identifiers.

queryResources

CatalogResource[] queryResources(com.microsoft.tfs.util.GUID[] resourceIdentifiers,
                                 CatalogQueryOptions queryOptions)
Returns the resource that is associated with the identifier.

Parameters:
resourceIdentifiers - The identifiers for the resources that are being search for.
queryOptions - If ExpandDependencies is specified, the Dependencies property on nodes will contain the nodes they are dependent on. If IncludeParents is specified, the ParentNode property on the CatalogNode will contain the parent node. Leaving a given option will result in the returned catalog nodes to have null for that value. Extra data should only be retrieved if it is needed since computing and sending information can be expensive.
Returns:
The resources with the specified identifiers.

queryResourcesByType

CatalogResource[] queryResourcesByType(com.microsoft.tfs.util.GUID[] resourceTypeIdentifiers,
                                       CatalogQueryOptions queryOptions)
Returns all of the catalog resources of the provided type. If GUID.EMPTY is passed in, all resources are returned.

Parameters:
resourceTypeIdentifiers - The identifier for the type of resource to filter on.
queryOptions - If ExpandDependencies is specified, the Dependencies property on nodes will contain the nodes they are dependent on. If IncludeParents is specified, the ParentNode property on the CatalogNode will contain the parent node. Leaving a given option will result in the returned catalog nodes to have null for that value. Extra data should only be retrieved if it is needed since computing and sending information can be expensive.
Returns:
the catalog resources of the specified type.

queryResources

CatalogResource[] queryResources(com.microsoft.tfs.util.GUID[] resourceTypeIdentifiers,
                                 CatalogResourceProperty[] propertyFilters,
                                 CatalogQueryOptions queryOptions)
Returns all of the catalog resources of the provided type. If GUID.EMPTY is passed in, all resources are returned.

Parameters:
resourceTypeIdentifiers - The identifier for the type of resource to filter on.
propertyFilters - The set of property filters to apply to the resource found. Matches will be based on both the key and the value of the property matching. If the value of a certain filter is null or empty then it will be assumed that all resource with the supplied property should be returned. A match consists of a resource that matches all of the propertyFilters.
queryOptions - If ExpandDependencies is specified, the Dependencies property on nodes will contain the nodes they are dependent on. If IncludeParents is specified, the ParentNode property on the CatalogNode will contain the parent node. Leaving a given option will result in the returned catalog nodes to have null for that value. Extra data should only be retrieved if it is needed since computing and sending information can be expensive.
Returns:
the catalog resources which matched the provided type

queryUpTree

CatalogNode[] queryUpTree(java.lang.String path,
                          com.microsoft.tfs.util.GUID[] resourceTypeFilters,
                          CatalogQueryOptions queryOptions)
Queries "up" the tree from the provided path looking for the provided types in its parent nodes' children. If the path is "TFSInstance1/PG1/TPC1/TP1" this query will be translated into a series of QueryNodes calls that have the following pathSpecs: "TFSInstance1/*" "TFSInstance1/PG1/*" "TFSInstance1/PG1/TPC1/*" An example of when this could be used is when a ReportingSite is being added to a node and it must find the ReportServer that is a child of one of its parent nodes.

Parameters:
path - The path of the item from where the "up" query should originate. Wildcards cannot be used in this path.
resourceTypeFilters - The list of types that this query should include. If this is null or empty, all types will be included.
queryOptions - If ExpandDependencies is specified, the Dependencies property on nodes will contain the nodes they are dependent on. If IncludeParents is specified, the ParentNode property on the CatalogNode will contain the parent node. Leaving a given option will result in the returned catalog nodes to have null for that value. Extra data should only be retrieved if it is needed since computing and sending information can be expensive.
Returns:
The catalog nodes that match the specified query.

queryParents

CatalogNode[] queryParents(com.microsoft.tfs.util.GUID resourceIdentifier,
                           java.lang.String[] pathFilters,
                           com.microsoft.tfs.util.GUID[] resourceTypeFilters,
                           boolean recurseToRoot,
                           CatalogQueryOptions queryOptions)
Returns the nodes for the resource provided as well as the parents. The direct nodes and the parent nodes will not be returned if they are filtered out. For the following tree: PG1 / \ PG2 PG3 / \ \ TPC1 TPC2 TPC3 / \ TP1 TP2 Query for TP1's identifier with no filters and recursing to the root would yield TP1, TPC1, PG2 and PG1.

Parameters:
resourceIdentifier - The identifier for the resource who's parents are being queried. The resource and its nodes will only be returned if they are not filtered out.
pathFilters - Nodes will only be returned if they live under one of the paths provided here. If this value is null or empty it will be assumed that parents from all places within the tree are valid.
resourceTypeFilters - The list of types that this query should include. If this is null or empty, all types will be included.
recurseToRoot - If this is true then parent nodes will be enumerated all the way to the root. If this is false then only the first level of parents will be returned.
queryOptions - If ExpandDependencies is specified, the Dependencies property on nodes will contain the nodes they are dependent on. If IncludeParents is specified, the ParentNode property on the CatalogNode will contain the parent node. Leaving a given option will result in the returned catalog nodes to have null for that value. Extra data should only be retrieved if it is needed since computing and sending information can be expensive.
Returns:
The nodes for the resource provided as well as the parents of those nodes that apply to the provided filters.

queryNodes

CatalogNode[] queryNodes(java.lang.String[] pathSpecs,
                         com.microsoft.tfs.util.GUID[] resourceTypeFilters,
                         CatalogQueryOptions queryOptions)
Returns the catalog nodes that exist below the parentPath and have a type that is listed in resourceTypeFilters.

Parameters:
pathSpecs - The paths of the element or elements that are being searched for. This path can contain the wildcards "*", "**" and "..." where "*" means one-level and "**" and "..." means any number of levels.
resourceTypeFilters - The list of types that this query should include. If this is null or empty, all types will be included.
queryOptions - If ExpandDependencies is specified, the Dependencies property on nodes will contain the nodes they are dependent on. If IncludeParents is specified, the ParentNode property on the CatalogNode will contain the parent node. Leaving a given option will result in the returned catalog nodes to have null for that value. Extra data should only be retrieved if it is needed since computing and sending information can be expensive.
Returns:
The catalog nodes that exist below the parentPath and have a type that is listed in resourceTypeFilters.

queryNodes

CatalogNode[] queryNodes(java.lang.String[] pathSpecs,
                         com.microsoft.tfs.util.GUID[] resourceTypeFilters,
                         CatalogResourceProperty[] propertyFilters,
                         CatalogQueryOptions queryOptions)
Returns the catalog nodes that exist below the parentPath and have a type that is listed in resourceTypeFilters.

Parameters:
pathSpecs - The paths of the element or elements that are being searched for. This path can contain the wildcards "*", "**" and "..." where "*" means one-level and "**" and "..." means any number of levels.
resourceTypeFilters - The list of types that this query should include. If this is null or empty, all types will be included.
propertyFilters - The set of property filters to apply to the nodes found. Matches will be based on both the key and the value of the property matching. If the value of a certain filter is null or empty then it will be assumed that all nodes with the supplied property should be returned. A match consists of a node/resource that matches all of the propertyFilters.
queryOptions - If ExpandDependencies is specified, the Dependencies property on nodes will contain the nodes they are dependent on. If IncludeParents is specified, the ParentNode property on the CatalogNode will contain the parent node. Leaving a given option will result in the returned catalog nodes to have null for that value. Extra data should only be retrieved if it is needed since computing and sending information can be expensive.
Returns:
The catalog nodes that exist below the parentPath and have a type that is listed in resourceTypeFilters.

getRootNodes

CatalogNode[] getRootNodes()
Returns:
the root nodes in the tree.

queryRootNode

CatalogNode queryRootNode(CatalogTree tree)
Returns the specified root node. Well-known root paths can be found in Microsoft.TeamFoundation.Framework.Common.Catalog.CatalogTree.

Parameters:
tree - The tree of the desired root.
Returns:
The CatalogNode for the tree.

saveResource

void saveResource(CatalogResource resource)
Saves the updated resource in the catalog. Note that service definitions that exist as service references will be created if they are new and updated if they are not.

Parameters:
resource - The resource to update.

saveNode

void saveNode(CatalogNode node)
Saves the updated node and its resource in the catalog.

Parameters:
node - The node that has been created or updated.

saveDelete

void saveDelete(CatalogNode node,
                java.lang.Boolean recurse)
Deletes this node from the catalog. If this node is the only node that points to the resource it points to then this resource will also be deleted. If this node exists in the infrastructure tree then the resource that is associated with this node will also be deleted and it will be inherently recursive.

Parameters:
node - The node to delete.
recurse - True if the children nodes of this node should be deleted.

saveMove

void saveMove(CatalogNode nodeToMove,
              CatalogNode newParent)
Adds this move to the change context. It will be sent to the server when Save() is called. Note that if nodeToMove or newParent also have updated properties then those will be committed as well. Any node that is explicitly moved will have IsDefault set to 0.

Parameters:
nodeToMove - The node to move under the newParent.
newParent - The newParent to place nodeToMove under.

createChangeContext

CatalogChangeContext createChangeContext()
Creates a change context in which many changes can be batched

Returns:
A change context in which many changes can be batched together.

getLocationService

ILocationService getLocationService()
Returns:
the location service that this catalog uses for its service definition references.


© 2015 Microsoft. All rights reserved.