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
One answer
from the javadoc (make sure u get it)
IWorkspaceManager
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 thanIWorkspaceManager.MAX_QUERY_SIZE
, onlyIWorkspaceManager.MAX_QUERY_SIZE
results will be returned. -
monitor
- a progress monitor, ornull
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