com.microsoft.tfs.core.clients.workitem
Class WorkItemClient

java.lang.Object
  extended by com.microsoft.tfs.core.clients.workitem.WorkItemClient
All Implemented Interfaces:
com.microsoft.tfs.util.Closable

public final class WorkItemClient
extends java.lang.Object
implements com.microsoft.tfs.util.Closable

Provides access to the Work Item Tracking services.

Since:
TEE-SDK-10.1

Constructor Summary
WorkItemClient(TFSTeamProjectCollection connection, ms.tfs.workitemtracking.clientservices._03._ClientService2Soap webService2, ms.tfs.workitemtracking.clientservices._03._ClientService3Soap webService3, ms.tfs.workitemtracking.clientservices._03._ClientService5Soap webService5)
           
 
Method Summary
 void close()
          Closes this work item client down.
 Query createEmptyQuery()
           
 Query createQuery(java.lang.String wiql)
           
 Query createQuery(java.lang.String wiql, BatchReadParameterCollection batchReadParams)
           
 Query createQuery(java.lang.String wiql, java.util.Map<java.lang.String,java.lang.Object> queryContext)
           
 Query createReferencingQuery(java.lang.String artifactUri)
           
 void deleteWorkItemByID(int id)
           
 void deleteWorkItemType(java.lang.String projectName, java.lang.String workItemTypeName)
           
 TFSTeamProjectCollection getConnection()
           
 java.util.Properties getDatabaseConfigurationDebugInfo(java.util.Locale locale)
          Gets localized database configuration properties for use in support situations.
 java.io.File getDatabaseDirectory()
           
 java.io.File getDatabaseDiskDirectoryForDebugInfo()
           
static QueryFolder getDefaultParent(Project project, boolean isPublic)
           
 WorkItemEventEngine getEventEngine()
           
 FieldDefinitionCollection getFieldDefinitions()
           
 java.lang.String[] getGlobalAndProjectGroups(com.microsoft.tfs.util.GUID serverGuid, com.microsoft.tfs.util.GUID projectGuid)
          Get list of TFS Global and Project groups
 GroupDataProvider getGroupDataProvider(java.lang.String projectName)
          Retrieve the cached group data provider for the specified project name.
 WorkItemLinkTypeCollection getLinkTypes()
           
 IProcessGuidance getProcessGuidance()
           
 ProjectCollection getProjects()
          Obtain the Project objects managed by this client.
 RegisteredLinkTypeCollection getRegisteredLinkTypes()
           
 StoredQuery getStoredQuery(com.microsoft.tfs.util.GUID guid)
          Similar to "WorkItemStore#GetStoredQuery(Guid)" in MS code.
 java.lang.String getUpdateXMLForDebugging(WorkItem workItem)
           
 UserDisplayMode getUserDisplayMode()
           
 java.lang.String getUserDisplayName()
           
 WorkItemServerVersion getVersion()
           
 ms.tfs.workitemtracking.clientservices._03._ClientService2Soap getWebService2()
           
 ms.tfs.workitemtracking.clientservices._03._ClientService3Soap getWebService3()
           
 ms.tfs.workitemtracking.clientservices._03._ClientService5Soap getWebService5()
           
 WorkItem getWorkItemByID(int id)
          Retrieves a work item by ID from the TFS server.
 WorkItem newWorkItem(WorkItemType inputType)
           
 void precacheData()
          Pre-caches data that is used by this client.
 WorkItemCollection query(int[] ids, java.lang.String wiql)
           
 WorkItemCollection query(java.lang.String wiql)
           
 WorkItemCollection query(java.lang.String wiql, BatchReadParameterCollection batchReadParams)
           
 WorkItemCollection query(java.lang.String wiql, java.util.Map<java.lang.String,java.lang.Object> queryContext)
           
 WorkItemCollection query(java.lang.String wiql, java.util.Map<java.lang.String,java.lang.Object> queryContext, boolean dayPrecision)
           
 void refreshCache()
           
 boolean supportsLinkQueries()
           
 boolean supportsReadOnlyLinkTypes()
           
 boolean supportsWebAccessWorkItems()
           
 boolean supportsWIQLEvaluationOnServer()
           
 boolean supportsWIQLFieldAndGroupOperators()
           
 boolean supportsWorkItemLinkTypes()
           
 void validateWIQL(java.lang.String wiql)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkItemClient

public WorkItemClient(TFSTeamProjectCollection connection,
                      ms.tfs.workitemtracking.clientservices._03._ClientService2Soap webService2,
                      ms.tfs.workitemtracking.clientservices._03._ClientService3Soap webService3,
                      ms.tfs.workitemtracking.clientservices._03._ClientService5Soap webService5)
Method Detail

supportsWorkItemLinkTypes

public boolean supportsWorkItemLinkTypes()

supportsReadOnlyLinkTypes

public boolean supportsReadOnlyLinkTypes()

supportsLinkQueries

public boolean supportsLinkQueries()

supportsWIQLFieldAndGroupOperators

public boolean supportsWIQLFieldAndGroupOperators()

supportsWebAccessWorkItems

public boolean supportsWebAccessWorkItems()

supportsWIQLEvaluationOnServer

public boolean supportsWIQLEvaluationOnServer()

getDatabaseDirectory

public java.io.File getDatabaseDirectory()

getDatabaseConfigurationDebugInfo

public java.util.Properties getDatabaseConfigurationDebugInfo(java.util.Locale locale)
Gets localized database configuration properties for use in support situations.

Parameters:
locale - the Locale to localize info strings to (null to use the default locale)
Returns:
localized properties describing the current database configuration (never null)

