Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-client/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasdiscoveryservice</artifactId>
<version>${revision}</version>
</parent>
<artifactId>basyx.aasdiscoveryservice-client</artifactId>
<name>BaSyx AAS Discovery Service Client</name>
<description>AAS Discovery Service Client enabling interaction with an AAS
Discovery Service</description>
<dependencies>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasdiscoveryservice-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasdiscoveryservice-core</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasdiscoveryservice-http</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasdiscoveryservice-backend-inmemory</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>aas4j-model</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.http</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.client</artifactId>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package org.eclipse.digitaltwin.basyx.aasdiscoveryservice.client;

import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.client.internal.AasDiscoveryServiceApi;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryService;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.model.AssetLink;
import org.eclipse.digitaltwin.basyx.core.pagination.CursorResult;
import org.eclipse.digitaltwin.basyx.core.pagination.PaginationInfo;

import java.util.List;

public class ConnectedAasDiscoveryService implements AasDiscoveryService {

private final AasDiscoveryServiceApi aasDiscoveryServiceApi;

public ConnectedAasDiscoveryService(AasDiscoveryServiceApi aasDiscoveryServiceApi) {
this.aasDiscoveryServiceApi = aasDiscoveryServiceApi;
}

@Override
public CursorResult<List<String>> getAllAssetAdministrationShellIdsByAssetLink(PaginationInfo pInfo, List<AssetLink> assetIds) {
List<String> assetsId = convertToString(assetIds);
Integer limit = pInfo.getLimit();
String cursor = pInfo.getCursor();
return aasDiscoveryServiceApi.getAllAssetAdministrationShellIdsByAssetLink(assetsId, limit, cursor);
}

private static List<String> convertToString(List<AssetLink> assetIds) {
return assetIds.stream().map(AssetLink::toString).toList();
}


@Override
public List<SpecificAssetId> getAllAssetLinksById(String shellIdentifier) {
return aasDiscoveryServiceApi.getAllAssetLinksById(shellIdentifier);
}

@Override
public List<SpecificAssetId> createAllAssetLinksById(String shellIdentifier, List<SpecificAssetId> assetIds) {
return aasDiscoveryServiceApi.postAllAssetLinksById(shellIdentifier,assetIds);
}

@Override
public void deleteAllAssetLinksById(String shellIdentifier) {
aasDiscoveryServiceApi.deleteAllAssetLinksById(shellIdentifier);

}
}
Loading