Skip to content

Commit

Permalink
Implement missing Client methods for SubmodelRepository/Service and A…
Browse files Browse the repository at this point in the history
…asRepository/Service (eclipse-basyx#256)

* Move FileRepository interface/implementations to Common

* Add file handling methods to SubmodelService API

* Move file related tests from RepositorySuite to ServiceSuite

* Refactor SubmodelRepo to use file handling logic from Service

* Fix name typo in MongoDBFileRepository

* Implement /attachment endpoints to the SubmodelServiceHttpController

* Modify injection method of FileRepository in SubmodelServiceFactory

* Implement methods for handling thumbnails in the AasService

* Move thumbnail rel. tests from AasRepository to AasServiceSuite

* Refactor CrudAasRepository to use AasService for thumbnail handling

* Override failing tests in AasServiceClient (TBD in another ticket)

* Remove FileRepository config beans from AasRepository

* Fix inconsistent FileRepository in
MongoDBSubmodelRepositoryConfiguration

* Fix pagination issues in Client for [Aas, Sm][Service, Repository]

* Refactor client pagination deser. to use Base64UrlEncodedCursorResult

* Implement thumbnail handling in ConnectedAasService/Repository

* Implement file handling in ConnectSubmodelService/Repository

* Implement Operation invokation in SmClient

* Document current test limitation @ TestConnectedSubmodelRepository

* Refactor thumbnail filename to be unique

* Address review remarks
  • Loading branch information
mateusmolina-iese authored May 3, 2024
1 parent e5b4219 commit d3f81b4
Show file tree
Hide file tree
Showing 18 changed files with 962 additions and 1,102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@
import org.eclipse.digitaltwin.basyx.client.internal.ApiException;
import org.eclipse.digitaltwin.basyx.core.exceptions.CollidingIdentifierException;
import org.eclipse.digitaltwin.basyx.core.exceptions.ElementDoesNotExistException;
import org.eclipse.digitaltwin.basyx.core.exceptions.FeatureNotImplementedException;
import org.eclipse.digitaltwin.basyx.core.exceptions.IdentificationMismatchException;
import org.eclipse.digitaltwin.basyx.core.exceptions.MissingIdentifierException;
import org.eclipse.digitaltwin.basyx.core.pagination.CursorResult;
import org.eclipse.digitaltwin.basyx.core.pagination.PaginationInfo;
import org.eclipse.digitaltwin.basyx.http.Base64UrlEncodedIdentifier;
import org.eclipse.digitaltwin.basyx.http.Base64UrlEncoder;
import org.springframework.http.HttpStatus;

/**
* Provides access to an Aas Repository on a remote server
*
* @author schnicke
* @author schnicke, mateusmolina
*/
public class ConnectedAasRepository implements AasRepository {

Expand All @@ -67,12 +67,10 @@ public ConnectedAasRepository(String repoUrl) {
this.repoApi = new AssetAdministrationShellRepositoryApi(repoUrl);
}

/**
* Not implemented
*/
@Override
public CursorResult<List<AssetAdministrationShell>> getAllAas(PaginationInfo pInfo) {
throw new FeatureNotImplementedException();
String encodedCursor = pInfo.getCursor() == null ? null : Base64UrlEncoder.encode(pInfo.getCursor());
return repoApi.getAllAssetAdministrationShells(null, null, pInfo.getLimit(), encodedCursor);
}

@Override
Expand Down Expand Up @@ -152,28 +150,19 @@ public AssetInformation getAssetInformation(String aasId) throws ElementDoesNotE
return getConnectedAasService(aasId).getAssetInformation();
}

/**
* Not implemented
*/
@Override
public File getThumbnail(String aasId) {
throw new FeatureNotImplementedException();
return getConnectedAasService(aasId).getThumbnail();
}

/**
* Not implemented
*/
@Override
public void setThumbnail(String aasId, String fileName, String contentType, InputStream inputStream) {
throw new FeatureNotImplementedException();
getConnectedAasService(aasId).setThumbnail(fileName, contentType, inputStream);
}

/**
* Not implemented
*/
@Override
public void deleteThumbnail(String aasId) {
throw new FeatureNotImplementedException();
getConnectedAasService(aasId).deleteThumbnail();
}

private String getAasUrl(String aasId) {
Expand Down
Loading

0 comments on commit d3f81b4

Please sign in to comment.