getDatabaseDiskDirectoryForDebugInfo

public java.io.File getDatabaseDiskDirectoryForDebugInfo()

getWorkItemByID

public WorkItem getWorkItemByID(int id)
Retrieves a work item by ID from the TFS server. The returned work item is open. If the ID does not correspond to a valid work item ID on the server, or if the current user does not have permission to access the work item with that ID, this method returns null.

Parameters:
id - ID of the work item to retrieve
Returns:
an open WorkItem or null

deleteWorkItemByID

public void deleteWorkItemByID(int id)

deleteWorkItemType

public void deleteWorkItemType(java.lang.String projectName,
                               java.lang.String workItemTypeName)

getVersion

public WorkItemServerVersion getVersion()
Returns:
the version of the work item client in use.

getWebService2

public ms.tfs.workitemtracking.clientservices._03._ClientService2Soap getWebService2()
Returns:
the Work Item Tracking web service proxy

getWebService3

public ms.tfs.workitemtracking.clientservices._03._ClientService3Soap getWebService3()
Returns:
the Work Item Tracking web service proxy (v3, 2010) (may be null)
Since:
TFS 2010

getWebService5

public ms.tfs.workitemtracking.clientservices._03._ClientService5Soap getWebService5()
Returns:
the Work Item Tracking web service proxy (v5, Dev11) (may be null)
Since:
TFS 2012

precacheData

public void precacheData()
Pre-caches data that is used by this client. Calling this method early, in a background thread, will improve the performance of subsequent work item operations.


refreshCache

public void refreshCache()

getProjects

public ProjectCollection getProjects()
Obtain the Project objects managed by this client. Each Project object represents a Team Project on the TFS server. The Project objects are cached by this client.

Returns:
an array of Project objects

getGroupDataProvider

public GroupDataProvider getGroupDataProvider(java.lang.String projectName)
Retrieve the cached group data provider for the specified project name.

Parameters:
projectName - The project to get groups for.
Returns:
A group data provider for the specified project.

getGlobalAndProjectGroups

public java.lang.String[] getGlobalAndProjectGroups(com.microsoft.tfs.util.GUID serverGuid,
                                                    com.microsoft.tfs.util.GUID projectGuid)
Get list of TFS Global and Project groups

Parameters:
serverGuid - Guid for the server for which group information needs to be retrieved
projectGuid - Guid for the project for which group information needs to be retrieved
Returns:
List of TFS Global and Project group display names.

close

public void close()
Closes this work item client down. The database connection pool is closed and JDBC connections are released.

Specified by:
close in interface com.microsoft.tfs.util.Closable

newWorkItem

public WorkItem newWorkItem(WorkItemType inputType)

getFieldDefinitions

public FieldDefinitionCollection getFieldDefinitions()

getRegisteredLinkTypes

public RegisteredLinkTypeCollection getRegisteredLinkTypes()

getLinkTypes

public WorkItemLinkTypeCollection getLinkTypes()

getUpdateXMLForDebugging

public java.lang.String getUpdateXMLForDebugging(WorkItem workItem)

getConnection

public TFSTeamProjectCollection getConnection()

getStoredQuery

public StoredQuery getStoredQuery(com.microsoft.tfs.util.GUID guid)
Similar to "WorkItemStore#GetStoredQuery(Guid)" in MS code.


createReferencingQuery

public Query createReferencingQuery(java.lang.String artifactUri)

createQuery

public Query createQuery(java.lang.String wiql,
                         java.util.Map<java.lang.String,java.lang.Object> queryContext)
                  throws InvalidQueryTextException
Throws:
InvalidQueryTextException

createQuery

public Query createQuery(java.lang.String wiql)
                  throws InvalidQueryTextException
Throws:
InvalidQueryTextException

createQuery

public Query createQuery(java.lang.String wiql,
                         BatchReadParameterCollection batchReadParams)
                  throws InvalidQueryTextException
Throws:
InvalidQueryTextException

createEmptyQuery

public Query createEmptyQuery()

query

public WorkItemCollection query(java.lang.String wiql,
                                java.util.Map<java.lang.String,java.lang.Object> queryContext,
                                boolean dayPrecision)
                         throws InvalidQueryTextException
Throws:
InvalidQueryTextException

query

public WorkItemCollection query(java.lang.String wiql,
                                java.util.Map<java.lang.String,java.lang.Object> queryContext)
                         throws InvalidQueryTextException
Throws:
InvalidQueryTextException

query

public WorkItemCollection query(int[] ids,
                                java.lang.String wiql)
                         throws InvalidQueryTextException
Throws:
InvalidQueryTextException

query

public WorkItemCollection query(java.lang.String wiql)
                         throws InvalidQueryTextException
Throws:
InvalidQueryTextException

query

public WorkItemCollection query(java.lang.String wiql,
                                BatchReadParameterCollection batchReadParams)
                         throws InvalidQueryTextException
Throws:
InvalidQueryTextException

validateWIQL

public void validateWIQL(java.lang.String wiql)
                  throws InvalidQueryTextException
Throws:
InvalidQueryTextException

getProcessGuidance

public IProcessGuidance getProcessGuidance()

getDefaultParent

public static QueryFolder getDefaultParent(Project project,
                                           boolean isPublic)

getUserDisplayMode

public UserDisplayMode getUserDisplayMode()

getUserDisplayName

public java.lang.String getUserDisplayName()

getEventEngine

public WorkItemEventEngine getEventEngine()


© 2015 Microsoft. All rights reserved.