java解析rtc_RTC Java API 学习笔记

article/2025/10/7 4:18:23

1 使用RTC Java API进行登录:

Login的步骤分为以下:

1 初始化启动RTC的平台TeamPlatform:TeamPlatform.startup();

2 获取RTC repository的连接

ITeamRepository teamRepository =

TeamPlatform.getTeamRepositoryService().getTeamRepository(repositoryURI);

其中repositoryURI为你需要连接的jazz server 的URI

3 注册用户:

teamRepository.registerLoginHandler(new LoginHandler(userId, password));

4 登陆:

IProgressMonitor monitor = new NullProgressMonitor();

teamRepository.login(monitor);

范例代码:

private static ITeamRepository login(String repositoryURI, String userId,String password) throws TeamRepositoryException{

ITeamRepository repository= TeamPlatform

.getTeamRepositoryService().getTeamRepository(repositoryURI);

repository.registerLoginHandler(new LoginHandler(userId, password));

repository.login(null);

return repository;

}

0818b9ca8b590ca3270a3433284dd417.png

2 利用API进行查询:

1 获取查询客户端,审计客户端以及过程服务和进程监控;

IQueryClient queryClient= (IQueryClient) repository.getClientLibrary(IQueryClient.class);

IProcessClientService processClient =

(IProcessClientService) repository.getClientLibrary(IProcessClientService.class);

IAuditableClient auditableClient =

(IAuditableClient) repository.getClientLibrary(IAuditableClient.class);

2获取Project Area的引用

URI uri = URI.create(project_name.replace(" ", "%20"));

IProjectArea projectArea = (IProjectArea)processClient.findProcessArea(uri,null,null);

System.out.println(projectArea.getName());

其中project_name是你要查询的project area所对应的name

3 得到Project Area的查询属性对象

IQueryableAttributeFactory factory = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE);

IQueryableAttribute projectAreaAttribute =

factory.findAttribute(projectArea, IWorkItem.PROJECT_AREA_PROPERTY,

auditableClient, monitor);

4 构建查询表达式:AttributeOperation可以有多种操作符

AttributeExpression projectAreaExpression =

new AttributeExpression(projectAreaAttribute, AttributeOperation.EQUALS, projectArea);

如果有多个查询条件,可以使用Term来进行构建。

如Term term = new Term(Operator.AND);

term.add(projectAreaExpression1);

if (team_area != ""){

term.add(projectAreaExpression2);

}

term.add(projectAreaExpression3);

if (tag_term_and != null){

term.add(tag_term_and);

}

if (iteration_term_or !=null){

term.add(iteration_term_or);

}

5 获取查询结果:

IQueryResult> result =

queryClient.getResolvedExpressionResults(projectArea, term,IWorkItem.FULL_PROFILE);

6 遍历查询对象:

