diff options
author | Dan Timoney <dtimoney@att.com> | 2023-08-11 16:37:41 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2023-08-11 16:37:41 -0400 |
commit | 0437a05104ffd36e6700f0321d54ed814d3c7618 (patch) | |
tree | 24727192efef107587bd587ae8bacba5777a386e /generic-resource-api/provider | |
parent | 6ca1c0a4516ce95b10653268f3601a9dd313fdf6 (diff) |
Updates for ODL Argon
Updated to use Montreal / ODL Argon version of parent poms, and updated
code to create containers to comply with separation of operational
and config update transactions imposed in Argon.
Issue-ID: SDNC-1816
Signed-off-by: Dan Timoney <dtimoney@att.com>
Change-Id: I65c40896e57b681fa8907eee5d84e8a20e490577
Diffstat (limited to 'generic-resource-api/provider')
-rw-r--r-- | generic-resource-api/provider/pom.xml | 2 | ||||
-rw-r--r-- | generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/generic-resource-api/provider/pom.xml b/generic-resource-api/provider/pom.xml index 57943610..01d67cd5 100644 --- a/generic-resource-api/provider/pom.xml +++ b/generic-resource-api/provider/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.5.4</version> + <version>2.6.0</version> <relativePath/> </parent> diff --git a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java index 7eb4f2b0..a8f1ee9c 100644 --- a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java +++ b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java @@ -226,23 +226,29 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC private void createContainers() { - final WriteTransaction t = dataBroker.newReadWriteTransaction(); + final WriteTransaction configT = dataBroker.newReadWriteTransaction(); + final WriteTransaction operT = dataBroker.newReadWriteTransaction(); + + // Create the service-instance container - t.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Services.class), + configT.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Services.class), new ServicesBuilder().build()); - t.merge(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Services.class), + operT.merge(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Services.class), new ServicesBuilder().build()); // Create the PreloadInformation container - t.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(PreloadInformation.class), + configT.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(PreloadInformation.class), new PreloadInformationBuilder().build()); - t.merge(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(PreloadInformation.class), + operT.merge(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(PreloadInformation.class), new PreloadInformationBuilder().build()); try { - FluentFuture<? extends @NonNull CommitInfo> checkedFuture = t.commit(); - checkedFuture.get(); + FluentFuture<? extends @NonNull CommitInfo> configCheckedFuture = configT.commit(); + configCheckedFuture.get(); + FluentFuture<? extends @NonNull CommitInfo> operCheckedFuture = operT.commit(); + operCheckedFuture.get(); + log.info("Create containers succeeded!"); } catch (InterruptedException | ExecutionException e) { |