Compare commits
27 Commits
Author | SHA1 | Date |
---|---|---|
|
f9eb0bdea3 | |
|
460722dde6 | |
|
fa9def8ded | |
|
56841ca743 | |
|
b9bca5795d | |
|
d504b44601 | |
|
346dcdf75d | |
|
a5ee210a22 | |
|
095e58d812 | |
|
83f99be452 | |
|
58ff225c47 | |
|
675b4a7925 | |
|
a0900b1cee | |
|
d7413fb99f | |
|
7d60bdeef4 | |
|
c0ef153a17 | |
|
7abd8bbed9 | |
|
b228ab67a5 | |
|
7a5e8bf6f2 | |
|
6afd2264e3 | |
|
a37f6ab340 | |
|
72710dc255 | |
|
9acde1cb1e | |
|
e535d45df3 | |
|
5d9fb90fb1 | |
|
10aeddff70 | |
|
7262d4f9a3 |
|
@ -18,6 +18,12 @@
|
|||
<artifactId>base-webapp</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<artifactId>fw-nifi</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
|
@ -32,6 +38,12 @@
|
|||
</profile>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>liuy</id> <!--刘洋-->
|
||||
<properties>
|
||||
<profile.active>liuy</profile.active>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>llg</id> <!--吕磊钢-->
|
||||
<properties>
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
#######################dev环境#######################
|
||||
logging:
|
||||
#日志级别 指定目录级别
|
||||
level:
|
||||
root: warn
|
||||
encodings: UTF-8
|
||||
file:
|
||||
# 日志保存路径
|
||||
path: /Users/liuyang/workspaces/hzya/fw-nifi/zt-log
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
savefile:
|
||||
# 文件保存路径
|
||||
path: /Users/liuyang/workspaces/hzya/fw-nifi/zt-file
|
||||
# path: D:\webservice\file
|
||||
# pluginpath: D:\webservice\plugin
|
||||
pluginpath: /home/webservice/zt/plugin
|
||||
# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\
|
||||
tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/
|
||||
cbs8:
|
||||
appId: 1P4AGrpz
|
||||
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
|
||||
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
|
||||
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
|
||||
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
|
||||
# 这个私钥到时候上传到cbs,和下面到是同一对
|
||||
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
|
||||
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
|
||||
cbs_public_key: 0469146F06BF3B01236E84632441E826
|
||||
#电子回单下载临时存放位置
|
||||
elec_path: /Users/xiangerlin/Downloads/
|
||||
OA:
|
||||
data_source_code: yc_oa
|
||||
zt:
|
||||
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
|
||||
nifi:
|
||||
api:
|
||||
url: https://192.168.2.233:8443/nifi-api
|
||||
username: hzya
|
||||
password: hzya1314*nifi
|
|
@ -0,0 +1,136 @@
|
|||
package com.hzya.frame;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam.CreateProcessorAndUpdateParamJoin;
|
||||
import com.hzya.frame.nifiapi.model.joingetallcontrollerservice.Component19;
|
||||
import com.hzya.frame.nifiapi.model.joingetallcontrollerservice.ControllerServices19;
|
||||
import com.hzya.frame.nifiapi.model.resultNeedModifyController.PortFilterResult;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Component16;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Config16;
|
||||
import com.hzya.frame.nifiapi.operation.INifiAppOperation;
|
||||
import com.hzya.frame.nifiapi.operation.INifiBaseOperation;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestINifiBaseOperation
|
||||
* @Date:2025/5/22 17:02
|
||||
* @Filename:TestINifiBaseOperation
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {WebappApplication.class})
|
||||
public class TestINifiBaseOperation {
|
||||
|
||||
@Autowired
|
||||
private INifiBaseOperation iNifiBaseOperation;
|
||||
|
||||
@Autowired
|
||||
private INifiAppOperation iNifiAppOperation;
|
||||
|
||||
@Test
|
||||
public void testGetNeedModifyControllerServicesByProcessGroup() throws Exception {
|
||||
try {
|
||||
List<ControllerServices19> needModifyControllerServicesByProcessGroup = iNifiBaseOperation.getNeedModifyControllerServicesByProcessGroup("4143d803-0196-1000-968f-b06f55b43a3f");
|
||||
System.out.println(needModifyControllerServicesByProcessGroup.size());
|
||||
ControllerServices19 controllerServices19 = needModifyControllerServicesByProcessGroup.get(0);
|
||||
Component19 component = controllerServices19.getComponent();
|
||||
System.out.println(component.getName());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNeedModifyControllerServicesByProcessGroup2() throws Exception {
|
||||
try {
|
||||
ControllerServices19 czfJwnb9sb = iNifiBaseOperation.getNeedModifyControllerServicesByProcessGroup("4143d803-0196-1000-968f-b06f55b43a3f", "CZFJwnb9sb");
|
||||
if (czfJwnb9sb != null && czfJwnb9sb.getComponent() != null) {
|
||||
Component19 component = czfJwnb9sb.getComponent();
|
||||
String name = component.getName();
|
||||
System.out.println(name);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNeedModifyControllerRelationshipByProcessGroup() throws Exception {
|
||||
try {
|
||||
PortFilterResult needModifyControllerRelationshipByProcessGroup = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup("41437b87-0196-1000-6951-50e41e75c0da", "f5228bc8-0360-41eb-a640-9f4df953937c");
|
||||
System.out.println(needModifyControllerRelationshipByProcessGroup);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCopyProcessor() throws Exception {
|
||||
try {
|
||||
String targetProcessorId = "7f70897a-0196-1000-241a-3a7cdf5bf521";
|
||||
String parentProcessGroupId = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||
String copyTargetProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
String s = iNifiBaseOperation.copyProcessor(targetProcessorId, parentProcessGroupId, copyTargetProcessGroupId);
|
||||
System.out.println("新处理器id:" + s);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateProcessorAndUpdateParam() {
|
||||
try {
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
properties.put("File Size", "1B");
|
||||
properties.put("Batch Size", "2");
|
||||
properties.put("Data Format", "Binary");
|
||||
properties.put("Unique FlowFiles", "true");
|
||||
properties.put("character-set", "GBK");
|
||||
|
||||
Config16 config16 = new Config16();
|
||||
config16.setProperties(properties);
|
||||
|
||||
Component16 component16 = new Component16();
|
||||
component16.setName("修改处理器名称2");
|
||||
component16.setConfig(config16);
|
||||
|
||||
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin = new CreateProcessorAndUpdateParamJoin();
|
||||
createProcessorAndUpdateParamJoin.setComponent(component16);
|
||||
createProcessorAndUpdateParamJoin.setTargetProcessorId("7f70897a-0196-1000-241a-3a7cdf5bf521");
|
||||
createProcessorAndUpdateParamJoin.setCopyTargetProcessGroupId("76e23115-ad84-1aab-7630-21c76aa3973d");
|
||||
createProcessorAndUpdateParamJoin.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
|
||||
String processorAndUpdateParam = iNifiAppOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin);
|
||||
System.out.println("新处理器id:" + processorAndUpdateParam);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testgGetFindStateClearMarkProcessor() throws Exception {
|
||||
try {
|
||||
iNifiBaseOperation.getFindStateClearMarkProcessor("41437b87-0196-1000-6951-50e41e75c0da", "接口状态清理标记");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBatchEnabledControllerServices() throws Exception {
|
||||
try {
|
||||
iNifiBaseOperation.batchEnabledControllerServices("4143d803-0196-1000-968f-b06f55b43a3f", "xxxx");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,761 @@
|
|||
package com.hzya.frame;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.Component18;
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.CreateConnections18;
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.Revision18;
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.SourceOrDestination18;
|
||||
import com.hzya.frame.nifiapi.model.joincreateoracleapp.CreateAppInstanceJoin;
|
||||
import com.hzya.frame.nifiapi.model.joincreateprocessconnection.CreateProcessorConnections;
|
||||
import com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam.CreateProcessorAndUpdateParamJoin;
|
||||
import com.hzya.frame.nifiapi.model.joincreparamcontext.CreateParamContextJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller.FindNeedModifyController;
|
||||
import com.hzya.frame.nifiapi.model.joingetcontroller.Component12;
|
||||
import com.hzya.frame.nifiapi.model.joingetcontroller.ControllerService12;
|
||||
import com.hzya.frame.nifiapi.model.joinparametercontexts.*;
|
||||
import com.hzya.frame.nifiapi.model.joinprocessgroups.Component7;
|
||||
import com.hzya.frame.nifiapi.model.joinprocessgroups.ProcessGroupsJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinprocessgroups.Revision5;
|
||||
import com.hzya.frame.nifiapi.model.joinsnippetinstance.SnippetInstanceJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinsnippets.Snippet;
|
||||
import com.hzya.frame.nifiapi.model.joinsnippets.SnippetsJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup.Revision10;
|
||||
import com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup.StartOrStopProcessGroupsInfoJoin10;
|
||||
import com.hzya.frame.nifiapi.model.resultNeedModifyController.PortFilterResult;
|
||||
import com.hzya.frame.nifiapi.model.resultcreateoracleapp.CreateAppInstanceResult;
|
||||
import com.hzya.frame.nifiapi.model.resultcreateprocessor.*;
|
||||
import com.hzya.frame.nifiapi.model.resultcreateprocessors.CreateProcess16;
|
||||
import com.hzya.frame.nifiapi.model.resultcreatesnippet.Flow15;
|
||||
import com.hzya.frame.nifiapi.model.resultcreatesnippet.ProcessGroups15;
|
||||
import com.hzya.frame.nifiapi.model.resultcreatesnippet.SnippetInstance15;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessgroups.ProcessgroupsResult;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessgroupsinfo.ProcessGroupsInfoResult9;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessgroupsinfo.Revision9;
|
||||
import com.hzya.frame.nifiapi.model.resultsnippets.Snippet13;
|
||||
import com.hzya.frame.nifiapi.model.resultsnippets.SnippetResult13;
|
||||
import com.hzya.frame.nifiapi.operation.INifiAppOperation;
|
||||
import com.hzya.frame.nifiapi.operation.INifiBaseOperation;
|
||||
import com.hzya.frame.nifiapi.service.NifiApiService;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestNifiDbSync
|
||||
* @Date:2025/5/20 17:49
|
||||
* @Filename:TestNifiDbSync
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {WebappApplication.class})
|
||||
public class TestNifiDbSync {
|
||||
|
||||
@Autowired
|
||||
private NifiApiService nifiApiService;
|
||||
|
||||
@Autowired
|
||||
private INifiAppOperation nifiOperation;
|
||||
|
||||
@Autowired
|
||||
private INifiBaseOperation iNifiBaseOperation;
|
||||
|
||||
/**
|
||||
* 测试nifi数据同步场景调用
|
||||
*/
|
||||
@Test
|
||||
public void testDbSync2() throws Exception {
|
||||
//创建业务数据流对应的流程组
|
||||
String parentProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
String processGroupsName = "Oracle19c->Mysql跨数据源同步";
|
||||
String newProcessGroupsId = testCreateProcessGroups(parentProcessGroupId, processGroupsName);
|
||||
|
||||
//新建GenerateFlowFile处理器(开始的处理器)
|
||||
// String generateFlowFileId = testCreateProcessor(newProcessGroupsId);
|
||||
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin = new CreateProcessorAndUpdateParamJoin();
|
||||
createProcessorAndUpdateParamJoin.setTargetProcessorId("02d23f3c-7003-1a1b-1cdc-e9f37874bd78");
|
||||
createProcessorAndUpdateParamJoin.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
createProcessorAndUpdateParamJoin.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||
String generateFlowFileId = nifiOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin);
|
||||
|
||||
//创建Oracle应用
|
||||
//初始化实例
|
||||
CreateAppInstanceJoin createOracleApp = new CreateAppInstanceJoin();
|
||||
createOracleApp.setAppProcessGroupId("41437b87-0196-1000-6951-50e41e75c0da");
|
||||
createOracleApp.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
createOracleApp.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||
//上下文
|
||||
CreateParamContextJoin createParamContextJoin = setOracleParamContextJoin();
|
||||
createOracleApp.setCreateParamContextJoin(createParamContextJoin);
|
||||
//控制器
|
||||
// FindNeedModifyController findNeedModifyController = setOracleFindNeedModifyController(newProcessGroupsId);
|
||||
// createOracleApp.setFindNeedModifyController(findNeedModifyController);
|
||||
CreateAppInstanceResult oracleAppContext = nifiOperation.createAppContext(createOracleApp);
|
||||
|
||||
//创建Mysql应用
|
||||
//初始化实例
|
||||
CreateAppInstanceJoin createOracleApp2 = new CreateAppInstanceJoin();
|
||||
createOracleApp2.setAppProcessGroupId("4143d803-0196-1000-968f-b06f55b43a3f");
|
||||
createOracleApp2.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
createOracleApp2.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||
//上下文
|
||||
CreateParamContextJoin createParamContextJoin2 = setMysqlParamContextJoin(newProcessGroupsId);
|
||||
createOracleApp2.setCreateParamContextJoin(createParamContextJoin2);
|
||||
//控制器
|
||||
// FindNeedModifyController findNeedModifyController2 = setMysqlFindNeedModifyController(newProcessGroupsId);
|
||||
// createOracleApp2.setFindNeedModifyController(findNeedModifyController2);
|
||||
CreateAppInstanceResult mysqlAppContext = nifiOperation.createAppContext(createOracleApp2);
|
||||
|
||||
//新建LogAttribute处理器(结束处理器)
|
||||
// String logAttributeId = testCreateProcessor2();
|
||||
// String logAttributeId = null;
|
||||
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin2 = new CreateProcessorAndUpdateParamJoin();
|
||||
createProcessorAndUpdateParamJoin2.setTargetProcessorId("7f70897a-0196-1000-241a-3a7cdf5bf521");
|
||||
createProcessorAndUpdateParamJoin2.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
createProcessorAndUpdateParamJoin2.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||
String logAttributeId = nifiOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin2);
|
||||
|
||||
//查找对应应用的连接标记
|
||||
//TYPE=INPUT_PORT
|
||||
PortFilterResult oracleMarkInput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(oracleAppContext.getNewProcessGroupId(), "f5228bc8-0360-41eb-a640-9f4df953937c");
|
||||
PortFilterResult oracleMarkOutPut = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(oracleAppContext.getNewProcessGroupId(), "4929a9ac-291a-4ea2-a4b1-286ddf47164a");
|
||||
//TYPE=OUTPUT_PORT
|
||||
PortFilterResult mysqlMarkInput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "be05a6ad-a440-43ed-b4c0-d1edcf03334f");
|
||||
PortFilterResult mysqlMarkOutput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "7ac85368-f2c9-48df-ab5b-ea610449083d");
|
||||
//查找Mysql应用的输入端口
|
||||
PortFilterResult automaticTableCreation = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "9480f217-9d94-4dcd-ba80-f718cc6e59db");
|
||||
|
||||
//批量创建连接关系
|
||||
//连接关系一:开始处理器->Oracle应用
|
||||
SourceOrDestination18 source = new SourceOrDestination18();
|
||||
source.setId(generateFlowFileId);
|
||||
source.setGroupId(newProcessGroupsId);
|
||||
source.setType("PROCESSOR");
|
||||
|
||||
SourceOrDestination18 destination = new SourceOrDestination18();
|
||||
destination.setId(oracleMarkInput.getInputPorts().get(0).getId());
|
||||
destination.setGroupId(oracleAppContext.getNewProcessGroupId());
|
||||
destination.setType("INPUT_PORT");
|
||||
|
||||
List<String> selectedRelationships = new ArrayList<>();
|
||||
selectedRelationships.add("success");
|
||||
|
||||
Component18 component18 = new Component18();
|
||||
component18.setSource(source);
|
||||
component18.setDestination(destination);
|
||||
component18.setSelectedRelationships(selectedRelationships);
|
||||
|
||||
Revision18 revision18 = new Revision18();
|
||||
revision18.setVersion("0");//默认传递0
|
||||
|
||||
CreateConnections18 createConnections17 = new CreateConnections18();
|
||||
createConnections17.setComponent(component18);
|
||||
createConnections17.setRevision(revision18);
|
||||
|
||||
List<CreateConnections18> createConnections18List = new ArrayList<>();
|
||||
createConnections18List.add(createConnections17);
|
||||
|
||||
//连接关系二:Oracle应用->Mysql应用
|
||||
SourceOrDestination18 source2 = new SourceOrDestination18();
|
||||
source2.setId(oracleMarkOutPut.getOutputPorts().get(0).getId());
|
||||
source2.setGroupId(oracleAppContext.getNewProcessGroupId());
|
||||
source2.setType("OUTPUT_PORT");
|
||||
|
||||
SourceOrDestination18 destination2 = new SourceOrDestination18();
|
||||
destination2.setId(mysqlMarkInput.getInputPorts().get(0).getId());
|
||||
destination2.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||
destination2.setType("INPUT_PORT");
|
||||
|
||||
// List<String> selectedRelationships2 = new ArrayList<>();
|
||||
// selectedRelationships2.add("success");
|
||||
|
||||
Component18 component182 = new Component18();
|
||||
component182.setSource(source2);
|
||||
component182.setDestination(destination2);
|
||||
// component182.setSelectedRelationships(selectedRelationships2);
|
||||
|
||||
Revision18 revision182 = new Revision18();
|
||||
revision182.setVersion("0");//默认传递0
|
||||
|
||||
CreateConnections18 createConnections172 = new CreateConnections18();
|
||||
createConnections172.setComponent(component182);
|
||||
createConnections172.setRevision(revision182);
|
||||
createConnections18List.add(createConnections172);
|
||||
|
||||
//连接关系三:Mysql应用->结束处理器
|
||||
SourceOrDestination18 source3 = new SourceOrDestination18();
|
||||
source3.setId(mysqlMarkOutput.getOutputPorts().get(0).getId());
|
||||
source3.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||
source3.setType("OUTPUT_PORT");
|
||||
|
||||
SourceOrDestination18 destination3 = new SourceOrDestination18();
|
||||
destination3.setId(logAttributeId);
|
||||
destination3.setGroupId(newProcessGroupsId);
|
||||
destination3.setType("PROCESSOR");
|
||||
|
||||
// List<String> selectedRelationships3 = new ArrayList<>();
|
||||
// selectedRelationships3.add("success");
|
||||
|
||||
Component18 component183 = new Component18();
|
||||
component183.setSource(source3);
|
||||
component183.setDestination(destination3);
|
||||
// component183.setSelectedRelationships(selectedRelationships3);
|
||||
|
||||
Revision18 revision183 = new Revision18();
|
||||
revision183.setVersion("0");//默认传递0
|
||||
|
||||
CreateConnections18 createConnections173 = new CreateConnections18();
|
||||
createConnections173.setComponent(component183);
|
||||
createConnections173.setRevision(revision183);
|
||||
createConnections18List.add(createConnections173);
|
||||
|
||||
//连接关系四:如果存在自动建表,则需要从开始节点-连接到Mysql应用的"自动建表"的输入端口
|
||||
List<String> selectedRelationships2 = new ArrayList<>();
|
||||
selectedRelationships2.add("success");
|
||||
|
||||
SourceOrDestination18 source4 = new SourceOrDestination18();
|
||||
source4.setId(generateFlowFileId);
|
||||
source4.setGroupId(newProcessGroupsId);
|
||||
source4.setType("PROCESSOR");
|
||||
|
||||
SourceOrDestination18 destination4 = new SourceOrDestination18();
|
||||
destination4.setId(automaticTableCreation.getInputPorts().get(0).getId());
|
||||
destination4.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||
destination4.setType("INPUT_PORT");
|
||||
|
||||
Component18 component184 = new Component18();
|
||||
component184.setSource(source4);
|
||||
component184.setDestination(destination4);
|
||||
component184.setSelectedRelationships(selectedRelationships2);
|
||||
|
||||
Revision18 revision184 = new Revision18();
|
||||
revision184.setVersion("0");//默认传递0
|
||||
|
||||
CreateConnections18 createConnections174 = new CreateConnections18();
|
||||
createConnections174.setComponent(component184);
|
||||
createConnections174.setRevision(revision184);
|
||||
createConnections18List.add(createConnections174);
|
||||
|
||||
CreateProcessorConnections createProcessorConnections = new CreateProcessorConnections();
|
||||
createProcessorConnections.setProcessGroupsId(newProcessGroupsId);
|
||||
createProcessorConnections.setCreateConnections18(createConnections18List);
|
||||
iNifiBaseOperation.batchCreateProcessorConnections(createProcessorConnections);
|
||||
|
||||
//去掉流程组内对应的处理器旧状态
|
||||
// List<String> stringList = new ArrayList<>();
|
||||
// stringList.add(oracleAppContext.getNewProcessGroupId());
|
||||
// stringList.add(mysqlAppContext.getNewProcessGroupId());
|
||||
// iNifiBaseOperation.clearProcessGroupState(stringList);
|
||||
|
||||
//启动业务处理器
|
||||
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(newProcessGroupsId);
|
||||
Revision9 revision = processGroups.getRevision();
|
||||
|
||||
Revision10 revision10 = new Revision10();
|
||||
revision10.setVersion(revision.getVersion());
|
||||
|
||||
StartOrStopProcessGroupsInfoJoin10 startOrStopProcessGroupsInfoJoin10 = new StartOrStopProcessGroupsInfoJoin10();
|
||||
startOrStopProcessGroupsInfoJoin10.setId(processGroups.getId());
|
||||
startOrStopProcessGroupsInfoJoin10.setState("RUNNING");
|
||||
startOrStopProcessGroupsInfoJoin10.setRevision(revision10);
|
||||
ProcessGroupsInfoResult9 processGroupsInfoResult9 = nifiApiService.startOrStopProcessGroups(startOrStopProcessGroupsInfoJoin10);
|
||||
System.out.println("流程组id:" + processGroupsInfoResult9.getId());
|
||||
}
|
||||
|
||||
|
||||
public CreateParamContextJoin setOracleParamContextJoin() throws Exception {
|
||||
Revision revision = new Revision();
|
||||
revision.setVersion(0);
|
||||
|
||||
Parameter2 parameter = new Parameter2();
|
||||
parameter.setSensitive(false);
|
||||
parameter.setName("additionalWhereClause");
|
||||
parameter.setValue("1=1");
|
||||
parameter.setDescription("where条件");
|
||||
|
||||
Parameter2 parameter2 = new Parameter2();
|
||||
parameter2.setSensitive(false);
|
||||
parameter2.setName("columnsToReturn");
|
||||
parameter2.setValue("csaleid,vreceiptcode,ts");
|
||||
parameter2.setDescription("需要查询的表字段");
|
||||
|
||||
Parameter2 parameter3 = new Parameter2();
|
||||
parameter3.setSensitive(false);
|
||||
parameter3.setName("customOrderByColumn");
|
||||
parameter3.setValue("ts,csaleid asc");
|
||||
parameter3.setDescription("排序规则,如果有增量同步需求,一定要通过时间+主键");
|
||||
|
||||
Parameter2 parameter4 = new Parameter2();
|
||||
parameter4.setSensitive(false);
|
||||
parameter4.setName("maximumValueColumns");
|
||||
parameter4.setValue("ts");
|
||||
parameter4.setDescription("分片字段");
|
||||
|
||||
Parameter2 parameter5 = new Parameter2();
|
||||
parameter5.setSensitive(false);
|
||||
parameter5.setName("sourceTbName");
|
||||
parameter5.setValue("U8C241231.SO_SALE");
|
||||
parameter5.setDescription("查询表名称");
|
||||
|
||||
Parameters2 parameters = new Parameters2();
|
||||
parameters.setParameter(parameter);
|
||||
|
||||
Parameters2 parameters2 = new Parameters2();
|
||||
parameters2.setParameter(parameter2);
|
||||
|
||||
Parameters2 parameters3 = new Parameters2();
|
||||
parameters3.setParameter(parameter3);
|
||||
|
||||
Parameters2 parameters4 = new Parameters2();
|
||||
parameters4.setParameter(parameter4);
|
||||
|
||||
Parameters2 parameters5 = new Parameters2();
|
||||
parameters5.setParameter(parameter5);
|
||||
|
||||
List<Parameters2> parametersList = new ArrayList<>();
|
||||
parametersList.add(parameters);
|
||||
parametersList.add(parameters2);
|
||||
parametersList.add(parameters3);
|
||||
parametersList.add(parameters4);
|
||||
parametersList.add(parameters5);
|
||||
|
||||
Component3 component = new Component3();
|
||||
component.setName("oracle参数环境" + createParamTime());
|
||||
component.setParameters(parametersList);
|
||||
|
||||
ParameterContextsJoin parameterContextsJoin = new ParameterContextsJoin();
|
||||
parameterContextsJoin.setComponent(component);
|
||||
parameterContextsJoin.setRevision(revision);
|
||||
|
||||
CreateParamContextJoin createParamContextJoin = new CreateParamContextJoin();
|
||||
createParamContextJoin.setParameterContextsJoin(parameterContextsJoin);
|
||||
// createParamContextJoin.setProcessGroupsId(processGroupsId);
|
||||
return createParamContextJoin;
|
||||
}
|
||||
|
||||
public static String createParamTime() {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMMddHHmm");
|
||||
String formattedTime = now.format(formatter);
|
||||
return formattedTime;
|
||||
}
|
||||
|
||||
public CreateParamContextJoin setMysqlParamContextJoin(String processGroupsId) throws Exception {
|
||||
Revision revision = new Revision();
|
||||
revision.setVersion(0);
|
||||
|
||||
// Parameter2 parameter = new Parameter2();
|
||||
// parameter.setSensitive(false);
|
||||
// parameter.setName("Release Signal Identifier");
|
||||
// parameter.setValue("table_creation");
|
||||
// parameter.setDescription("参数描述");
|
||||
|
||||
// Parameter2 parameter2 = new Parameter2();
|
||||
// parameter2.setSensitive(false);
|
||||
// parameter2.setName("autoTableCreation");
|
||||
// parameter2.setValue("Y");
|
||||
// parameter2.setDescription("是否自动建表");
|
||||
|
||||
Parameter2 parameter3 = new Parameter2();
|
||||
parameter3.setSensitive(false);
|
||||
parameter3.setName("mappingRelationship");
|
||||
parameter3.setValue("[\n" + " {\n" + " \"targetTbName\": \"iep_so_sale\",\n" + " \"targetDBType\": \"mysql8.0.44\",\n" + " \"writeType\": \"1\",\n" + " \"fieldRelationship\": [\n" + " {\n" + " \"sourceFieldName\": \"csaleid\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"csaleid\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"主键\",\n" + " \"primaryKey\": \"Y\"\n" + " },\n" + " {\n" + " \"sourceFieldName\": \"vreceiptcode\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"vreceiptcode\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"编码\"\n" + " },\n" + " {\n" + " \"sourceFieldName\": \"ts\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"ts\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"更新时间\"\n" + " }\n" + " ]\n" + " }\n" + "]");
|
||||
parameter3.setDescription("字段映射关系");
|
||||
|
||||
// Parameter2 parameter4 = new Parameter2();
|
||||
// parameter4.setSensitive(false);
|
||||
// parameter4.setName("releaseSignalIdentifier");
|
||||
// parameter4.setValue(UUID.randomUUID().toString());
|
||||
// parameter4.setDescription("建表信号,传随机值!");
|
||||
|
||||
// Parameter2 parameter4 = new Parameter2();
|
||||
// parameter4.setSensitive(false);
|
||||
// parameter4.setName("maximumValueColumns");
|
||||
// parameter4.setValue("ts");
|
||||
// parameter4.setDescription("参数描述");
|
||||
|
||||
// Parameter2 parameter5 = new Parameter2();
|
||||
// parameter5.setSensitive(false);
|
||||
// parameter5.setName("sourceTbName");
|
||||
// parameter5.setValue("U8C241231.SO_SALE");
|
||||
// parameter5.setDescription("参数描述");
|
||||
|
||||
// Parameters2 parameters = new Parameters2();
|
||||
// parameters.setParameter(parameter4);
|
||||
|
||||
// Parameters2 parameters2 = new Parameters2();
|
||||
// parameters2.setParameter(parameter2);
|
||||
|
||||
Parameters2 parameters3 = new Parameters2();
|
||||
parameters3.setParameter(parameter3);
|
||||
|
||||
// Parameters2 parameters4 = new Parameters2();
|
||||
// parameters4.setParameter(parameter4);
|
||||
|
||||
// Parameters2 parameters5 = new Parameters2();
|
||||
// parameters5.setParameter(parameter5);
|
||||
|
||||
List<Parameters2> parametersList = new ArrayList<>();
|
||||
// parametersList.add(parameters);
|
||||
// parametersList.add(parameters2);
|
||||
parametersList.add(parameters3);
|
||||
// parametersList.add(parameters4);
|
||||
// parametersList.add(parameters5);
|
||||
|
||||
Component3 component = new Component3();
|
||||
component.setName("mysql参数环境" + createParamTime());
|
||||
component.setParameters(parametersList);
|
||||
|
||||
ParameterContextsJoin parameterContextsJoin = new ParameterContextsJoin();
|
||||
parameterContextsJoin.setComponent(component);
|
||||
parameterContextsJoin.setRevision(revision);
|
||||
|
||||
CreateParamContextJoin createParamContextJoin = new CreateParamContextJoin();
|
||||
createParamContextJoin.setParameterContextsJoin(parameterContextsJoin);
|
||||
createParamContextJoin.setProcessGroupsId(processGroupsId);
|
||||
return createParamContextJoin;
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制器参数-oracle
|
||||
*/
|
||||
private FindNeedModifyController setOracleFindNeedModifyController(String processGroupId) {
|
||||
//创建Mysql数据源
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
properties.put("Database Connection URL", "jdbc:oracle:thin:@39.170.109.90:1521:orcl");
|
||||
properties.put("Database Driver Class Name", "oracle.jdbc.OracleDriver");
|
||||
properties.put("database-driver-locations", "/data/nifi-1.28.1/lib/ojdbc8.jar");
|
||||
properties.put("Database User", "U8C241231");
|
||||
properties.put("Password", "U8C241231");
|
||||
properties.put("Max Wait Time", "600001 millis");
|
||||
properties.put("Max Total Connections", "20");
|
||||
properties.put("Validation-query", "select 1 from dual");
|
||||
properties.put("dbcp-min-idle-conns", "5");
|
||||
properties.put("dbcp-max-idle-conns", "10");
|
||||
properties.put("dbcp-max-conn-lifetime", "-1");
|
||||
properties.put("dbcp-time-between-eviction-runs", "-1");
|
||||
properties.put("dbcp-min-evictable-idle-time", "30 mins");
|
||||
properties.put("dbcp-soft-min-evictable-idle-time", "-1");
|
||||
|
||||
Component12 component12 = new Component12();
|
||||
component12.setName("Oracle数据源");
|
||||
component12.setType("org.apache.nifi.dbcp.DBCPConnectionPool");
|
||||
//传这个值并没有用
|
||||
// component12.setState("ENABLED");
|
||||
component12.setProperties(properties);
|
||||
component12.setComments("Oracle数据源备注");
|
||||
component12.setBulletinLevel("DEBUG");
|
||||
// component12.setId();//需要修改的控制器id
|
||||
|
||||
ControllerService12 controllerService11 = new ControllerService12();
|
||||
controllerService11.setComponent(component12);
|
||||
controllerService11.setModifyMarkId("vuBXdbEu7v");
|
||||
// controllerService11.setId();//需要修改的控制器id
|
||||
|
||||
List<ControllerService12> controllerService12List = new ArrayList<>();
|
||||
controllerService12List.add(controllerService11);
|
||||
|
||||
FindNeedModifyController findNeedModifyController = new FindNeedModifyController();
|
||||
findNeedModifyController.setNeedModifyController(controllerService12List);
|
||||
findNeedModifyController.setProcessGroupId(processGroupId);
|
||||
return findNeedModifyController;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 控制器参数-oracle
|
||||
*/
|
||||
private FindNeedModifyController setMysqlFindNeedModifyController(String processGroupId) {
|
||||
//创建Mysql数据源
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
properties.put("Database Connection URL", "jdbc:mysql://ufidahz.com.cn:9015/apache_nifi_sync?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8&useLegacyDatetimeCode=false");
|
||||
properties.put("Database Driver Class Name", "com.mysql.cj.jdbc.Driver");
|
||||
properties.put("database-driver-locations", "/data/nifi-1.28.1/lib/mysql-connector-java-8.0.30.jar");
|
||||
properties.put("Database User", "root");
|
||||
properties.put("Password", "hzya1314");
|
||||
properties.put("Max Wait Time", "600001 millis");
|
||||
properties.put("Max Total Connections", "15");
|
||||
properties.put("Validation-query", "select 1");
|
||||
properties.put("dbcp-min-idle-conns", "5");
|
||||
properties.put("dbcp-max-idle-conns", "10");
|
||||
properties.put("dbcp-max-conn-lifetime", "-1");
|
||||
properties.put("dbcp-time-between-eviction-runs", "-1");
|
||||
properties.put("dbcp-min-evictable-idle-time", "30 mins");
|
||||
properties.put("dbcp-soft-min-evictable-idle-time", "-1");
|
||||
|
||||
Component12 component12 = new Component12();
|
||||
component12.setName("Mysql数据源");
|
||||
component12.setType("org.apache.nifi.dbcp.DBCPConnectionPool");
|
||||
//传这个值并没有用
|
||||
// component12.setState("ENABLED");
|
||||
component12.setProperties(properties);
|
||||
component12.setComments("Mysql数据源备注");
|
||||
component12.setBulletinLevel("DEBUG");
|
||||
// component12.setId();//需要修改的控制器id
|
||||
|
||||
ControllerService12 controllerService11 = new ControllerService12();
|
||||
controllerService11.setComponent(component12);
|
||||
controllerService11.setModifyMarkId("CZFJwnb9sb");
|
||||
// controllerService11.setId();//需要修改的控制器id
|
||||
|
||||
List<ControllerService12> controllerService12List = new ArrayList<>();
|
||||
controllerService12List.add(controllerService11);
|
||||
|
||||
FindNeedModifyController findNeedModifyController = new FindNeedModifyController();
|
||||
findNeedModifyController.setNeedModifyController(controllerService12List);
|
||||
findNeedModifyController.setProcessGroupId(processGroupId);
|
||||
return findNeedModifyController;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试nifi数据同步场景调用
|
||||
*/
|
||||
@Test
|
||||
public void testDbSync() throws Exception {
|
||||
//新建「开始」处理器
|
||||
String parentProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
String processGroupsName = "跨数据源同步";
|
||||
String processGroupsId = testCreateProcessGroups(parentProcessGroupId, processGroupsName);
|
||||
|
||||
//新建GenerateFlowFile处理器(最开始的处理器)
|
||||
String generateFlowFileId = testCreateProcessor(processGroupsId);
|
||||
|
||||
//拷贝Oracle应用,并实例化到新建的流程组
|
||||
// String processGroupId = "41437b87-0196-1000-6951-50e41e75c0da";
|
||||
// String parentProcessGroupId = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||
String oracleSnippetId = testCreateSnippets("41437b87-0196-1000-6951-50e41e75c0da", "76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
String oracleProcessGroupId = testCreateSnippetInstance(processGroupsId, parentProcessGroupId, oracleSnippetId);
|
||||
|
||||
//拷贝Mysql应用,并实例化到新建的流程组
|
||||
// String processGroupId2 = "4143d803-0196-1000-968f-b06f55b43a3f";
|
||||
// String parentProcessGroupId2 = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||
String mysqlSnippetId = testCreateSnippets("4143d803-0196-1000-968f-b06f55b43a3f", "76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
String mysqlProcessGroupId = testCreateSnippetInstance(processGroupsId, parentProcessGroupId, mysqlSnippetId);
|
||||
|
||||
//新建LogAttribute处理器(结束处理器)
|
||||
// String logAttributeId = testCreateProcessor2();
|
||||
String logAttributeId = null;
|
||||
|
||||
//修改Oracle应用数据源
|
||||
//修改Oracle应用上下文环境
|
||||
//修改mysql应用数据源
|
||||
//修改mysql应用上下文环境
|
||||
//启动Mysql应用对应的控制器服务
|
||||
//启动Oracle应用对应的控制器服务
|
||||
//创建连接关系
|
||||
//启动处理器
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建空的流程组
|
||||
*
|
||||
* @param parentProcessGroupId 需要新建的目标流程组的父流程组id
|
||||
* @param name 目标流程组名称
|
||||
*/
|
||||
public String testCreateProcessGroups(String parentProcessGroupId, String name) throws Exception {
|
||||
String processGroupsId = "";
|
||||
try {
|
||||
Revision5 revision5 = new Revision5();
|
||||
revision5.setVersion(0);
|
||||
|
||||
Component7 component7 = new Component7();
|
||||
component7.setName(name);
|
||||
|
||||
ProcessGroupsJoin processGroupsJoin = new ProcessGroupsJoin();
|
||||
processGroupsJoin.setRevision(revision5);
|
||||
processGroupsJoin.setComponent(component7);
|
||||
|
||||
//父处理器组
|
||||
// String parentGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
ProcessgroupsResult processGroups = nifiApiService.createProcessGroups(parentProcessGroupId, processGroupsJoin);
|
||||
processGroupsId = processGroups.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return processGroupsId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建GenerateFlowFile处理器
|
||||
*/
|
||||
public String testCreateProcessor(String groupId) {
|
||||
String processId = null;
|
||||
try {
|
||||
Revision15 revision15 = new Revision15();
|
||||
revision15.setVersion("0");
|
||||
|
||||
Component15 component15 = new Component15();
|
||||
component15.setType("org.apache.nifi.processors.standard.GenerateFlowFile");
|
||||
component15.setName("定时调度");
|
||||
|
||||
// Position15 position15 = new Position15();
|
||||
// position15.setX("0");
|
||||
// position15.setY("0");
|
||||
|
||||
Config15 config15 = new Config15();
|
||||
config15.setSchedulingPeriod("1 min");
|
||||
|
||||
Properties15 properties15 = new Properties15();
|
||||
properties15.setFileSize("1KB");
|
||||
|
||||
config15.setProperties(properties15);
|
||||
|
||||
component15.setConfig(config15);
|
||||
|
||||
CreateProcessorJoin15 createProcessorJoin15 = new CreateProcessorJoin15();
|
||||
createProcessorJoin15.setComponent(component15);
|
||||
createProcessorJoin15.setRevision(revision15);
|
||||
|
||||
// String groupId = "019610d1-f933-1f70-16ea-3cf005012c4b";
|
||||
CreateProcess16 processor = nifiApiService.createProcessor(groupId, createProcessorJoin15);
|
||||
processId = processor.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return processId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 为指定流程组创建片段
|
||||
*
|
||||
* @param targetCopyProcessGroupId 需要复制的目标流程组id
|
||||
* @param parentProcessGroupId 目标流程组的父流程组id
|
||||
*/
|
||||
public String testCreateSnippets(String targetCopyProcessGroupId, String parentProcessGroupId) {
|
||||
String snippetId = null;
|
||||
try {
|
||||
//查询目标流程组版本
|
||||
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(targetCopyProcessGroupId);
|
||||
Revision9 revision = processGroups.getRevision();
|
||||
|
||||
Map<String, String> processGroupsMap2 = new HashMap<>();
|
||||
processGroupsMap2.put("version", revision.getVersion());//目标流程组版本号
|
||||
|
||||
Map<String, Map<String, String>> processGroupsMap = new HashMap<>();
|
||||
processGroupsMap.put(targetCopyProcessGroupId, processGroupsMap2);//目标流程组id
|
||||
|
||||
Snippet snippet = new Snippet();
|
||||
snippet.setParentGroupId(parentProcessGroupId);//目标流程组id的父流程组id
|
||||
snippet.setProcessGroups(processGroupsMap);
|
||||
|
||||
SnippetsJoin snippetsJoin = new SnippetsJoin();
|
||||
snippetsJoin.setSnippet(snippet);
|
||||
SnippetResult13 snippets = nifiApiService.createSnippets(snippetsJoin);
|
||||
Snippet13 snippet1 = snippets.getSnippet();
|
||||
snippetId = snippet1.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return snippetId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建LogAttribute处理器
|
||||
*/
|
||||
@Test
|
||||
public void testCreateProcessor2() throws Exception {
|
||||
// String processorId = null;
|
||||
try {
|
||||
Revision15 revision15 = new Revision15();
|
||||
revision15.setVersion("0");
|
||||
|
||||
Component15 component15 = new Component15();
|
||||
component15.setType("org.apache.nifi.processors.standard.LogAttribute");
|
||||
component15.setName("结束节点");
|
||||
|
||||
// Position15 position15 = new Position15();
|
||||
// position15.setX("0");
|
||||
// position15.setY("0");
|
||||
|
||||
Properties15 properties15 = new Properties15();
|
||||
properties15.setLogLevel("info");
|
||||
properties15.setLogPayload("false");
|
||||
properties15.setAttributesToLogRegex(".*");
|
||||
properties15.setLogFlowFileProperties("true");
|
||||
properties15.setOutputFormat("Line per Attribute");
|
||||
properties15.setCharacterSet("UTF-8");
|
||||
|
||||
Config15 config15 = new Config15();
|
||||
config15.setProperties(properties15);
|
||||
config15.setBulletinLevel("DEBUG");
|
||||
|
||||
component15.setConfig(config15);
|
||||
// component15.setPosition(position15);
|
||||
|
||||
//定义连接关系
|
||||
Relationships15 relationships15 = new Relationships15();
|
||||
relationships15.setName("success");
|
||||
relationships15.setAutoTerminate(true);
|
||||
// relationships15.setRetry(true);
|
||||
// relationships15.setDescription("123");
|
||||
List<Relationships15> relationships15List = new ArrayList<>();
|
||||
relationships15List.add(relationships15);
|
||||
component15.setRelationships(relationships15List);
|
||||
|
||||
CreateProcessorJoin15 createProcessorJoin15 = new CreateProcessorJoin15();
|
||||
createProcessorJoin15.setComponent(component15);
|
||||
createProcessorJoin15.setRevision(revision15);
|
||||
|
||||
String groupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
CreateProcess16 processor = nifiApiService.createProcessor(groupId, createProcessorJoin15);
|
||||
// System.out.println("处理器id:" + processor.getId());
|
||||
// processorId = processor.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// return processorId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将片段实例到指定位置
|
||||
*
|
||||
* @param groupId 目标流程组id(需要拷贝到哪个流程组)
|
||||
* @param parentGroupId 目标流程组的父流程组id()
|
||||
* @param snippetId 片段id
|
||||
*/
|
||||
public String testCreateSnippetInstance(String groupId, String parentGroupId, String snippetId) throws Exception {
|
||||
String processGroupId = null;
|
||||
try {
|
||||
//先请求得到代码片段id
|
||||
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(groupId);
|
||||
Revision9 revision = processGroups.getRevision();
|
||||
|
||||
Map<String, String> processGroupsMap2 = new HashMap<>();
|
||||
processGroupsMap2.put("version", revision.getVersion());//目标流程组版本号
|
||||
|
||||
Map<String, Map<String, String>> processGroupsMap = new HashMap<>();
|
||||
processGroupsMap.put(groupId, processGroupsMap2);//目标流程组id
|
||||
|
||||
// Snippet snippet = new Snippet();
|
||||
// snippet.setParentGroupId(parentGroupId);//目标流程组id的父流程组id
|
||||
// snippet.setProcessGroups(processGroupsMap);
|
||||
|
||||
// SnippetsJoin snippetsJoin = new SnippetsJoin();
|
||||
// snippetsJoin.setSnippet(snippet);
|
||||
// SnippetResult13 snippets = nifiApiService.createSnippets(snippetsJoin);
|
||||
// Snippet13 snippet1 = snippets.getSnippet();
|
||||
// System.out.println(snippet1.getId());
|
||||
|
||||
//将片段实例化到指定位置
|
||||
// String groupId = "019610d1-f933-1f70-16ea-3cf005012c4b";//流程组id
|
||||
SnippetInstanceJoin snippetInstanceJoin = new SnippetInstanceJoin();
|
||||
snippetInstanceJoin.setSnippetId(snippetId);
|
||||
// snippetInstanceJoin.setOriginY("0");
|
||||
// snippetInstanceJoin.setOriginX("0");
|
||||
SnippetInstance15 snippetInstance = nifiApiService.createSnippetInstance(groupId, snippetInstanceJoin);
|
||||
Flow15 flow = snippetInstance.getFlow();
|
||||
ProcessGroups15 processGroups15 = flow.getProcessGroups().get(0);
|
||||
// System.out.println(processGroups15.getId());
|
||||
processGroupId = processGroups15.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return processGroupId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.hzya.frame;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.nifilog.dao.ILoggingEvent20250430Dao;
|
||||
import com.hzya.frame.nifilog.entity.LoggingEvent20250430Entity;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestNifiLog
|
||||
* @Date:2025/5/20 11:53
|
||||
* @Filename:TestNifiLog
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {WebappApplication.class})
|
||||
public class TestNifiLog {
|
||||
|
||||
@Autowired
|
||||
private ILoggingEvent20250430Dao iLoggingEvent20250430Dao;
|
||||
|
||||
/**
|
||||
* 获取nifi token
|
||||
*/
|
||||
@Test
|
||||
public void getAccessToken() {
|
||||
try {
|
||||
// PageAttribute<LoggingEvent20250430Entity> loggingEvent20250430EntityPageAttribute = iLoggingEvent20250430Dao.queryPaged();
|
||||
|
||||
List<String> arg0List = new ArrayList<>();
|
||||
arg0List.add("UpdateAttribute[id=ad841aed-30f7-16e2-4fa0-595ab0ab9fdc]");
|
||||
|
||||
List<String> logDateList = new ArrayList<>();
|
||||
logDateList.add("20250519");
|
||||
logDateList.add("20250520");
|
||||
|
||||
LoggingEvent20250430Entity loggingEvent20250430Entity = new LoggingEvent20250430Entity();
|
||||
loggingEvent20250430Entity.setArg0List(arg0List);
|
||||
loggingEvent20250430Entity.setLogDateList(logDateList);
|
||||
loggingEvent20250430Entity.setPageNum(1);
|
||||
loggingEvent20250430Entity.setPageSize(100);
|
||||
|
||||
PageInfo<LoggingEvent20250430Entity> loggingEvent20250430EntityPageInfo = iLoggingEvent20250430Dao.queryLoggingEventByProcessorId(loggingEvent20250430Entity);
|
||||
List<LoggingEvent20250430Entity> list = loggingEvent20250430EntityPageInfo.getList();
|
||||
System.out.println(list.size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<artifactId>kangarooDataCenterV3</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>fw-nifi</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>${revision}</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<artifactId>base-service</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>mysql</groupId>-->
|
||||
<!-- <artifactId>mysql-connector-java</artifactId>-->
|
||||
<!-- <version>${mysql-connector-java}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.ibm.jsonata4java</groupId>-->
|
||||
<!-- <artifactId>JSONata4Java</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<!-- <version>4.10.0</version>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法:为了解决Unable to find main class的问题 -->
|
||||
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,11 @@
|
|||
//package com.hzya.frame.nifi;
|
||||
//
|
||||
//import org.springframework.boot.SpringApplication;
|
||||
//import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
//
|
||||
//@SpringBootApplication(scanBasePackages = "com.hzya.frame.nifi")
|
||||
//public class NifiApplication {
|
||||
// public static void main(String[] args) {
|
||||
// SpringApplication.run(NifiApplication.class, args);
|
||||
// }
|
||||
//}
|
|
@ -0,0 +1,238 @@
|
|||
package com.hzya.frame.nifiapi.client;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.hzya.frame.nifiapi.config.NifiServiceConfig;
|
||||
import okhttp3.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/**
|
||||
* nifi客户端请求处理
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.client
|
||||
* @Project:fw-nifi
|
||||
* @name:NifiClient
|
||||
* @Date:2025/5/14 10:00
|
||||
* @Filename:NifiClient
|
||||
*/
|
||||
@Component
|
||||
public class NifiClient {
|
||||
|
||||
private final NifiServiceConfig config;
|
||||
private final OkHttpClient httpClient;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final AtomicReference<String> accessToken = new AtomicReference<>();
|
||||
private volatile long tokenIssueTime; // Token 发行时间(毫秒)
|
||||
private volatile long tokenExpiration; // Token 过期时间(毫秒)
|
||||
Logger logger = LoggerFactory.getLogger(NifiClient.class);
|
||||
|
||||
@Autowired
|
||||
public NifiClient(NifiServiceConfig config, OkHttpClient httpClient, ObjectMapper objectMapper) {
|
||||
this.config = config;
|
||||
this.httpClient = httpClient;
|
||||
this.objectMapper = objectMapper;
|
||||
initializeToken();
|
||||
}
|
||||
|
||||
private void initializeToken() {
|
||||
try {
|
||||
accessToken.set(getAccessToken());
|
||||
tokenIssueTime = System.currentTimeMillis();
|
||||
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||
logger.info("令牌已初始化,过期时间:" + new java.util.Date(tokenExpiration));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("初始化NiFi访问令牌失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T get(String path, Class<T> responseType) throws IOException {
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原始JSON响应字符串,不进行反序列化
|
||||
*/
|
||||
public String getRaw(String path) throws IOException {
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
try (Response response = httpClient.newCall(request).execute()) {
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException("意外的响应码: " + response.code());
|
||||
}
|
||||
return response.body().string();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行GET请求并返回文件流,供调用者处理(如保存到文件或浏览器下载)
|
||||
*/
|
||||
public InputStream getAsStream(String path) throws IOException {
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeStreamRequest(request);
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T post(String path, Object requestBody, Class<T> responseType) throws IOException {
|
||||
String jsonBody = objectMapper.writeValueAsString(requestBody);
|
||||
RequestBody body = RequestBody.create(jsonBody, MediaType.get("application/json; charset=utf-8"));
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).post(body).header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T delete(String path, Class<T> responseType) throws IOException {
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).delete().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T delete(String path, Map<String, String> queryParams, Class<T> responseType) throws IOException {
|
||||
// 构建 URL 并添加查询参数
|
||||
HttpUrl.Builder urlBuilder = HttpUrl.parse(config.getApiUrl() + path).newBuilder();
|
||||
if (queryParams != null) {
|
||||
queryParams.forEach(urlBuilder::addQueryParameter);
|
||||
}
|
||||
String url = urlBuilder.build().toString();
|
||||
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(url).delete().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T put(String path, Object requestBody, Class<T> responseType) throws IOException {
|
||||
String jsonBody = objectMapper.writeValueAsString(requestBody);
|
||||
RequestBody body = RequestBody.create(jsonBody, MediaType.get("application/json; charset=utf-8"));
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).put(body).header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
private <T> T executeRequestWithRetry(IOExceptionRunnable<T> runnable) throws IOException {
|
||||
int maxRetries = 2;
|
||||
for (int attempt = 0; attempt < maxRetries; attempt++) {
|
||||
try {
|
||||
checkAndRefreshToken();
|
||||
return runnable.run();
|
||||
} catch (IOException e) {
|
||||
if (attempt == maxRetries - 1 || !isTokenExpiredError(e)) {
|
||||
throw e;
|
||||
}
|
||||
logger.info("令牌可能已过期,请刷新并重试...");
|
||||
try {
|
||||
accessToken.set(getAccessToken());
|
||||
tokenIssueTime = System.currentTimeMillis();
|
||||
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||
} catch (Exception ex) {
|
||||
throw new IOException("刷新令牌失败: " + ex.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new IOException("已达到最大重试次数");
|
||||
}
|
||||
|
||||
private void checkAndRefreshToken() throws IOException {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
if (currentTime > tokenExpiration - 300000) { // 提前 5 分钟刷新
|
||||
try {
|
||||
accessToken.set(getAccessToken());
|
||||
tokenIssueTime = System.currentTimeMillis();
|
||||
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||
logger.info("令牌已刷新,到期时间: " + new java.util.Date(tokenExpiration));
|
||||
} catch (Exception e) {
|
||||
throw new IOException("刷新令牌失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isTokenExpiredError(IOException e) {
|
||||
// 判断是否为 401 错误(Token 过期)
|
||||
return e.getMessage().contains("401") || e.getMessage().contains("Unauthorized");
|
||||
}
|
||||
|
||||
private <T> T executeRequest(Request request, Class<T> responseType) throws IOException {
|
||||
try (Response response = httpClient.newCall(request).execute()) {
|
||||
String responseBody = response.body().string();
|
||||
logger.info("响应体:" + responseBody);
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException(StrUtil.format("意外的响应码: {}", responseBody));
|
||||
}
|
||||
return objectMapper.readValue(responseBody, responseType);
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized String getAccessToken() throws Exception {
|
||||
// 创建信任所有证书的 OkHttpClient
|
||||
// OkHttpClient client = httpClient.newBuilder().sslSocketFactory(createTrustAllSslSocketFactory(), createTrustAllTrustManager()).hostnameVerifier((hostname, session) -> true).build();
|
||||
|
||||
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||
RequestBody body = RequestBody.create(mediaType, "username=" + config.getUsername() + "&password=" + config.getPassword());
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + "/access/token").post(body).addHeader("Content-Type", "application/x-www-form-urlencoded").addHeader("Accept", "*/*").addHeader("User-Agent", "fw-nifi-client/1.0").addHeader("Connection", "keep-alive").build();
|
||||
|
||||
try (Response response = httpClient.newCall(request).execute()) {
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException("获取访问令牌失败,响应码: " + response.code() + " - " + response.message());
|
||||
}
|
||||
byte[] bytes = response.body().bytes();
|
||||
String newToken = new String(bytes, StandardCharsets.UTF_8);
|
||||
return newToken;
|
||||
}
|
||||
}
|
||||
|
||||
// private SSLSocketFactory createTrustAllSslSocketFactory() throws Exception {
|
||||
// SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||
// sslContext.init(null, new TrustManager[]{createTrustAllTrustManager()}, new SecureRandom());
|
||||
// return sslContext.getSocketFactory();
|
||||
// }
|
||||
|
||||
// private X509TrustManager createTrustAllTrustManager() {
|
||||
// return new X509TrustManager() {
|
||||
// @Override
|
||||
// public void checkClientTrusted(X509Certificate[] chain, String authType) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void checkServerTrusted(X509Certificate[] chain, String authType) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public X509Certificate[] getAcceptedIssuers() {
|
||||
// return new X509Certificate[0];
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
|
||||
private InputStream executeStreamRequest(Request request) throws IOException {
|
||||
Response response = httpClient.newCall(request).execute();
|
||||
if (!response.isSuccessful()) {
|
||||
String responseBody = response.body().string();
|
||||
response.close();
|
||||
throw new IOException("意外的响应码: " + responseBody);
|
||||
}
|
||||
return response.body().byteStream();
|
||||
}
|
||||
|
||||
// 功能接口,用于重试逻辑
|
||||
@FunctionalInterface
|
||||
private interface IOExceptionRunnable<T> {
|
||||
T run() throws IOException;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package com.hzya.frame.nifiapi.config;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* OkHttpClient配置类
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.config
|
||||
* @Project:fw-nifi
|
||||
* @name:HttpClientConfig
|
||||
* @Date:2025/5/14 11:45
|
||||
* @Filename:HttpClientConfig
|
||||
*/
|
||||
@Configuration
|
||||
public class HttpClientConfig {
|
||||
|
||||
@Bean
|
||||
public OkHttpClient okHttpClient() throws Exception {
|
||||
//调用nifi接口正常情况不会超过60秒的,目前遇到的接口1秒以内调用完毕
|
||||
return new OkHttpClient.Builder().sslSocketFactory(createTrustAllSslSocketFactory(), createTrustAllTrustManager()).hostnameVerifier((hostname, session) -> true).connectTimeout(60, TimeUnit.SECONDS) // 连接超时时间
|
||||
.readTimeout(60, TimeUnit.SECONDS) // 读取超时时间
|
||||
.writeTimeout(60, TimeUnit.SECONDS) // 写入超时时间
|
||||
.build();
|
||||
}
|
||||
|
||||
private SSLSocketFactory createTrustAllSslSocketFactory() throws Exception {
|
||||
SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||
sslContext.init(null, new TrustManager[]{createTrustAllTrustManager()}, new SecureRandom());
|
||||
return sslContext.getSocketFactory();
|
||||
}
|
||||
|
||||
private X509TrustManager createTrustAllTrustManager() {
|
||||
return new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.nifiapi.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* jackson配置类
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.config
|
||||
* @Project:fw-nifi
|
||||
* @name:JacksonConfig
|
||||
* @Date:2025/5/14 11:54
|
||||
* @Filename:JacksonConfig
|
||||
*/
|
||||
@Configuration
|
||||
public class JacksonConfig {
|
||||
@Bean
|
||||
public ObjectMapper objectMapper() {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
// 自动注册模块
|
||||
objectMapper.findAndRegisterModules();
|
||||
// 忽略 JSON 中存在但实体类中缺少的字段
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
return objectMapper;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.hzya.frame.nifiapi.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* nifi service配置类
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.config
|
||||
* @Project:fw-nifi
|
||||
* @name:NifiConfig
|
||||
* @Date:2025/5/14 09:59
|
||||
* @Filename:NifiConfig
|
||||
*/
|
||||
@Configuration
|
||||
@Data
|
||||
public class NifiServiceConfig {
|
||||
|
||||
@Value("${nifi.api.url:https://192.168.2.233:8443/nifi-api}")
|
||||
private String apiUrl;
|
||||
|
||||
@Value("${nifi.api.username:hzya}")
|
||||
private String username;
|
||||
|
||||
@Value("${nifi.api.password:hzya1314*nifi}")
|
||||
private String password;
|
||||
|
||||
@Value("${nifi.api.controllerModifymark:接口修改标记}")
|
||||
private String controllerModifyMark;
|
||||
|
||||
@Value("${nifi.api.relationshipMark:接口关系标记}")
|
||||
private String relationshipMark;
|
||||
|
||||
@Value("${nifi.api.relationshipMark:接口状态清理标记}")
|
||||
private String stateClearMark;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.hzya.frame.nifiapi.model.basemodel;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joincreparamcontext.CreateParamContextJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller.FindNeedModifyController;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 基类封转创建应用操作公共的字段
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateOracleApp
|
||||
* @Date:2025/5/21 17:44
|
||||
* @Filename:CreateOracleApp
|
||||
*/
|
||||
@Data
|
||||
public class JoinBashModel {
|
||||
//实例化
|
||||
private String appProcessGroupId;
|
||||
private String parentProcessGroupId;
|
||||
private String copyTargetProcessGroupId;
|
||||
// private String copyTargetParentProcessGroupId;
|
||||
|
||||
//上下文
|
||||
private CreateParamContextJoin createParamContextJoin;
|
||||
|
||||
//控制器
|
||||
private FindNeedModifyController findNeedModifyController;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 11:1:46
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class BindParameterContextsJoin11 {
|
||||
private Revision11 revision;
|
||||
private Component11 component;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 11:1:46
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Component11 {
|
||||
private String id;
|
||||
private ParameterContext11 parameterContext;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ParameterContext11 {
|
||||
private String id;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Copyright 2025 bejson.com
|
||||
*/
|
||||
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 11:1:46
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Revision11 {
|
||||
private String version;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.nifiapi.model.joincontrollerenabled;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincontrollerenabled
|
||||
* @Project:fw-nifi
|
||||
* @name:EnOrDiControllerServices
|
||||
* @Date:2025/5/16 16:54
|
||||
* @Filename:EnOrDiControllerServices
|
||||
*/
|
||||
@Data
|
||||
public class EnOrDiControllerServices12 {
|
||||
private String state;
|
||||
private Revision13 revision;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joincontrollerenabled;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincontrollerenabled
|
||||
* @Project:fw-nifi
|
||||
* @name:ControllerServiceStatus
|
||||
* @Date:2025/5/16 16:54
|
||||
* @Filename:ControllerServiceStatus
|
||||
*/
|
||||
@Data
|
||||
public class Revision13 {
|
||||
private String version;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||
* @Project:fw-nifi
|
||||
* @name:Component18
|
||||
* @Date:2025/5/19 15:39
|
||||
* @Filename:Component18
|
||||
*/
|
||||
@Data
|
||||
public class Component18 {
|
||||
private String id;
|
||||
private String parentGroupId;
|
||||
private String backPressureObjectThreshold;
|
||||
private String backPressureDataSizeThreshold;
|
||||
private String flowFileExpiration;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateConnection
|
||||
* @Date:2025/5/19 15:35
|
||||
* @Filename:CreateConnection
|
||||
*/
|
||||
@Data
|
||||
public class CreateConnection18 {
|
||||
private String id;
|
||||
private String sourceId;
|
||||
private String sourceGroupId;
|
||||
private String sourceType;
|
||||
private String destinationId;
|
||||
private String destinationGroupId;
|
||||
private String destinationType;
|
||||
private Revision18 revision;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||
* @Project:fw-nifi
|
||||
* @name:Revision18
|
||||
* @Date:2025/5/19 15:36
|
||||
* @Filename:Revision18
|
||||
*/
|
||||
@Data
|
||||
public class Revision18 {
|
||||
private String version;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||
* @Project:fw-nifi
|
||||
* @name:Component17
|
||||
* @Date:2025/5/19 11:58
|
||||
* @Filename:Component17
|
||||
*/
|
||||
@Data
|
||||
public class Component18 {
|
||||
private SourceOrDestination18 source;
|
||||
private SourceOrDestination18 destination;
|
||||
private List<String> selectedRelationships;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateConnections
|
||||
* @Date:2025/5/19 11:56
|
||||
* @Filename:CreateConnections
|
||||
*/
|
||||
@Data
|
||||
public class CreateConnections18 {
|
||||
private Revision18 revision;
|
||||
private Component18 component;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||
* @Project:fw-nifi
|
||||
* @name:Revision17
|
||||
* @Date:2025/5/19 11:56
|
||||
* @Filename:Revision17
|
||||
*/
|
||||
@Data
|
||||
public class Revision18 {
|
||||
private String version;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||
* @Project:fw-nifi
|
||||
* @name:SourceOrDestination
|
||||
* @Date:2025/5/19 13:39
|
||||
* @Filename:SourceOrDestination
|
||||
*/
|
||||
@Data
|
||||
public class SourceOrDestination18 {
|
||||
private String id;
|
||||
private String groupId;
|
||||
private String type;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreatemysqlapp;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.basemodel.JoinBashModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateOracleApp
|
||||
* @Date:2025/5/21 17:44
|
||||
* @Filename:CreateOracleApp
|
||||
*/
|
||||
@Data
|
||||
public class CreateMysqlApp extends JoinBashModel {
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateoracleapp;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.basemodel.JoinBashModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateOracleApp
|
||||
* @Date:2025/5/21 17:44
|
||||
* @Filename:CreateOracleApp
|
||||
*/
|
||||
@Data
|
||||
public class CreateAppInstanceJoin extends JoinBashModel {
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateprocessconnection;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.CreateConnections18;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreateprocessconnection
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateProcessorConnections
|
||||
* @Date:2025/5/22 14:06
|
||||
* @Filename:CreateProcessorConnections
|
||||
*/
|
||||
@Data
|
||||
public class CreateProcessorConnections {
|
||||
private String processGroupsId;
|
||||
private List<CreateConnections18> createConnections18;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Component16;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincerateprocessorandupdateparam
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateProcessorAndUpdateParam
|
||||
* @Date:2025/5/26 15:59
|
||||
* @Filename:CreateProcessorAndUpdateParam
|
||||
*/
|
||||
@Data
|
||||
public class CreateProcessorAndUpdateParamJoin {
|
||||
private String targetProcessorId;
|
||||
private String parentProcessGroupId;
|
||||
private String copyTargetProcessGroupId;
|
||||
private Component16 component;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreatetemp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreatetemp
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateTemplateJoin
|
||||
* @Date:2025/5/17 10:52
|
||||
* @Filename:CreateTemplateJoin
|
||||
*/
|
||||
@Data
|
||||
public class CreateTemplateJoin {
|
||||
private String name;
|
||||
private String description;
|
||||
private String snippetId;
|
||||
private String disconnectedNodeAcknowledged;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreparamcontext;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joinparametercontexts.ParameterContextsJoin;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreparamcontext
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateParamContextJoin
|
||||
* @Date:2025/5/22 08:58
|
||||
* @Filename:CreateParamContextJoin
|
||||
*/
|
||||
@Data
|
||||
public class CreateParamContextJoin {
|
||||
private ParameterContextsJoin parameterContextsJoin;
|
||||
private String processGroupsId;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joingetcontroller.ControllerService12;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller
|
||||
* @Project:fw-nifi
|
||||
* @name:FindNeedModifyController
|
||||
* @Date:2025/5/22 11:03
|
||||
* @Filename:FindNeedModifyController
|
||||
*/
|
||||
@Data
|
||||
public class FindNeedModifyController {
|
||||
private String processGroupId;
|
||||
private List<ControllerService12> needModifyController;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||
* @Project:fw-nifi
|
||||
* @name:Component19
|
||||
* @Date:2025/5/22 10:28
|
||||
* @Filename:Component19
|
||||
*/
|
||||
@Data
|
||||
public class Component19 {
|
||||
private String id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String state;
|
||||
private String validationStatus;
|
||||
private String bulletinLevel;
|
||||
private String extensionMissing;
|
||||
private String comments;
|
||||
private Map<String, String> properties;
|
||||
private String persistsState;
|
||||
private String restricted;
|
||||
private String deprecated;
|
||||
private String multipleVersionsAvailable;
|
||||
private String supportsSensitiveDynamicProperties;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||
* @Project:fw-nifi
|
||||
* @name:ControllerServices19
|
||||
* @Date:2025/5/22 10:15
|
||||
* @Filename:ControllerServices19
|
||||
*/
|
||||
@Data
|
||||
public class ControllerServices19 {
|
||||
private String id;
|
||||
private String uri;
|
||||
private Component19 component;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author :liuyang
|
||||
* @Package :com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||
* @Project :fw-nifi
|
||||
* @name :GetAllController
|
||||
* @Date :2025/5/22 10:13
|
||||
* @Filename :GetAllController
|
||||
*/
|
||||
@Data
|
||||
public class GetAllController19 {
|
||||
private List<ControllerServices19> controllerServices;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||
* @Project:fw-nifi
|
||||
* @name:Component11
|
||||
* @Date:2025/5/16 13:59
|
||||
* @Filename:Component11
|
||||
*/
|
||||
@Data
|
||||
public class Component12 {
|
||||
private String id;//随机字符串
|
||||
private String name;
|
||||
private String type;
|
||||
private String state;
|
||||
//每个不同类型的控制器服务对应的属性都不一样,这里就很坑
|
||||
private Map<String, String> properties;
|
||||
private String validationStatus;
|
||||
private String bulletinLevel;
|
||||
private String extensionMissing;
|
||||
private String comments;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||
* @Project:fw-nifi
|
||||
* @name:ControllerSerbices
|
||||
* @Date:2025/5/16 13:57
|
||||
* @Filename:ControllerSerbices
|
||||
*/
|
||||
@Data
|
||||
public class ControllerService12 {
|
||||
//控制器服务id
|
||||
private String id;
|
||||
private Revision12 revision;
|
||||
private Component12 component;
|
||||
//修改标记id
|
||||
private String modifyMarkId;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
//package com.hzya.frame.nifi.model.joingetcontroller;
|
||||
//
|
||||
//import lombok.Data;
|
||||
//
|
||||
///**
|
||||
// * @Author:liuyang
|
||||
// * @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||
// * @Project:fw-nifi
|
||||
// * @name:Properties11
|
||||
// * @Date:2025/5/16 14:00
|
||||
// * @Filename:Properties11
|
||||
// */
|
||||
//@Data
|
||||
//public class Properties11 {
|
||||
// private String databaseConnectionUrl;
|
||||
// private String databaseDriverClassName;
|
||||
// private String databaseDriverLocations;
|
||||
// private String databaseUser;
|
||||
// private String password;
|
||||
// private String maxWaitTime;
|
||||
// private String maxTotalConnections;
|
||||
// private String validationQuery;
|
||||
// private String dbcpMinIdleConns;
|
||||
//}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||
* @Project:fw-nifi
|
||||
* @name:Revision11
|
||||
* @Date:2025/5/16 13:58
|
||||
* @Filename:Revision11
|
||||
*/
|
||||
@Data
|
||||
public class Revision12 {
|
||||
private String version;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-14 18:33:21
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Component3 {
|
||||
private String name;
|
||||
private List<Parameters2> parameters;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Parameter2 {
|
||||
private String name;
|
||||
private String value;
|
||||
private boolean sensitive;
|
||||
private String description;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ParameterContextsJoin {
|
||||
private Revision revision;
|
||||
private Component3 component;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Copyright 2025 bejson.com
|
||||
*/
|
||||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Parameters2 {
|
||||
private Parameter2 parameter;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Revision {
|
||||
private int version;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Component7 {
|
||||
private String name;
|
||||
private Position7 position;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joinprocessgroups
|
||||
* @Project:fw-nifi
|
||||
* @name:Position7
|
||||
* @Date:2025/5/21 14:57
|
||||
* @Filename:Position7
|
||||
*/
|
||||
@Data
|
||||
public class Position7 {
|
||||
private String x;
|
||||
private String y;
|
||||
|
||||
public Position7() {
|
||||
}
|
||||
|
||||
public Position7(String x, String y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinprocessgroups
|
||||
* @Project:fw-nifi
|
||||
* @name:ProcessGroupStatus
|
||||
* @Date:2025/5/15 10:43
|
||||
* @Filename:ProcessGroupStatus
|
||||
*/
|
||||
@Data
|
||||
public class ProcessGroupStatus {
|
||||
private String name;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinprocessgroups
|
||||
* @Project:fw-nifi
|
||||
* @name:ProcessGroupsJoin
|
||||
* @Date:2025/5/15 10:43
|
||||
* @Filename:ProcessGroupsJoin
|
||||
*/
|
||||
@Data
|
||||
public class ProcessGroupsJoin {
|
||||
private Revision5 revision;
|
||||
// private ProcessGroupStatus status;
|
||||
private Component7 component;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Revision5 {
|
||||
private int version;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.joinsnippetinstance;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinsnippetinstance
|
||||
* @Project:fw-nifi
|
||||
* @name:SnippetInstanceJoin
|
||||
* @Date:2025/5/17 14:21
|
||||
* @Filename:SnippetInstanceJoin
|
||||
*/
|
||||
@Data
|
||||
public class SnippetInstanceJoin {
|
||||
private String snippetId;
|
||||
private String originX;
|
||||
private String originY;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.joinsnippets;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinsnippets
|
||||
* @Project:fw-nifi
|
||||
* @name:Snippet
|
||||
* @Date:2025/5/17 11:01
|
||||
* @Filename:Snippet
|
||||
*/
|
||||
@Data
|
||||
public class Snippet {
|
||||
private String parentGroupId;
|
||||
private Map<String, Map<String, String>> processGroups;
|
||||
private Map<String, Map<String, String>> processors;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joinsnippets;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinsnippets
|
||||
* @Project:fw-nifi
|
||||
* @name:SnippetsJoin
|
||||
* @Date:2025/5/17 11:00
|
||||
* @Filename:SnippetsJoin
|
||||
*/
|
||||
@Data
|
||||
public class SnippetsJoin {
|
||||
private Snippet snippet;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Copyright 2025 bejson.com
|
||||
*/
|
||||
package com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 10:47:3
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Revision10 {
|
||||
private String version;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 10:47:3
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class StartOrStopProcessGroupsInfoJoin10 {
|
||||
private String id;
|
||||
private String state;
|
||||
private Revision10 revision;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.joinupdateprocessor;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinupdateprocessor
|
||||
* @Project:fw-nifi
|
||||
* @name:Revision17
|
||||
* @Date:2025/5/19 11:26
|
||||
* @Filename:Revision17
|
||||
*/
|
||||
@Data
|
||||
public class Revision17 {
|
||||
private String version;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.nifiapi.model.joinupdateprocessor;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinupdateprocessor
|
||||
* @Project:fw-nifi
|
||||
* @name:RunStatusOrStop
|
||||
* @Date:2025/5/19 11:25
|
||||
* @Filename:RunStatusOrStop
|
||||
*/
|
||||
@Data
|
||||
public class RunStatusOrStop17 {
|
||||
private String state;
|
||||
private Revision17 revision;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class NifiTemplates {
|
||||
private List<Templates> templates;
|
||||
private String generated;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Permissions {
|
||||
private String canRead;
|
||||
private String canWrite;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Template {
|
||||
private String uri;
|
||||
private String id;
|
||||
private String groupId;
|
||||
private String name;
|
||||
private String description;
|
||||
private String timestamp;
|
||||
@JsonProperty("encoding-version")
|
||||
private String encodingVersion;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Templates {
|
||||
private String id;
|
||||
private Permissions permissions;
|
||||
private Template template;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AggregateSnapshot {
|
||||
private String id;
|
||||
private String groupId;
|
||||
private String name;
|
||||
private String type;
|
||||
private String runStatus;
|
||||
private String executionNode;
|
||||
private String bytesRead;
|
||||
private String bytesWritten;
|
||||
private String read;
|
||||
private String written;
|
||||
private String flowFilesIn;
|
||||
private String bytesIn;
|
||||
private String input;
|
||||
private String flowFilesOut;
|
||||
private String bytesOut;
|
||||
private String output;
|
||||
private String taskCount;
|
||||
private String tasksDurationNanos;
|
||||
private String tasks;
|
||||
private String tasksDuration;
|
||||
private String activeThreadCount;
|
||||
private String terminatedThreadCount;
|
||||
private ProcessingPerformanceStatus processingPerformanceStatus;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AllowableValue {
|
||||
private String displayName;
|
||||
private String value;
|
||||
private String description;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AllowableValues {
|
||||
private AllowableValue allowableValue;
|
||||
private String canRead;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttributesToIgnore {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttributesToIgnoreRegex {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttributesToLog {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttributesToLogRegex {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Breadcrumb {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Breadcrumb2 {
|
||||
private String id;
|
||||
private Permissions2 permissions;
|
||||
private Breadcrumb3 breadcrumb;
|
||||
private ParentBreadcrumb2 parentBreadcrumb;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.processgroupid
|
||||
* @Project:fw-nifi
|
||||
* @name:Breadcrumb3
|
||||
* @Date:2025/5/14 17:57
|
||||
* @Filename:Breadcrumb3
|
||||
*/
|
||||
@Data
|
||||
public class Breadcrumb3 {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Bulletin {
|
||||
private String id;
|
||||
private String category;
|
||||
private String groupId;
|
||||
private String sourceId;
|
||||
private String sourceName;
|
||||
private String level;
|
||||
private String message;
|
||||
private String timestamp;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Bulletins {
|
||||
private String id;
|
||||
private String groupId;
|
||||
private String sourceId;
|
||||
private String timestamp;
|
||||
private String canRead;
|
||||
private Bulletin bulletin;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Bundle {
|
||||
private String group;
|
||||
private String artifact;
|
||||
private String version;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CharacterSet {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Component {
|
||||
private String id;
|
||||
private String name;
|
||||
private String comments;
|
||||
private String state;
|
||||
private String type;
|
||||
private String concurrentlySchedulableTaskCount;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Component2 {
|
||||
private String id;
|
||||
private String name;
|
||||
private String versionedComponentId;
|
||||
private String parentGroupId;
|
||||
private Position position;
|
||||
private String type;
|
||||
private Bundle bundle;
|
||||
private String state;
|
||||
private Object style;
|
||||
private List<Relationships> relationships;
|
||||
private String supportsParallelProcessing;
|
||||
private String supportsEventDriven;
|
||||
private String supportsBatching;
|
||||
private String supportsSensitiveDynamicProperties;
|
||||
private String persistsState;
|
||||
private String restricted;
|
||||
private String deprecated;
|
||||
private String executionNodeRestricted;
|
||||
private String multipleVersionsAvailable;
|
||||
private String inputRequirement;
|
||||
private String validationStatus;
|
||||
private String extensionMissing;
|
||||
private Config config;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Config {
|
||||
private Properties properties;
|
||||
private Descriptors descriptors;
|
||||
private String schedulingPeriod;
|
||||
private String schedulingStrategy;
|
||||
private String executionNode;
|
||||
private String penaltyDuration;
|
||||
private String yieldDuration;
|
||||
private String bulletinLevel;
|
||||
private String runDurationMillis;
|
||||
private String concurrentlySchedulableTaskCount;
|
||||
private String comments;
|
||||
private String lossTolerant;
|
||||
private DefaultConcurrentTasks defaultConcurrentTasks;
|
||||
private DefaultSchedulingPeriod defaultSchedulingPeriod;
|
||||
private String retryCount;
|
||||
private List<String> retriedRelationships;
|
||||
private String backoffMechanism;
|
||||
private String maxBackoffPeriod;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Connections {
|
||||
private Revision2 revision;
|
||||
private String id;
|
||||
private String uri;
|
||||
private Permissions permissions;
|
||||
private Component component;
|
||||
private Status status;
|
||||
// private List<String> bends;
|
||||
private String labelIndex;
|
||||
private String zIndex;
|
||||
private String sourceId;
|
||||
private String sourceGroupId;
|
||||
private String sourceType;
|
||||
private String destinationId;
|
||||
private String destinationGroupId;
|
||||
private String destinationType;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DefaultConcurrentTasks {
|
||||
@JsonProperty("TIMER_DRIVEN")
|
||||
private String tIMERDRIVEN;
|
||||
@JsonProperty("EVENT_DRIVEN")
|
||||
private String eVENTDRIVEN;
|
||||
@JsonProperty("CRON_DRIVEN")
|
||||
private String cRONDRIVEN;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DefaultSchedulingPeriod {
|
||||
@JsonProperty("TIMER_DRIVEN")
|
||||
private String tIMERDRIVEN;
|
||||
@JsonProperty("CRON_DRIVEN")
|
||||
private String cRONDRIVEN;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Descriptors {
|
||||
@JsonProperty("Log Level")
|
||||
private LogLevel logLevel;
|
||||
|
||||
@JsonProperty("Log Payload")
|
||||
private LogPayload logPayload;
|
||||
|
||||
@JsonProperty("Attributes to Log")
|
||||
private AttributesToLog attributesToLog;
|
||||
|
||||
@JsonProperty("attributes-to-log-regex")
|
||||
private AttributesToLogRegex attributesToLogRegex;
|
||||
|
||||
@JsonProperty("Attributes to Ignore")
|
||||
private AttributesToIgnore attributesToIgnore;
|
||||
|
||||
@JsonProperty("attributes-to-ignore-regex")
|
||||
private AttributesToIgnoreRegex attributesToIgnoreRegex;
|
||||
|
||||
@JsonProperty("Log FlowFile Properties")
|
||||
private LogFlowFileProperties logFlowFileProperties;
|
||||
|
||||
@JsonProperty("Output Format")
|
||||
private OutputFormat outputFormat;
|
||||
|
||||
@JsonProperty("Log prefix")
|
||||
private LogPrefix logprefix;
|
||||
|
||||
@JsonProperty("character-set")
|
||||
private CharacterSet characterSet;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Destination {
|
||||
private String id;
|
||||
private String versionedComponentId;
|
||||
private String type;
|
||||
private String groupId;
|
||||
private String name;
|
||||
private String running;
|
||||
private String comments;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Dimensions {
|
||||
private String width;
|
||||
private String height;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Flow {
|
||||
private List<String> processGroups;
|
||||
private List<String> remoteProcessGroups;
|
||||
private List<Processors> processors;
|
||||
private List<InputPorts> inputPorts;
|
||||
private List<OutputPorts> outputPorts;
|
||||
private List<Connections> connections;
|
||||
private List<Labels> labels;
|
||||
private List<String> funnels;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class InputPorts {
|
||||
private Revision2 revision;
|
||||
private String id;
|
||||
private String uri;
|
||||
private Position position;
|
||||
private Permissions permissions;
|
||||
private List<String> bulletins;
|
||||
private Component component;
|
||||
private Status status;
|
||||
private String portType;
|
||||
private OperatePermissions operatePermissions;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Labels {
|
||||
private Revision2 revision;
|
||||
private String id;
|
||||
private String uri;
|
||||
private Position position;
|
||||
private Permissions permissions;
|
||||
private Dimensions dimensions;
|
||||
private String zIndex;
|
||||
private Component component;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LogFlowFileProperties {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private List<AllowableValues> allowableValues;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LogLevel {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private List<AllowableValues> allowableValues;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LogPayload {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private List<AllowableValues> allowableValues;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LogPrefix {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OperatePermissions {
|
||||
private String canRead;
|
||||
private String canWrite;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OutputFormat {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private List<AllowableValues> allowableValues;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OutputPorts {
|
||||
private Revision2 revision;
|
||||
private String id;
|
||||
private String uri;
|
||||
private Position position;
|
||||
private Permissions permissions;
|
||||
private List<String> bulletins;
|
||||
private Component component;
|
||||
private Status status;
|
||||
private String portType;
|
||||
private OperatePermissions operatePermissions;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ParameterContext {
|
||||
private String id;
|
||||
private Permissions permissions;
|
||||
private Component component;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ParentBreadcrumb {
|
||||
private String id;
|
||||
private Permissions permissions;
|
||||
private Breadcrumb breadcrumb;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.processgroupid
|
||||
* @Project:fw-nifi
|
||||
* @name:ParentBreadcrumb2
|
||||
* @Date:2025/5/14 17:58
|
||||
* @Filename:ParentBreadcrumb2
|
||||
*/
|
||||
@Data
|
||||
public class ParentBreadcrumb2 {
|
||||
private String id;
|
||||
private Permissions2 permissions;
|
||||
private Breadcrumb3 breadcrumb;
|
||||
private ParentBreadcrumb2 parentBreadcrumb;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Permissions {
|
||||
private String canRead;
|
||||
private String canWrite;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.processgroupid
|
||||
* @Project:fw-nifi
|
||||
* @name:Permissions2
|
||||
* @Date:2025/5/14 17:57
|
||||
* @Filename:Permissions2
|
||||
*/
|
||||
@Data
|
||||
public class Permissions2 {
|
||||
private String canRead;
|
||||
private String canWrite;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Position {
|
||||
private String x;
|
||||
private String y;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue