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

Getting sync streams with the Java API

We are trying to automate the synchronization of files between ClearCase and RTC using the Java API. We need the ability to either add new roots to an existing SynchronizedStream or construct a new SynchronizedStream with custom roots. So far, we have not been able to access existing instances of SynchronizedStream, nor have we been able to successfully construct one from scratch.

We expected the following code to print a list of four known streams:


Repository repo = new Repository("<URL>", "<userID>", "<password>");
Team team = repo.getTeamByName("<teamName>");
JazzInfo jazzInfo = new JazzInfo(repo.getITeamRepository(), team.getITeamArea());
JazzProvider jazzProvider = new JazzProvider(jazzInfo);
IProgressMonitor monitor = repo.getMonitor();

for(StreamWrapper str : jazzProvider.getAllStreams(monitor))
System.out.println(str);


The output was "Fetching all Jazz streams..." and that's it.

We thought we had the answer when we saw a method called lookupStreamFromName in JazzProvider... until we looked at the method body:


public Stream lookupStreamFromName(String streamName, IProgressMonitor monitor)
{
// Not yet implemented for this provider.
return null;
}


Does anyone know if there is a good way of retrieving existing instances of SynchronizedStream or constructing new ones? Any help would be appreciated.

0 votes



One answer

Permanent link
The simplest thing for you to do would be to wait for 3.0, because work
item 118475 will let you add new roots via the command line.

If you need something before then, you could look at the command line
source code in the com.ibm.team.connector.scm.cli package to get started.

Cheers,
Geoff

On 6/28/2010 5:22 PM, dbvegeto wrote:
We are trying to automate the synchronization of files between
ClearCase and RTC using the Java API. We need the ability to either
add new roots to an existing SynchronizedStream or construct a new
SynchronizedStream with custom roots. So far, we have not been able
to access existing instances of SynchronizedStream, nor have we been
able to successfully construct one from scratch.

We expected the following code to print a list of four known streams:


Repository repo = new Repository("<URL>",
"<userID>","<password>");
Team team = repo.getTeamByName("<teamName>");
JazzInfo jazzInfo = new
JazzInfo(repo.getITeamRepository(),
team.getITeamArea());
JazzProvider jazzProvider = new JazzProvider(jazzInfo);
IProgressMonitor monitor = repo.getMonitor();

for(StreamWrapper str :
jazzProvider.getAllStreams(monitor))
System.out.println(str);


The output was "Fetching all Jazz streams..." and that's
it.

We thought we had the answer when we saw a method called
lookupStreamFromName in JazzProvider... until we looked at the method
body:


public Stream lookupStreamFromName(String streamName,
IProgressMonitor monitor)
{
// Not yet implemented for this provider.
return null;
}


Does anyone know if there is a good way of retrieving existing
instances of SynchronizedStream or constructing new ones? Any help
would be appreciated.

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
× 10,938

Question asked: Jun 28 '10, 5:14 p.m.

Question was seen: 5,749 times

Last updated: Jun 28 '10, 5:14 p.m.

Confirmation Cancel Confirm