It's all about the answers!

Ask a question

How to use JAVA api to get latest build status


Hsuan-Po Lin (1143) | asked Jul 22 '11, 6:12 a.m.
Hi everyone, now we try to use the following JAVA API to get the latest build status,

List buildResults = teamRepository.itemManager().fetchPartialItems(queryPage.getItemHandles(),
IItemManager.DEFAULT, Arrays.asList(properties), monitor);

but the obtained results are delayed compare with the results directly seen from eclipse client.
for example, the build status in eclipse client is already "complete", but the build status obtain from api is still "in progress"

Do you have any idea about this issue, should I refresh anything and then retrieve the build status?

2 answers



permanent link
Sterling Bates (2311612) | answered Jul 23 '11, 11:46 p.m.
for example, the build status in eclipse client is already "complete", but the build status obtain from api is still "in progress"

Reading the Javadoc comment for IItemManager (see the source code in the SDK) it says this:

The first time a client asks for the shared item for a particular item, the item manager fetches the current state of the item from the repository... When the item manager is subsequently asked for the shared item for the same particular item, it returns the shared item without contacting the server.

There's two possibilities though. First is a REFRESH property on IItemManager. Try changing IItemManager.DEFAULT to this property. There's also a refreshSharedItems method that looks to be used for bulk scenarios of potentially different shared item types (I dunno).

permanent link
Hsuan-Po Lin (1143) | answered Jul 24 '11, 10:56 p.m.
for example, the build status in eclipse client is already "complete", but the build status obtain from api is still "in progress"

Reading the Javadoc comment for IItemManager (see the source code in the SDK) it says this:

The first time a client asks for the shared item for a particular item, the item manager fetches the current state of the item from the repository... When the item manager is subsequently asked for the shared item for the same particular item, it returns the shared item without contacting the server.

There's two possibilities though. First is a REFRESH property on IItemManager. Try changing IItemManager.DEFAULT to this property. There's also a refreshSharedItems method that looks to be used for bulk scenarios of potentially different shared item types (I dunno).

thanks for the feedback, it helps!

Your answer


Register or to post your answer.