Skip to content

Commit

Permalink
feat: add MtConnectClientConfiguration (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
goflutterjava authored Sep 14, 2024
1 parent 4be1fbb commit 73c8f73
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 21 deletions.
8 changes: 8 additions & 0 deletions mtconnect-client-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,12 @@

<artifactId>mtconnect-client-api</artifactId>

<dependencies>
<dependency>
<groupId>io.github.shoothzj</groupId>
<artifactId>http-client-facade</artifactId>
<version>${http-client-facade.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.github.protocol.mtconnect.client.api;

import io.github.shoothzj.http.client.facade.HttpClientConfig;
import lombok.Setter;

@Setter
public class MtConnectClientConfiguration {
private String host;

private int port;

private HttpClientConfig httpConfig;

public MtConnectClientConfiguration() {
}

public String host() {
return host;
}

public int port() {
return port;
}

public HttpClientConfig httpConfig() {
return httpConfig;
}
}
13 changes: 4 additions & 9 deletions mtconnect-client-vertx/pom.xml → mtconnect-client-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>mtconnect-client-vertx</artifactId>
<artifactId>mtconnect-client-impl</artifactId>

<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web-client</artifactId>
<version>${vertx.version}</version>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>mtconnect-client-api</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.github.protocol.mtconnect.client.vertx;

import io.github.protocol.mtconnect.client.api.MtConnectClientConfiguration;
import io.github.shoothzj.http.client.facade.HttpClient;
import io.github.shoothzj.http.client.facade.HttpClientFactory;

public class MtConnectClient {
private final MtConnectClientConfiguration config;

private final HttpClient httpClient;

public MtConnectClient(MtConnectClientConfiguration configuration) {
this.config = configuration;
this.httpClient = HttpClientFactory.createHttpClient(configuration.httpConfig());
}
}

This file was deleted.

3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<modules>
<module>mtconnect-client-api</module>
<module>mtconnect-client-impl</module>
<module>mtconnect-client-reactive</module>
<module>mtconnect-client-vertx</module>
<module>mtconnect-server-api</module>
<module>mtconnect-server-reactive</module>
<module>mtconnect-server-vertx</module>
Expand All @@ -24,6 +24,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<src.dir>src/main/java</src.dir>
<!-- dependency -->
<http-client-facade.version>0.0.1</http-client-facade.version>
<junit.version>5.11.0</junit.version>
<log4j.version>2.20.0</log4j.version>
<lombok.version>1.18.34</lombok.version>
Expand Down

0 comments on commit 73c8f73

Please sign in to comment.