Skip to content

Commit

Permalink
Merge pull request #462 from catenax-ng/feat/395-EDC-client-handle-mu…
Browse files Browse the repository at this point in the history
…ltiple-DTRs-and-DTs

Feat/395 edc client handle multiple dt rs and d ts
  • Loading branch information
ds-jhartmann authored Mar 4, 2024
2 parents a810fe6 + bf8263b commit 09c75b1
Show file tree
Hide file tree
Showing 40 changed files with 1,012 additions and 389 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- POST /management/v2/contractagreements/request and GET /management/v2/contractagreements/{contractAgreementId}/negotiation to irs-edc-client lib

### Changed
- EDC client handles multiple Digital Twin Registries and Digital Twins now #395
- Change logo of irs
- Added 'businessPartnerNumber' field to Tombstone model. This will be filled only when UsagePolicyValidation tombstone is being created.

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@startuml
actor IRS
participant IRS
participant DTR

IRS -> DTR: /query for globalAssetId
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
@startuml


box IRS
participant DecentralDigitalTwinRegistryService as DTRS
participant EdcSubmodelClientImpl as EdcClient
end box


participant DiscoveryService
participant "EDC Provider 1" as EDCProvider1
participant "EDC Provider 2" as EDCProvider2
participant "EDC Provider 3" as EDCProvider3
participant "DTR1" as DTR1
participant "DTR2" as DTR2

' DigitalTwinDelegate.process
' DecentralDigitalTwinRegistryService.fetchShells
' ConnectorEndpointsService.fetchConnectorEndpoints(String bpn) -- cacheable
DTRS -> DiscoveryService: Get EDCs for BPN
' discoveryFinderClient.findDiscoveryEndpoints(DiscoveryFinderRequest request)
DiscoveryService -> DTRS: Return list of 3 EDCs

' Turned into futures to get the EDR tokens by
' EndpointDataForConnectorsService.createFindEndpointDataForConnectorsFutures(List<String> edcUrls)

par
group CatalogRequestEDC1

== EDC Control Plane ==
DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider1: Query for DTR1 contract offer
EDCProvider1 -> EdcClient: No offer
EdcClient -> DTRS: No token
end

else

group CatalogRequestEDC2 DTR1

== EDC Control Plane ==

' this happens in DecentralDigitalTwinRegistryService.fetchShellDescriptorsForConnectorEndpoints
' when each of List<CompletableFuture<EndpointDataReference>> is composed
' with fetchShellDescriptorsForKey
DTRS -> EdcClient: Get EDR Token for asset
' EdcSubmodelFacade.getEndpointReferenceForAsset
' EdcSubmodelClientImpl.getEndpointReferenceForAsset
EdcClient -> EDCProvider2: Query for DTR1 contract offer
EDCProvider2 -> EdcClient: DTR1 contract offer
' EdcSubmodelClientImpl.negotiateContract
EdcClient -> EDCProvider2: Negotiate contract
EDCProvider2 -> EdcClient: EDR Token callback

EdcClient -> DTRS: EDR token


== EDC Data Plane ==

' DecentralDigitalTwinRegistryService
' .fetchShellDescriptor(EndpointDataReference, DigitalTwinRegistryKey)
DTRS -> DTR1: Query for DT
DTR1 -> DTRS: DT
' result is AssetAdministrationShellDescriptor which is the actual data
end

else

group CatalogRequestEDC2 DTR2

== EDC Control Plane ==

DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider2: Query for DTR1 contract offer
EDCProvider2 -> EdcClient: DTR1 contract offer
EdcClient -> EDCProvider2: Negotiate contract
EDCProvider2 -> EdcClient: EDR Token callback

EdcClient -> DTRS: EDR token


== EDC Data Plane ==

DTRS -> DTR2: Query for DT
DTR2 -> DTRS: DT
end

else

group CatalogRequestEDC3

== EDC Control Plane ==

DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider3: Query for DTR1 contract offer
EDCProvider3 -> EdcClient: DTR1 contract offer
EdcClient -> EDCProvider3: Negotiate contract
EDCProvider3 -> EdcClient: EDR Token callback
EdcClient -> DTRS: EDR token

== EDC Data Plane ==

DTRS -> DTR1: Query for DT
DTR1 -> DTRS: No DT
end
end

@enduml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,40 @@ participant "EDC Provider 2" as EDCProvider2
participant "EDC Provider 3" as EDCProvider3
participant "DTR" as DTR

IRS ->> DiscoveryService: Get EDCs for BPN
DiscoveryService ->> IRS: Return list of 3 EDCs
IRS -> DiscoveryService: Get EDCs for BPN
DiscoveryService -> IRS: Return list of 3 EDCs

par
group CatalogRequestEDC1
IRS ->> EDCProvider1: Query for DTR contract offer
EDCProvider1 ->> IRS: No offer
' == EDC Control Plane ==
IRS -> EDCProvider1: Query for DTR contract offer
EDCProvider1 -> IRS: No offer
end

