X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdnc%2Fnorthbound.git;a=blobdiff_plain;f=generic-resource-api%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fsdnc%2Fnorthbound%2FGenericResourceApiProvider.java;fp=generic-resource-api%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fsdnc%2Fnorthbound%2FGenericResourceApiProvider.java;h=a8f1ee9c35a0a447d790c552398d56e4e9b592e1;hp=7eb4f2b0197425cbe74c6db8d40369e24e90dac2;hb=0437a05104ffd36e6700f0321d54ed814d3c7618;hpb=6ca1c0a4516ce95b10653268f3601a9dd313fdf6 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 checkedFuture = t.commit(); - checkedFuture.get(); + FluentFuture configCheckedFuture = configT.commit(); + configCheckedFuture.get(); + FluentFuture operCheckedFuture = operT.commit(); + operCheckedFuture.get(); + log.info("Create containers succeeded!"); } catch (InterruptedException | ExecutionException e) {