It's all about the answers!

Ask a question

Getting sync streams with the Java API


Dan Vegeto (111) | asked Jun 28 '10, 5:14 p.m.
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.

One answer



permanent link
Geoffrey Clemm (30.1k33035) | answered Jun 29 '10, 11:56 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

Your answer


Register or 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.