-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Spring Dependency from BaSyxClient Example (#494)
* wip: Remove spring dependency from ClientExample * Refactor container infra to support the changes in POM * Extract DirectoryWatcher build process to own factory * docs: Update examples README
- Loading branch information
1 parent
1d82ac6
commit 25b9333
Showing
13 changed files
with
92 additions
and
111 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
FROM maven:3.8.1-openjdk-17 AS build | ||
WORKDIR /app | ||
COPY pom.xml . | ||
RUN mvn dependency:go-offline | ||
COPY src src | ||
RUN mvn clean package -DskipTests | ||
|
||
FROM openjdk:17 | ||
WORKDIR /app | ||
COPY --from=build /app/target/*.jar app.jar | ||
EXPOSE 8080 | ||
COPY --from=build /app/target/*-jar-with-dependencies.jar app.jar | ||
ENTRYPOINT ["java", "-jar", "app.jar"] |
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
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
45 changes: 45 additions & 0 deletions
45
...main/java/org/eclipse/digitaltwin/basyx/examples/basyxclient/DirectoryWatcherFactory.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,45 @@ | ||
package org.eclipse.digitaltwin.basyx.examples.basyxclient; | ||
|
||
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
import org.eclipse.digitaltwin.basyx.aasenvironment.client.ConnectedAasManager; | ||
import org.eclipse.digitaltwin.basyx.examples.basyxclient.configuration.BasyxSettings; | ||
import org.eclipse.digitaltwin.basyx.examples.basyxclient.processing.BaSyxSyncService; | ||
import org.eclipse.digitaltwin.basyx.examples.basyxclient.processing.BaSyxWarehouseService; | ||
import org.eclipse.digitaltwin.basyx.examples.basyxclient.processing.DirectoryWatcher; | ||
import org.eclipse.digitaltwin.basyx.examples.basyxclient.processing.EntryProcessor; | ||
|
||
public final class DirectoryWatcherFactory { | ||
|
||
private DirectoryWatcherFactory() { | ||
} | ||
|
||
public static DirectoryWatcher build(Path pathToWatch) { | ||
BasyxSettings settings = buildBasyxSettingsFromEnv(); | ||
ConnectedAasManager connectedAasManager = buildConnectedAasManager(settings); | ||
List<EntryProcessor> entryProcessors = buildEntryProcessors(connectedAasManager); | ||
|
||
return new DirectoryWatcher(entryProcessors, pathToWatch); | ||
} | ||
|
||
static BasyxSettings buildBasyxSettingsFromEnv() { | ||
String aasRegistryBaseUrl = System.getenv("AAS_REGISTRY_BASE_URL"); | ||
String aasRepositoryBaseUrl = System.getenv("AAS_REPOSITORY_BASE_URL"); | ||
String submodelRegistryBaseUrl = System.getenv("SUBMODEL_REGISTRY_BASE_URL"); | ||
String submodelRepositoryBaseUrl = System.getenv("SUBMODEL_REPOSITORY_BASE_URL"); | ||
|
||
return new BasyxSettings(aasRepositoryBaseUrl, submodelRepositoryBaseUrl, aasRegistryBaseUrl, submodelRegistryBaseUrl); | ||
} | ||
|
||
static ConnectedAasManager buildConnectedAasManager(BasyxSettings settings) { | ||
return new ConnectedAasManager(settings.aasRegistryBaseUrl(), settings.aasRepositoryBaseUrl(), settings.submodelRegistryBaseUrl(), settings.submodelRepositoryBaseUrl()); | ||
} | ||
|
||
static List<EntryProcessor> buildEntryProcessors(ConnectedAasManager connectedAasManager) { | ||
BaSyxSyncService syncService = new BaSyxSyncService(connectedAasManager); | ||
BaSyxWarehouseService warehouseService = new BaSyxWarehouseService(connectedAasManager); | ||
|
||
return List.of(syncService, warehouseService); | ||
} | ||
} |
40 changes: 0 additions & 40 deletions
40
.../org/eclipse/digitaltwin/basyx/examples/basyxclient/configuration/BasyxConfiguration.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
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
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
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
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,4 @@ | ||
AAS_REGISTRY_BASE_URL=http://localhost:8082 | ||
SUBMODEL_REGISTRY_BASE_URL=http://localhost:8083 | ||
AAS_REPOSITORY_BASE_URL=http://localhost:8081 | ||
SUBMODEL_REPOSITORY_BASE_URL=http://localhost:8081 |
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
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