-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add MtConnectClientConfiguration (#2)
- Loading branch information
1 parent
4be1fbb
commit 73c8f73
Showing
6 changed files
with
58 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...i/src/main/java/io/github/protocol/mtconnect/client/api/MtConnectClientConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...-client-impl/src/main/java/io/github/protocol/mtconnect/client/vertx/MtConnectClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
...client-vertx/src/main/java/io/github/protocol/mtconnect/client/vertx/MtConnectClient.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters