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

How to retrieve all the Changesets from a stream using plain java API

 Hi,

I am a newbee to the RTC Java Api . I am trying to get all the delivered changesets against a project in RTC.

I was able to retrieve the streams created under the project using the below code .  Please help on how we can retrieve the changesets from the component lists. 

Also if some one can point to examples in RTC Jazz API it will be much helpful

final IWorkspaceManager mgr = SCMPlatform
.getWorkspaceManager(m_TeamRepo);

IWorkspaceSearchCriteria workspaceCriteria = WorkspaceSearchCriteria.FACTORY
.newInstance();
workspaceCriteria.setPartialOwnerName(projectName);
workspaceCriteria.setKind(IWorkspaceSearchCriteria.STREAMS);

List<IWorkspaceHandle> streamList;
try {
streamList = mgr.findWorkspaces(workspaceCriteria,
Integer.MAX_VALUE, new NullProgressMonitor());

for (IWorkspaceHandle iWorkspaceHandle : streamList) {
IWorkspace stream = (IWorkspace) iWorkspaceHandle
.getFullState();

IWorkspaceConnection workspaceConnection = mgr
.getWorkspaceConnection(iWorkspaceHandle, null);
List componentList = workspaceConnection.getComponents();

for (Object compHandle : componentList) {
// need help . 
}
}

Thanks

0 votes



One answer

Permanent link
from the javadoc (make sure u get it)

IWorkspaceManager

findChangeSets

java.util.List findChangeSets(IChangeSetSearchCriteria criteria,
                              int maxResults,
                              org.eclipse.core.runtime.IProgressMonitor monitor)
                              throws TeamRepositoryException
Search the repository for changesets matching the specified criteria and return the matched changesets.

Parameters:
criteria - The criteria to look for, must not be null.
maxResults - The maximum number of results to return, must be >0, if larger than IWorkspaceManager.MAX_QUERY_SIZE , only IWorkspaceManager.MAX_QUERY_SIZE results will be returned.
monitor - a progress monitor, or null if progress reporting is not desired
Returns:
The list of changeset handles maching the criteria, never null. Ordered by modified date, most recent first.
Throws:
NotLoggedInException - if the operation fails because the client was not logged in to the repository
org.eclipse.core.runtime.OperationCanceledException - if the operation is canceled. Cancellation can occur even if no progress monitor is provided.
TeamRepositoryException - if the operation fails for any other reason



1 vote

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
× 12,014
× 1,699

Question asked: Jan 23 '14, 12:52 a.m.

Question was seen: 7,923 times

Last updated: Jan 23 '14, 5:54 a.m.

Confirmation Cancel Confirm