How to use JAVA api to get latest build status
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?
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
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).
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!