How to create stream from a snapshot using plain Java API
How to create a new stream from a snapshot using plain java API ? Snapshot name and new stream name should be given as an input criteria. Please help.
|
2 answers
Have you looked at the snippets included with the plain Java client libraries? Snippet 2 shows how to create a stream. You would do the same and add the component baselines from the snapshot. I'm not sure what you mean by the snapshot and stream names being input criteria.
Comments
Kaushambi Singh
commented Apr 11 '13, 3:06 a.m.
Thanks for your reply. Yes, I saw the snippet but it doesn't create stream from snapshot, as well as I an new to the API interfaces. By input criteria I meant : I already have a snapshot created on a different stream B (using RTC Eclipse GUI feature) so I want that I should be prompted to ask the snapshot name ( which is already present on stream B) and the new stream name (which would be created from that snapshot) and then the new stream should get created with the provided snapshot name. If you could help me with this part, that would be great. thanks!
Kaushambi Singh
commented Apr 11 '13, 9:01 a.m.
Also Tim, the snippet creates Project area and stream every time I run it because its calling Snippet 3 every time. I want to have the stream created in an existing project area. Is there a way where I can provide my existing project area as parameter.
From the snippet:
IWorkspaceConnection stream = wm.createStream(teamArea, "Example Stream", "Description", monitor); Replace the team area with your existing project area and ignore the part of the snippet that creates a project area. For finding your snapshot: IBaselineSetSearchCriteria criteria = IBaselineSetSearchCriteria.FACTORY.newInstance(); criteria.setExactName(name); criteria.setOwnerWorkspaceOptional(streamHandle); wm.findBaselineSets(criteria, expectedMaxResults, monitor);A snapshot is referred to as a baseline set. It's better to have the snapshot id but if it requires user input then this is fine. You'll have to show the user the search results if there are more than one snapshot with the same name owned by the same stream.
Kaushambi Singh
commented Apr 11 '13, 3:39 p.m.
Thanks Tim. Probably in passing the project area worked. I used this and it worked:
Kaushambi Singh
commented Apr 12 '13, 8:17 a.m.
Thanks Tim, I could find the snapshot using the above snippet.
Hi Tim,
It looks fine to me other than you should create all the add component operations in the loop then make one call to apply the component operations outside of the loop. How did you verify that the stream doesn't have the components? Did you check the IUpdateReport?
showing 5 of 7
show 2 more comments
|
Ralph Schoon (63.5k●3●36●46)
| answered Apr 11 '13, 3:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please have a look at https://jazz.net/forum/questions/34819/create-a-stream-from-the-snap-shot-of-another-stream it might provide the answer.
Comments
Kaushambi Singh
commented Apr 11 '13, 8:56 a.m.
Thanks Ralph. I did have a look at this question. It talks about fetching baselines from the given snapshot and replace operation for each baseline but then it doesn't talk about how are we creating stream after that.
That is exactly what you need to do to create a stream from a snapshot.
Kaushambi Singh
commented Apr 11 '13, 3:43 p.m.
ok, coming on this part, what exactly should be the syntax when we are saying this:
Also, I donot understand why we are doing create and replace operation for baselines. Why is it required ? Are we doing this to get the latest baseline from the components. Can this part be skipped if we are sure of the baselines ? please reply.
The snapshot in that snippet is of type IBaselineSet. It is not defined as a String.
Kaushambi Singh
commented Apr 12 '13, 3:22 a.m.
Thanks Tim, for your reply. All I need is an example format of this line:
Look at the snippet I posted as a comment for my answer to get your snapshot.
showing 5 of 6
show 1 more comments
|
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.