How do I lock a stream through the Java API ?
Hi everyone,
this is my first experience extending RTC. I have to code some basic operations in java. For some reason I have to lock a stream, so that I can be sure nobody would change it until my work Item change state and deliver the the contents to another stream. I'm trying to figure out how to use these classes I can't find examples for: IWorkspaceManager wm = (IWorkspaceManager)teamRepository.getClientLibrary(IWorkspaceManager.class); wm.applyLockOperations(lockOperations, monitor) lockOperations must be a list of non-null IVersionableLockOperation elements; duplicates/equivalent elements tolerated. How do I create such a list? Is this the right way to lock a stream? Thanks in advance. |
Accepted answer
David Lafreniere (4.8k●7)
| answered Oct 05 '17, 6:15 p.m.
FORUM MODERATOR / JAZZ DEVELOPER edited Oct 06 '17, 9:20 a.m. In RTC 6.0.2 we added a feature that lets you lock streams and components to prevent deliveries to the files in those streams or components. Stream and component locks work in a similar manner to file locks but apply to the entire stream or the entire component in a stream. When a stream or component is locked, any attempted deliveries by users who do not own the lock will fail with an appropriate error message. The user that holds the lock can still perform deliveries to the stream. A lock does not only prevent deliveries, it also prevents any operation that affects the files in the locked component or stream. For example, a component replace is also prevented.
ITeamRepository repo = .... Michael Valenta selected this answer as the correct answer
|
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.
Comments
Actually the javadoc for these classes doesn't work very well. It only tells the input parameters, but not their meanings.
Those locks are for locking individual files, not for locking the whole
stream. Could you expand a bit more on your use case? In general in
RTC, you shouldn't have to place temporary locks on streams.
Cheers,
Geoff