It's all about the answers!

Ask a question

Searching for locked files by a contributor using RTC API


Patria Lukman (2133) | asked Sep 19 '14, 3:50 p.m.
 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;
        

Be the first one to answer this question!


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.