Skip to content

Commit

Permalink
Merge pull request #711 from catenax-ng/feat/214-Dataspace-Discovery-…
Browse files Browse the repository at this point in the history
…Service-handle-multiple-EDC-Urls-received-for-BPN

Feat/214 dataspace discovery service handle multiple edc urls received for bpn
  • Loading branch information
dsmf authored Feb 2, 2024
2 parents 2be68b5 + b635caf commit b81fc36
Show file tree
Hide file tree
Showing 27 changed files with 1,439 additions and 486 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added Integration Tests for the entire IRS flow using stubbed responses of Discovery Service, Semantic Hub, EDC, Digital Twin Registry and BPDM Pool

### Changed

- Dataspace Discovery Service handles multiple EDC-Urls received for BPN now
- Updated license header to "Copyright (c) 2021,2024 Contributors to the Eclipse Foundation"
- Changed lookupGlobalAssetIds to lookupShellsByBPN, which provides full object.
- Suppressed CVE-2024-20932 from graal-sdk-21.2.0.jar because this is not applicable for IRS.
Expand Down
1 change: 0 additions & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ maven/mavencentral/net.minidev/accessors-smart/2.4.9, Apache-2.0, approved, #751
maven/mavencentral/net.minidev/json-smart/2.4.10, Apache-2.0, approved, #3288
maven/mavencentral/net.minidev/json-smart/2.4.11, Apache-2.0, approved, #3288
maven/mavencentral/net.sf.saxon/Saxon-HE/10.6, MPL-2.0 AND W3C, approved, #7945
maven/mavencentral/org.apache.commons/commons-compress/1.23.0, Apache-2.0 AND BSD-3-Clause, approved, #7506
maven/mavencentral/org.apache.commons/commons-compress/1.24.0, Apache-2.0 AND BSD-3-Clause AND bzip2-1.0.6 AND LicenseRef-Public-Domain, approved, #10368
maven/mavencentral/org.apache.commons/commons-lang3/3.12.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.commons/commons-pool2/2.11.1, Apache-2.0, approved, CQ23795
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@startuml
participant IRS
participant DiscoveryService
participant "EDC Provider" as EDCProvider
participant "DTR 1" as DTR1
participant "DTR 2" as DTR2

IRS ->> DiscoveryService: Get EDCs for BPN
DiscoveryService ->> IRS: Return list of 1 EDC
IRS ->> EDCProvider: Query for DTR contract offer
EDCProvider ->> IRS: 2 DTR contract offers

par
group Query DTR 1
IRS ->> EDCProvider: Negotiate contract
IRS ->> DTR1: Query for DT
DTR1 ->> IRS: no DT
end

else

group Query DTR 2
IRS ->> EDCProvider: Negotiate contract
IRS ->> DTR2: Query for DT
DTR2 ->> IRS: DT
end
end
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@startuml
actor IRS
participant DTR

IRS -> DTR: /query for globalAssetId
DTR -> IRS: return list of two results
IRS -> IRS: use first
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@startuml
participant IRS
participant DiscoveryService
participant "EDC Provider 1" as EDCProvider1
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

par
group CatalogRequestEDC1
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
IRS -> EDCProvider2: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: DT
end

else

group CatalogRequestEDC3
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
end
end
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@startuml
actor IRS
actor "Discovery Service" as DiscoveryService

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

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

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

else

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

else

group Catalog Request to EDC 3
IRS -> EDCProvider3: Query for DTR contract offer
EDCProvider3 -> IRS: No offer
end
end

IRS -> IRS: Tombstone
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@startuml
participant IRS
participant DiscoveryService
participant "EDC Provider 1" as EDCProvider1
participant "EDC Provider 2" as EDCProvider2
participant "EDC Provider 3" as EDCProvider3
participant DTR

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
end

else

group CatalogRequestEDC2
IRS ->> EDCProvider2: Query for DTR contract offer
EDCProvider2 ->> IRS: No offer
end

else

group CatalogRequestEDC3
IRS ->> EDCProvider3: Query for DTR contract offer
EDCProvider3 ->> IRS: DTR contract offer
IRS -> EDCProvider3: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: DT
end
end
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@startuml
participant IRS
participant DiscoveryService
participant "EDC Provider 3" as EDCProvider3
participant DTR

IRS ->> DiscoveryService: Get EDCs for BPN
DiscoveryService ->> IRS: Return list of 1 EDC
IRS ->> EDCProvider3: Query for DTR contract offer
EDCProvider3 ->> IRS: DTR contract offer
IRS -> EDCProvider3: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: DT
@enduml
67 changes: 67 additions & 0 deletions docs/src/docs/arc42/cross-cutting/discovery-process-dtr.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
The Dataspace Discovery Service handles multiple EDC-Urls received for BPN.
This applies to the following scenarios.

__Please note that the expression "the first result" in the subsequent sections means the first successful answer.__

==== Scenario 1: EDC with multiple DTRs

IRS queries all DTRs for the globalAssetId and will take the first result it gets.
If none of the DTRs return a result, IRS will create a tombstone.

[plantuml,target=discovery-DTR--EDC-with-multiple-DTRs,format=svg]
....
include::discovery-DTR--EDC-with-multiple-DTRs.puml[]
....

==== Scenario 2: Multiple EDCs with one DTR

IRS starts a contract negotiation for all registry contract offers in parallel and queries the DTRs for all successful negotiations.
The first registry which responds with a DT will be the one used by IRS.

[plantuml,target=discovery-DTR--multiple-EDCs-with-one-DTR,format=svg]
....
include::discovery-DTR--multiple-EDCs-with-one-DTR.puml[]
....

==== Scenario 3: One EDC with one DTR

Only one EDC found for BPN and the catalog only contains one offer for the DTR.
IRS will use this registry and will create a tombstone if no DT could be found for the globalAssetId.

[plantuml,target=discovery-DTR--one-EDC-with-one-DTR,format=svg]
....
include::discovery-DTR--one-EDC-with-one-DTR.puml[]
....

==== Scenario 4: Multiple EDCs with multiple DTRs

IRS starts a contract negotiation for all the registry offers.

[plantuml,target=discovery-DTR--multiple-EDCs-with-multiple-DTRs,format=svg]
....
include::discovery-DTR--multiple-EDCs-with-multiple-DTRs.puml[]
....

==== Scenario 5: Multiple EDCs with no DTRs

IRS starts a contract negotiation for all the registry offers and creates a tombstone since no DTR could be discovered.

[plantuml,target=discovery-DTR--multiple-EDCs-with-no-DTRs,format=svg]
....
include::discovery-DTR--multiple-EDCs-with-no-DTRs.puml[]
....

==== Special Scenario: Same DT in multiple DTRs

IRS will use all registries to query for the globalAssetId and takes the first result which is returned.
If no DT could be found in any of the DTRs, IRS will create a tombstone.

==== Special Scenario: Multiple DTs (with the same globalAssetId) in one DTR

IRS uses the `/query` endpoint of the DTR to get the DT id based on the globalAssetId.
If more than one id is present for a globalAssetId, IRS will use the first of the list.

[plantuml,target=discovery-DTR--multiple-DTs-with-the-same-globalAssedId-in-one-DTR,format=svg]
....
include::discovery-DTR--multiple-DTs-with-the-same-globalAssedId-in-one-DTR.puml[]
....
Loading

0 comments on commit b81fc36

Please sign in to comment.