Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Changing the author of a change set via the java API

Is it possible to change the author of a change set via the java API? Also, is it possible to retrieve all change sets via the java API? I see that there's a MAX_QUERY_SIZE limit on the number of returned entries. How can I fetch more than that? Is there any kind of paging or something?

0 votes



8 answers

Permanent link
Okay, I found the answer to one of my questions. To fetch all change sets, even exceeding the MAX_QUERY_SIZE, I found HistoryIterator. It doesn't look like I can import HistoryIterator and use it directly (though I'm a java noob), but reading the source for the class told me what to do.

It looks like it uses IWorkspaceConnection.changeHistory to fetch the change history for a component, and then repeatedly calls IChangeHistory.getHistoryDescriptors and IChangeHistoryDescriptor.previousHistory to fetch the entire history.

1 vote


Permanent link
Is it possible to change the author of a change set via the java API? Also, is it possible to retrieve all change sets via the java API? I see that there's a MAX_QUERY_SIZE limit on the number of returned entries. How can I fetch more than that? Is there any kind of paging or something?


Brian, do you refer to work items? I think I have seen the MAX_QUERY_SIZE but that was for work items.

0 votes


Permanent link
Brian, do you refer to work items? I think I have seen the MAX_QUERY_SIZE but that was for work items.


I was referring to the second parameter on IWorkspaceManager.findChangeSets, which is 'maxResults'. The documentation I have says:

maxResults - The maximum number of results to return, must be >0, if larger than MAX_QUERY_SIZE, only MAX_QUERY_SIZE results will be returned.

So I was wondering how I could fetch all change sets, even if the number exceeds MAX_QUERY_SIZE.

0 votes


Permanent link
Brian, do you refer to work items? I think I have seen the MAX_QUERY_SIZE but that was for work items.


I was referring to the second parameter on IWorkspaceManager.findChangeSets, which is 'maxResults'. The documentation I have says:

maxResults - The maximum number of results to return, must be >0, if larger than MAX_QUERY_SIZE, only MAX_QUERY_SIZE results will be returned.

So I was wondering how I could fetch all change sets, even if the number exceeds MAX_QUERY_SIZE.

For Work items there is a similar limit.I was able to set it to maxint-1 or something. Not sure if you can change the user in the changest. I have not done a lot with the SCM API.

0 votes


Permanent link
It looks like I might be able to change the author of a comment via IChangeEvent.setAuthor, and then IChangeEventService.save to save the change, but I'm not sure how to instantiate an IChangeEventService. Does anyone know how to do that, or does this sound like the right method?

0 votes


Permanent link
It looks like I might be able to change the author of a comment via IChangeEvent.setAuthor, and then IChangeEventService.save to save the change, but I'm not sure how to instantiate an IChangeEventService. Does anyone know how to do that, or does this sound like the right method?


On the server you can get services using getService(IChangeEventService.class); inherited from AbstractService.

In the Client Library you can use teamRepository.getClientLibrary(IChangeEventService.class)

0 votes


Permanent link
In the Client Library you can use teamRepository.getClientLibrary(IChangeEventService.class)


When I try that, getClientLibrary returns null. Is there something else that I also have to do to make that work?

0 votes


Permanent link
The SDK if you hover over tha class and have it set up right says:

com.ibm.team.repository.common.service.IChangeEventService
Provides operations for creating, updating and deleting change events in the repository.

On the server, use AbstractService.getService(Class) to obtain an instance. This service is available remotely. (The client interface IChangeEventManager is the client-side counterpart of this service.)

Since:
0.5
@NoImplement
Clients must not implement this interface.


I can't find IChangeEventManager in the Javadoc for the Plain Java Client Libraries. Sorry, I can't help here.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Feb 27 '12, 8:05 p.m.

Question was seen: 5,270 times

Last updated: Feb 27 '12, 8:05 p.m.

Confirmation Cancel Confirm