else

group CatalogRequestEDC2
IRS ->> EDCProvider2: Query for DTR contract offer
EDCProvider2 ->> IRS: DTR contract offer
' == EDC Control Plane ==
IRS -> EDCProvider2: Query for DTR contract offer
EDCProvider2 -> IRS: DTR contract offer
IRS -> EDCProvider2: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: DT

'== EDC Data Plane ==
IRS -> DTR: Query for DT
DTR -> IRS: DT
end

else

group CatalogRequestEDC3
IRS ->> EDCProvider3: Query for DTR contract offer
EDCProvider3 ->> IRS: DTR contract offer
'== EDC Control Plane ==
IRS -> EDCProvider3: Query for DTR contract offer
EDCProvider3 -> IRS: DTR contract offer
IRS -> EDCProvider3: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: No DT

'== EDC Data Plane ==
IRS -> DTR: Query for DT
DTR -> IRS: No DT
end
end
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@startuml

box IRS
participant DecentralDigitalTwinRegistryService as DTRS
participant EdcSubmodelClientImpl as EdcClient
end box

participant "Discovery Service" as DiscoveryService

participant "EDC 1" as EDCProvider1
participant "EDC 2" as EDCProvider2
participant "EDC 3" as EDCProvider3


' ConnectorEndpointsService.fetchConnectorEndpoints(String bpn) -- cacheable
DTRS -> DiscoveryService: Get EDCs for BPN
' discoveryFinderClient.findDiscoveryEndpoints(DiscoveryFinderRequest request)
DiscoveryService -> DTRS: Return list of 3 EDCs

par
group Catalog Request to EDC 1

== EDC Control Plane ==

DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider1: Query for DTR contract offer
EDCProvider1 -> EdcClient: No offer
EdcClient -> DTRS: No token
end

else

group Catalog Request to EDC 2

== EDC Control Plane ==

DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider2: Query for DTR contract offer
EDCProvider2 -> EdcClient: No offer
EdcClient -> DTRS: No token
end

else

group Catalog Request to EDC 3

== EDC Control Plane ==

DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider3: Query for DTR contract offer
EDCProvider3 -> EdcClient: No offer
EdcClient -> DTRS: No token
end
end

DTRS -> DTRS: Tombstone

@enduml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@startuml
actor IRS
actor "Discovery Service" as DiscoveryService
participant IRS
participant "Discovery Service" as DiscoveryService

participant "EDC 1" as EDCProvider1
participant "EDC 2" as EDCProvider2
Expand All @@ -11,20 +11,23 @@ DiscoveryService -> IRS: Return list of 3 EDCs

par
group Catalog Request to EDC 1
'== EDC Control Plane ==
IRS -> EDCProvider1: Query for DTR contract offer
EDCProvider1 -> IRS: No offer
end

else

group Catalog Request to EDC 2
'== EDC Control Plane ==
IRS -> EDCProvider2: Query for DTR contract offer
EDCProvider2 -> IRS: No offer
end

else

group Catalog Request to EDC 3
'== EDC Control Plane ==
IRS -> EDCProvider3: Query for DTR contract offer
EDCProvider3 -> IRS: No offer
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@startuml

box IRS
participant DecentralDigitalTwinRegistryService as DTRS
participant EdcSubmodelClientImpl as EdcClient
end box

participant DiscoveryService
participant "EDC Provider 1" as EDCProvider1
participant "EDC Provider 2" as EDCProvider2
participant "EDC Provider 3" as EDCProvider3
participant DTR

' ConnectorEndpointsService.fetchConnectorEndpoints(String bpn) -- cacheable
DTRS -> DiscoveryService: Get EDCs for BPN
' discoveryFinderClient.findDiscoveryEndpoints(DiscoveryFinderRequest request)
DiscoveryService -> DTRS: Return list of 3 EDCs

par
group CatalogRequestEDC1

== EDC Control Plane ==

DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider1: Query for DTR contract offer
EDCProvider1 -> EdcClient: No offer
EdcClient -> DTRS: No token
end

else

group CatalogRequestEDC2

== EDC Control Plane ==

DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider2: Query for DTR contract offer
EDCProvider2 -> EdcClient: No offer
EdcClient -> DTRS: No token
end

else

group CatalogRequestEDC3

== EDC Control Plane ==

DTRS -> EdcClient: Get EDR Token for asset
EdcClient -> EDCProvider3: Query for DTR contract offer
EDCProvider3 -> EdcClient: DTR contract offer
EdcClient -> EDCProvider3: Negotiate contract
EDCProvider3 -> EdcClient: EDR Token callback
EdcClient -> DTRS: EDR token

== EDC Data Plane ==

DTRS -> DTR: Query for DT
DTR -> DTRS: DT
end
end
@enduml
Loading

0 comments on commit 09c75b1

Please sign in to comment.