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

Searching for locked files by a contributor using RTC API

 Hi guys

I'm having performance issues while looking for attributes of files using the code below. It takes me approx 70 sec to retrieve information from 2000 files. Is there any other way offered by RTC api to look up for this type of information?? 
Thanks Patria

 ILockSearchResult locks = workspaceManager.findLocks(criteria, IWorkspaceManager.MAX_QUERY_SIZE, null);
        Collection<IStreamLockReport> reports = locks.getReports();
        IProgressMonitor monitor = new LoggerProgressMonitor();
        LockAttribute lockAttribute = new LockAttribute(false,"");
        for (IStreamLockReport report : reports) {
            Collection<IComponentLockReport> componentLocks = report.getComponentLocks();
            for (IComponentLockReport componentLock : componentLocks) {
                Collection<IVersionableLock> locks1 = componentLock.getLocks();

                if (!locks1.isEmpty()) {
                    for (IVersionableLock iVersionableLock : locks1) {
                        IContributor contributor = (IContributor) repo.itemManager().fetchCompleteItem(iVersionableLock.getContributor(), ItemManager.DEFAULT, monitor);
                        lockAttribute = new LockAttribute(true, contributor.getName());

                    }

                } else {

                    IComponent component = (IComponent) repo.itemManager().fetchCompleteItem(componentLock.getComponent(), ItemManager.DEFAULT, monitor);
                   if (logger.isDebugEnabled()) logger.debug("no lock for component " + component.getName());
                }

            }

        }
        return lockAttribute;
        

0 votes


Be the first one to answer this question!

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
× 457
× 235
× 89
× 12
× 9
× 1

Question asked: Sep 19 '14, 3:50 p.m.

Question was seen: 6,384 times

Last updated: Sep 19 '14, 3:50 p.m.

Confirmation Cancel Confirm