提交 7e7fa155 authored 作者: 宋勇's avatar 宋勇

kepserver

上级 3a0f3340
...@@ -35,8 +35,8 @@ public class KepServerOptionRule { ...@@ -35,8 +35,8 @@ public class KepServerOptionRule {
public static final Option<Integer> NS = public static final Option<Integer> NS =
Options.key("ns").intType().noDefaultValue().withDescription("ns"); Options.key("ns").intType().noDefaultValue().withDescription("ns");
public static final Option<String> ID = public static final Option<String> IDENTIFIER =
Options.key("id").stringType().noDefaultValue().withDescription("id"); Options.key("identifier").stringType().noDefaultValue().withDescription("identifier");
public static final Option<String> TYPE = public static final Option<String> TYPE =
Options.key("type").stringType().defaultValue("int").withDescription("type"); Options.key("type").stringType().defaultValue("int").withDescription("type");
...@@ -45,10 +45,10 @@ public class KepServerOptionRule { ...@@ -45,10 +45,10 @@ public class KepServerOptionRule {
Options.key("gs").intType().defaultValue(1).withDescription("type"); Options.key("gs").intType().defaultValue(1).withDescription("type");
public static OptionRule optionRule() { public static OptionRule optionRule() {
return OptionRule.builder().required(HOST, PORT, NS, ID).optional(GS).build(); return OptionRule.builder().required(HOST, PORT, NS, IDENTIFIER).optional(GS).build();
} }
public static OptionRule metadataRule() { public static OptionRule metadataRule() {
return OptionRule.builder().required(NS, ID).build(); return OptionRule.builder().required(NS, IDENTIFIER).build();
} }
} }
...@@ -12,7 +12,6 @@ package org.apache.seatunnel.datasource.plugin.kepserver; ...@@ -12,7 +12,6 @@ package org.apache.seatunnel.datasource.plugin.kepserver;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.K;
import org.eclipse.milo.opcua.sdk.client.OpcUaClient; import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
import org.eclipse.milo.opcua.sdk.client.nodes.UaNode; import org.eclipse.milo.opcua.sdk.client.nodes.UaNode;
import org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode; import org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode;
...@@ -42,7 +41,7 @@ public class ReadKepServer implements KepServerClient { ...@@ -42,7 +41,7 @@ public class ReadKepServer implements KepServerClient {
map.put(KepServerOptionRule.HOST.key(),"127.0.0.1"); map.put(KepServerOptionRule.HOST.key(),"127.0.0.1");
map.put(KepServerOptionRule.PORT.key(),"49320"); map.put(KepServerOptionRule.PORT.key(),"49320");
map.put(KepServerOptionRule.NS.key(),"2"); map.put(KepServerOptionRule.NS.key(),"2");
map.put(KepServerOptionRule.ID.key(),"cs.设备.top2"); map.put(KepServerOptionRule.IDENTIFIER.key(),"cs.设备.top2");
ReadKepServer example = new ReadKepServer(map); ReadKepServer example = new ReadKepServer(map);
example.endpointUrl="opc.tcp://127.0.0.1:49320"; example.endpointUrl="opc.tcp://127.0.0.1:49320";
new KepServerClientRunner(example, true).run(); new KepServerClientRunner(example, true).run();
...@@ -62,7 +61,7 @@ public class ReadKepServer implements KepServerClient { ...@@ -62,7 +61,7 @@ public class ReadKepServer implements KepServerClient {
} }
} }
this.identifier=requestParams.get(KepServerOptionRule.ID.key()); this.identifier=requestParams.get(KepServerOptionRule.IDENTIFIER.key());
} }
private final Logger logger = LoggerFactory.getLogger(getClass()); private final Logger logger = LoggerFactory.getLogger(getClass());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论