File tree Expand file tree Collapse file tree 5 files changed +50
-1
lines changed
mtconnect-examples/src/main/java/io/github/protocol/mtconnect/examples
src/main/java/io/github/protocol/mtconnect/server/impl Expand file tree Collapse file tree 5 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1+ package io .github .protocol .mtconnect .examples ;
2+
3+ import io .github .openfacade .http .HttpServerConfig ;
4+ import io .github .openfacade .http .HttpServerEngine ;
5+ import io .github .protocol .mtconnect .server .MtConnectServer ;
6+ import io .github .protocol .mtconnect .server .MtConnectServerConfiguration ;
7+ import io .github .protocol .mtconnect .server .impl .IoTDAMtProcessor ;
8+
9+ public class MtConnectIoTDAServerExample {
10+ public static void main (String [] args ) {
11+ MtConnectServerConfiguration configuration = new MtConnectServerConfiguration ();
12+ HttpServerConfig httpServerConfig = new HttpServerConfig .Builder ()
13+ .engine (HttpServerEngine .Vertx )
14+ .host ("127.0.0.1" )
15+ .port (36633 )
16+ .build ();
17+ configuration .setHttpConfig (httpServerConfig );
18+ configuration .setMtProcessor (new IoTDAMtProcessor ("your_ak" , "your_sk" ));
19+ MtConnectServer mtConnectServer = new MtConnectServer (configuration );
20+ mtConnectServer .start ().join ();
21+ }
22+ }
Original file line number Diff line number Diff line change 66import io .github .protocol .mtconnect .server .MtConnectServerConfiguration ;
77import io .github .protocol .mtconnect .server .impl .MemoryMtProcessor ;
88
9- public class MtConnectServerExample {
9+ public class MtConnectMemoryServerExample {
1010 public static void main (String [] args ) {
1111 MtConnectServerConfiguration configuration = new MtConnectServerConfiguration ();
1212 HttpServerConfig httpServerConfig = new HttpServerConfig .Builder ()
Original file line number Diff line number Diff line change 1717 <artifactId >mtconnect-common</artifactId >
1818 <version >${project.version} </version >
1919 </dependency >
20+ <dependency >
21+ <groupId >com.huaweicloud.sdk</groupId >
22+ <artifactId >huaweicloud-sdk-iotda</artifactId >
23+ <version >${huaweicloud-sdk.version} </version >
24+ </dependency >
2025 <dependency >
2126 <groupId >io.github.openfacade</groupId >
2227 <artifactId >http-facade</artifactId >
Original file line number Diff line number Diff line change 1+ package io .github .protocol .mtconnect .server .impl ;
2+
3+ import io .github .protocol .mtconnect .api .AssetRequest ;
4+ import io .github .protocol .mtconnect .api .AssetResponse ;
5+ import io .github .protocol .mtconnect .server .MtProcessor ;
6+
7+ public class IoTDAMtProcessor implements MtProcessor {
8+ private final String ak ;
9+
10+ private final String sk ;
11+
12+ public IoTDAMtProcessor (String ak , String sk ) {
13+ this .ak = ak ;
14+ this .sk = sk ;
15+ }
16+
17+ @ Override
18+ public AssetResponse asset (AssetRequest assetRequest ) {
19+ return null ;
20+ }
21+ }
Original file line number Diff line number Diff line change 2424 <src .dir>src/main/java</src .dir>
2525 <!-- dependency -->
2626 <http-facade .version>0.2.0</http-facade .version>
27+ <huaweicloud-sdk .version>3.1.117</huaweicloud-sdk .version>
2728 <jackson .version>2.17.2</jackson .version>
2829 <junit .version>5.11.0</junit .version>
2930 <log4j .version>2.20.0</log4j .version>
You can’t perform that action at this time.
0 commit comments