if (result !=null){

result.setLimit(num);

IAttribute type_attr= client.findAttribute(projectArea, IWorkItem.TYPE_PROPERTY,null);

IAttribute id_attr= client.findAttribute(projectArea, IWorkItem.ID_PROPERTY,null);

IAttribute summary_attr= client.findAttribute(projectArea, IWorkItem.SUMMARY_PROPERTY,null);

IAttribute owner_attr= client.findAttribute(projectArea, IWorkItem.OWNER_PROPERTY,null);

IAttribute priority_attr= client.findAttribute(projectArea, IWorkItem.PRIORITY_PROPERTY,null);

IAttribute severity_attr= client.findAttribute(projectArea, IWorkItem.SEVERITY_PROPERTY,null);

IAttribute creation_date_attr= client.findAttribute(projectArea, IWorkItem.CREATION_DATE_PROPERTY,null);

IAttribute modified_attr= client.findAttribute(projectArea, IWorkItem.MODIFIED_PROPERTY,null);

IAttribute tag_attr= client.findAttribute(projectArea, IWorkItem.TAGS_PROPERTY,null);

IAttribute resolution_date_attr= client.findAttribute(projectArea, IWorkItem.RESOLUTION_DATE_PROPERTY,null);

while (result.hasNext(null)) {

IResolvedResult resolved = result.next(null);

IWorkItem iwi = (IWorkItem) repository.itemManager().fetchCompleteItem(resolved.getItem(), IItemManager.DEFAULT, null);

String id = resolved.getItem().getValue(id_attr).toString();

String summary = resolved.getItem().getValue(summary_attr).toString();

......

....

}

0818b9ca8b590ca3270a3433284dd417.png

3 获取development line 和iteration:

In the server side, once we have an item handle com.ibm.team.repository.service.IRepositoryItemService.fetchItem(IItemHandle, String[]) can be used to fetch the item. It would look like

IIteration iteration = getService(IRepositoryItemService.class).fetchItem(iterationHandle, IRepositoryItemService.COMPLETE)

To have access to the getService() method the server side advisor should extend com.ibm.team.repository.service.AbstractService.java. The steps are detailed in https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide#Adding_New_Operation_Advisors.

In the client side advisor, code to fetch an item using its handle would look like

IProcessArea processArea = operation.getProcessArea(); //operation is the AdvisableOperation instance passed to the client side advisor

ITeamRepository repository = (ITeamRepository) processArea.getOrigin();

IItemManager itemManager = repository.itemManager();

IIteration iteration = (IIteration) itemManager.fetchCompleteItem(iterationHandle, IItemManager.DEFAULT, monitor);

有的时候一个project的development line分为好几个iteration,因此在查询的时候如果指定了plan for 为某个具体的iteration的handle,需要找到对应的iteration然后再构造查询表达式。

IDevelopmentLine line = null;                            if (developmentHandles != null) {                 List developmentLines = repository.itemManager().fetchCompleteItems(Arrays.asList(developmentHandles), IItemManager.DEFAULT, null);                                    for (Iterator e = developmentLines.iterator(); e.hasNext();) {                     line = (IDevelopmentLine) e.next();                     System.out.println("++++++"+line.getName()+"++++++");                     IIterationHandle[] iterationHandles = line.getIterations();                     if (iterationHandles !=null){                         List iterationlines = repository.itemManager().fetchCompleteItems(Arrays.asList(iterationHandles), IItemManager.DEFAULT, null);                         IIteration iteration = null;                         for (Iterator e1 = iterationlines.iterator(); e1.hasNext();) {                             iteration = (IIteration) e1.next();                             String interation_name = iteration.getName();                             System.out.println("===="+interation_name+"====");


http://chatgpt.dhexx.cn/article/rnWt76C8.shtml

相关文章

JS控制元素的显示和隐藏

开发工具与关键技术: DW、前端 作者:梁锦豪 撰写时间:2019/1/16当我们想要通过事件来控制元素时,我们可以用JavaScript来实现 下面是通过鼠标移入,移出事件来控制元素的显示与隐藏的例子: 首先,…

如何通过JS判断一个元素是否显示、隐藏

如何通过JS判断一个元素是否显示、隐藏 文章目录 如何通过JS判断一个元素是否显示、隐藏通过display是否等于none来判断通过jquery的:hidden/:visible 伪类来判断说明 通过display是否等于none来判断 通过判断当前元素的display的值来判断当前元素是否是可见状态。只能用displa…

js显示隐藏

其实这边我是新学的一点知识虽然不多但是新手还是比较容易上手的 <div id"panel"><button class"head">什么是jQuery?</button><div class"content">jQuery是继Prototype之后又一个优秀的JavaScript库&#xff0c;它是…

CSS隐藏元素的方法

隐藏元素之后&#xff0c;它在页面的行为如何&#xff1f; HTML文件如下 很简单&#xff0c;就一个div <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta http-equiv"X-UA-Compatible" content&…

javascript隐藏和显示元素

使页面元素隐藏和显示可以有两种方式&#xff1a; 方式一&#xff1a;设置元素style属性中的display var t document.getElementById(test);//选取id为test的元素 t.style.display none; // 隐藏选择的元素 t.style.display block; // 以块级样式显示方式二&#xff1a;设…

JavaScript控制元素(标签)的显示与隐藏

使用JavaScript有多种方式来隐藏元素&#xff1a; 方式一、使用HTML 的hidden 属性&#xff0c;隐藏后不占用原来的位置 hidden 属性是一个 Boolean 类型的值&#xff0c;如果想要隐藏元素&#xff0c;就将值设置为 true&#xff0c;否则就将值设置为false 【HTML hidden 属性…

faceswap-GAN

一&#xff0c;https://github.com/shaoanlu/faceswap-GAN 二&#xff0c;GAN网络架构 auto encoder网络结构 辨别网络结构 三&#xff0c;训练与推断 1.训练阶段&#xff0c;从人的图片上获取人脸并对齐作业&#xff0c;为了提升模型能力&#xff0c;并对人脸进行warp操作&a…

faceswap尝试

主要参考&#xff1a;https://github.com/deepfakes/faceswap 安装cuda9.0cudnn7.3.1python各种库 训练样本用的川普和凯奇。 显卡&#xff1a;1050ti 主要显卡太low了&#xff0c;慢的无语。。。。。

使用faceswap进行视频换脸操作

一、下载源码安装环境 开源csdn代码下载地址 https://codechina.csdn.net/mirrors/deepfakes/faceswap Github下载地址 https://github.com/deepfakes/faceswap 先下载源码&#xff0c;然后下载Anaconda3安装 官网&#xff0c;可以进一步了解faceswap https://forum.fac…

Deepfake-faceswap代码测试

FaceSwap Github官方文档 下面来记录一下我安装和运行faceswap的流程 首先需要downland源代码 Github配置相关的环境参考INSTALL.md 提取配置好tensorflow cuda 等等 比如最基本的就是Python3&#xff0c;并且这个可以调用Opencv(如果有错误&#xff0c;请参考另一篇记录) p…

Faceswap开发(一) GAN网络的基本了解

来自 Github上 作者 shaoanlu 链接&#xff1a; https://github.com/shaoanlu/faceswap-GAN 最近在研究Faceswap&#xff0c;随之就一定要了解GAN网络在工程中的使用原理&#xff0c;就算是Google上资料也并不多&#xff0c;检索到Github上优秀作者"shaoanlu"的工程…

faceswap 安装使用详情

最近对AI换脸比较感兴趣&#xff0c;就看了一下faceswap的使用。 1.下载代码&#xff1a; https://github.com/deepfakes/faceswap 2.安装python 3.xx版本&#xff0c;之前是2.x不能正常工作 3.运行setup.py wudi:faceswap xiepengchong$ python setup.pyWARNING Running …

Windows安装faceswap

一、安装python3.7版本的anaconda3 下载地址 &#xff1a; Anaconda3-2020.02-Windows-x86_64.exe 然后安装&#xff0c;一路下一步安装&#xff0c;下边两个勾选上 二、在.condarc文件中写入如下内容 &#xff0c;配置Anaconda的国内镜像地址 channels:- defaults show_cha…

3D FaceSwap换脸

3D FaceSwap 一、算法原理二、实验过程1.实验代码2.配置环境 一、算法原理 FaceSwap是基于图形学的换脸方法&#xff0c;首先获取人脸关键点&#xff0c;然后通过3D模型对人脸关键点位置进行渲染&#xff0c;不断缩小目标形状和关键点定位间的差异&#xff0c;最后将渲染模型的…

faceswap模型训练过程准备——提取人脸

我使用录屏工具获得视频&#xff0c;并命名为.mp4格式 提取帧 ffmpeg -i /Users/hehui/Documents/video.mp4 /Users/hehui/faceswap/src/cage/video-frame-%d.png 从照片中提取人脸&#xff1a; #-*-coding:utf8-*- import os import cv2 import time import shutildef getAl…

faceswap的正确安装步骤

第一步下载项目 faceswap项目地址&#xff1a;https://github.com/deepfakes/faceswap&#xff0c;下载后解压 第二步&#xff0c;环境配置 安装anaconda并换上清华源或阿里源&#xff1b;安装CUDA&#xff0c;可以不装cuDNN conda create -n faceswap python3.8 创建一个名…

AI换脸项目faceswap研究报告

缘起 deepfakes是利用AI技术换脸的开源项目&#xff0c;目前基于deepfakes的开源项目很多&#xff0c;而faceswap认可度很高&#xff0c;到目前为止有28.5千Star&#xff0c;可以说是换脸这类项目最火的了。小弟在当下有换脸需求&#xff0c;选取了这个项目进行研究尝试&#…

faceswap安装教程图文详解

Faceswap是一种人脸识别技术&#xff0c;可以将一个人的面部特征与另一个人的面部特征进行交换&#xff0c;从而创建出一个看起来像是两个人融合在一起的图像或视频。这项技术可以用于各种目的&#xff0c;包括艺术创作、电影制作、虚拟现实、安全监控等领域。Faceswap的实现方…

faceswap使用记录

1、没有显示.fs_cache文件夹 当时我是使用云gpu来运行文件代码的&#xff0c;里面提示我安装两个配置文件放置到.fs_cache文件夹&#xff0c;但是当前文件夹里面并没有显示.fa_cache文件夹 虽然不知道是什么原因&#xff0c;但这个文件夹其实是存在的&#xff0c;你下载好两个…