Skip to content

Commit 8a479c3

Browse files
committed
~ formatting
1 parent 4c6fb49 commit 8a479c3

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed
Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
/*
2+
* Copyright (c) 2024 the Eclipse Milo Authors
3+
*
4+
* This program and the accompanying materials are made
5+
* available under the terms of the Eclipse Public License 2.0
6+
* which is available at https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*/
10+
111
package org.eclipse.milo.examples.client;
212

313
import java.util.concurrent.CompletableFuture;
4-
514
import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
615
import org.eclipse.milo.opcua.stack.core.security.SecurityPolicy;
716
import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
@@ -15,40 +24,40 @@
1524

1625
public class IJTReadCustomDataTypeExample implements ClientExample {
1726

18-
public static void main(String[] args) throws Exception {
19-
var example = new IJTReadCustomDataTypeExample();
20-
21-
new ClientExampleRunner(example, false).run();
22-
}
27+
public static void main(String[] args) throws Exception {
28+
var example = new IJTReadCustomDataTypeExample();
2329

24-
private final Logger logger = LoggerFactory.getLogger(getClass());
30+
new ClientExampleRunner(example, false).run();
31+
}
2532

26-
@Override
27-
public void run(OpcUaClient client, CompletableFuture<OpcUaClient> future) throws Exception {
28-
client.setDataTypeManagerInitializer(new OpcUaClient.DefaultDataTypeManagerInitializer(JsonCodecFactory::create));
33+
private final Logger logger = LoggerFactory.getLogger(getClass());
2934

30-
client.connect();
35+
@Override
36+
public void run(OpcUaClient client, CompletableFuture<OpcUaClient> future) throws Exception {
37+
client.setDataTypeManagerInitializer(
38+
new OpcUaClient.DefaultDataTypeManagerInitializer(JsonCodecFactory::create));
3139

32-
NodeId nodeId = NodeId.parse("ns=1;s=TighteningSystem/ResultManagement/Results/Result");
33-
DataValue value = client.readValue(0, TimestampsToReturn.Both, nodeId);
40+
client.connect();
3441

35-
if (value.getValue().getValue() instanceof ExtensionObject xo) {
36-
JsonStruct struct = (JsonStruct) xo.decode(client.getDynamicEncodingContext());
42+
NodeId nodeId = NodeId.parse("ns=1;s=TighteningSystem/ResultManagement/Results/Result");
43+
DataValue value = client.readValue(0, TimestampsToReturn.Both, nodeId);
3744

38-
System.out.println(struct);
39-
}
45+
if (value.getValue().getValue() instanceof ExtensionObject xo) {
46+
JsonStruct struct = (JsonStruct) xo.decode(client.getDynamicEncodingContext());
4047

41-
future.complete(client);
48+
System.out.println(struct);
4249
}
4350

44-
@Override
45-
public String getEndpointUrl() {
46-
return "opc.tcp://10.211.55.3:40451";
47-
}
51+
future.complete(client);
52+
}
4853

49-
@Override
50-
public SecurityPolicy getSecurityPolicy() {
51-
return SecurityPolicy.None;
52-
}
54+
@Override
55+
public String getEndpointUrl() {
56+
return "opc.tcp://10.211.55.3:40451";
57+
}
5358

59+
@Override
60+
public SecurityPolicy getSecurityPolicy() {
61+
return SecurityPolicy.None;
62+
}
5463
}

0 commit comments

Comments
 (0)