It's all about the answers!

Ask a question

snapshot loading via API


Boopathy Nagaraj (1516) | asked Jul 02 '19, 5:00 a.m.
edited Jul 02 '19, 5:34 a.m.
Hello,
I could able to get the list of snapshot for the stream,.But i dont know how to load snapshot using snapshot name or UUID.
private static List<IBaselineSetHandle> getSnapShotsOfAboveStream(final IWorkspaceHandle workspaceHandle,
      final ITeamRepository repository)
      throws TeamRepositoryException {

    IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(repository);
    IBaselineSetSearchCriteria searchCriteria = IBaselineSetSearchCriteria.FACTORY.newInstance();
    searchCriteria.setOwnerWorkspaceOptional(workspaceHandle);

    List findBaselineSets = workspaceManager.findBaselineSets(searchCriteria, Integer.MAX_VALUE, monitor);
    for (Object object : findBaselineSets) {
      IBaselineSetHandle baselineSet = (IBaselineSetHandle) object;
      UUID itemId = baselineSet.getItemId();
     
      SnapshotMetadata instance2 = SnapshotMetadataFactory.getInstance(itemId.getUuidValue(), repository, monitor);
}


Based on snapshot info how i do loading into my local path

Accepted answer


permanent link
Ralph Schoon (62.7k33643) | answered Jul 02 '19, 5:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 How do you do that using the client?


  1. You create a repository workspace from the snapshot 
  2. Then you load the repository workspace.

Boopathy Nagaraj selected this answer as the correct answer

Comments
Boopathy Nagaraj commented Jul 02 '19, 5:39 a.m.

Thanks. For creating repository from the snapshot, do we have API?


1
David Lafreniere commented Jul 02 '19, 1:17 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Yes there is API.
See IWorkspaceManager.createWorkspace(...)

Your answer


Register or to post your answer.