-->

How to change RTC stream and component ownership u

2019-05-18 22:31发布

问题:

I need to change the ownership of components and stream. I am trying to find out any API for this. Please help. Here I have one code snippet with me but I don't know how it will work.

IScmService scmService = null; 
        IRepositoryItemService itemService;
        IComponentHandle componentH;
        ComponentOwnerHandle componentOwnerH = scmService.getComponentOwnerRecord((ComponentHandle) componentH);
        ComponentOwner componentOwner = (ComponentOwner) itemService.fetchItem(componentOwnerH, IRepositoryRemoteService.COMPLETE);
        IAuditableHandle ownerH = componentOwner.getOwner();
        if (componentHandle == null) {
            // Rename component
            componentHandle = wm.createComponent(componentName,
                    teamRepository.loggedInContributor(), monitor);
            wm.setComponentOwner(componentHandle, ownerH, monitor);
        } else {
            // Rename component
            wm.renameComponent(componentHandle, componentName, monitor);
            wm.setComponentOwner(componentHandle, ownerH, monitor);
        }
        return componentHandle;