migrate sdnr features to sulfur 83/129983/2
authorMichael Dürre <michael.duerre@highstreet-technologies.com>
Wed, 20 Jul 2022 07:32:50 +0000 (09:32 +0200)
committerMichael Dürre <michael.duerre@highstreet-technologies.com>
Thu, 21 Jul 2022 10:38:52 +0000 (12:38 +0200)
fix sdnr code for sulfur

Issue-ID: CCSDK-3692
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Change-Id: I0a62ade424bb978222e7ce6450215fb327f957b7
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
189 files changed:
sdnr/wt/README.md
sdnr/wt/apigateway/feature/pom.xml
sdnr/wt/apigateway/installer/pom.xml
sdnr/wt/apigateway/pom.xml
sdnr/wt/apigateway/provider/pom.xml
sdnr/wt/common-yang/iana-crypt-hash/pom.xml
sdnr/wt/common-yang/ietf-alarms/pom.xml
sdnr/wt/common-yang/onap/pom.xml
sdnr/wt/common-yang/openroadm-pm-types/pom.xml
sdnr/wt/common-yang/openroadm-pm-types/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java
sdnr/wt/common-yang/pom.xml
sdnr/wt/common-yang/rfc7317-ietf-system/pom.xml
sdnr/wt/common-yang/rfc8341/pom.xml
sdnr/wt/common-yang/utils/pom.xml
sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/YangToolsMapper.java
sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/YangToolsMapper2.java
sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/YangToolsMapperHelper.java
sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/mapperextensions/YangToolsDeserializerModifier.java
sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/mapperextensions/YangToolsDeserializerModifier2.java
sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/mapperextensions/YangtoolsMapDesirializer.java
sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/mapperextensions/YangtoolsMapDesirializer2.java
sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/serialize/SetDeserializer.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/test/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/TestYangToolsMapper.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/test/yang/ietf-inet-types.yang [new file with mode: 0644]
sdnr/wt/common-yang/utils/src/test/yang/test-yang-utils.yang [new file with mode: 0644]
sdnr/wt/common/pom.xml
sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/SearchResult.java
sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntry.java
sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/threading/GenericRunnableFactory.java
sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/threading/KeyBasedThreadpool.java
sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestBaseHttpClient.java
sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestKeybasedThreadpool.java [new file with mode: 0644]
sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/helper/HelpServletBase.java
sdnr/wt/data-provider/dblib/pom.xml
sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/DatabaseDataProvider.java
sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/data/SqlDBDataProvider.java
sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/data/rpctypehelper/QueryResult.java
sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/database/SqlDBMapper.java
sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/database/SqlDBStatusReader.java
sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/query/SelectQuery.java
sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/query/SqlQuery.java
sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/query/filters/RegexSqlDBFilter.java
sdnr/wt/data-provider/dblib/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/dblib/test/TestMariaDataProvider.java
sdnr/wt/data-provider/dblib/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/dblib/test/TestQuerySyntax.java
sdnr/wt/data-provider/feature/pom.xml
sdnr/wt/data-provider/installer/pom.xml
sdnr/wt/data-provider/model/pom.xml
sdnr/wt/data-provider/model/src/main/yang/data-provider@2020-11-10.yang
sdnr/wt/data-provider/pom.xml
sdnr/wt/data-provider/provider/pom.xml
sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/elasticsearch/EsDataObjectReaderWriter2.java
sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/elasticsearch/data/acessor/DataObjectAcessorStatus.java
sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/elasticsearch/impl/ElasticSearchDataProvider.java
sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/elasticsearch/impl/HtUserdataManagerImpl.java
sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/nodb/NoDbDatabaseDataProvider.java
sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java
sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java
sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java
sdnr/wt/data-provider/setup/pom.xml
sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java
sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/TestMariaDBMapper.java
sdnr/wt/devicemanager-core/feature/pom.xml
sdnr/wt/devicemanager-core/installer/pom.xml
sdnr/wt/devicemanager-core/model/pom.xml
sdnr/wt/devicemanager-core/model/src/main/yang/devicemanager.yang
sdnr/wt/devicemanager-core/pom.xml
sdnr/wt/devicemanager-core/provider/pom.xml
sdnr/wt/devicemanager-core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java
sdnr/wt/devicemanager-core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/NetworkElementConnectionEntitiyUtil.java
sdnr/wt/devicemanager-core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceServiceImpl.java
sdnr/wt/devicemanager-core/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevicemanager.java
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/feature/pom.xml
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/installer/pom.xml
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/model/pom.xml
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/pom.xml
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/pom.xml
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/ORanDMDOMUtility.java
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/ORanDOMToInternalDataModel.java
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/YangParserTestUtils.java [new file with mode: 0644]
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/util/TestYangParserUtil.java [deleted file]
sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/ietf-hardware.xml
sdnr/wt/devicemanager-onap/adapter-manager/feature/pom.xml
sdnr/wt/devicemanager-onap/adapter-manager/installer/pom.xml
sdnr/wt/devicemanager-onap/adapter-manager/model/pom.xml
sdnr/wt/devicemanager-onap/adapter-manager/pom.xml
sdnr/wt/devicemanager-onap/adapter-manager/provider/pom.xml
sdnr/wt/devicemanager-onap/onf12/feature/pom.xml
sdnr/wt/devicemanager-onap/onf12/installer/pom.xml
sdnr/wt/devicemanager-onap/onf12/model/pom.xml
sdnr/wt/devicemanager-onap/onf12/pom.xml
sdnr/wt/devicemanager-onap/onf12/provider/pom.xml
sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java
sdnr/wt/devicemanager-onap/onf14/feature/pom.xml
sdnr/wt/devicemanager-onap/onf14/installer/pom.xml
sdnr/wt/devicemanager-onap/onf14/model/pom.xml
sdnr/wt/devicemanager-onap/onf14/pom.xml
sdnr/wt/devicemanager-onap/onf14/provider/pom.xml
sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/Onf14DomToInternalDataModel.java
sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/Onf14DomTestUtils.java
sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/TestYangParserUtil.java [deleted file]
sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/YangParserTestUtils.java [new file with mode: 0644]
sdnr/wt/devicemanager-onap/openroadm/feature/pom.xml
sdnr/wt/devicemanager-onap/openroadm/installer/pom.xml
sdnr/wt/devicemanager-onap/openroadm/model/pom.xml
sdnr/wt/devicemanager-onap/openroadm/pom.xml
sdnr/wt/devicemanager-onap/openroadm/provider/pom.xml
sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java
sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java
sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java
sdnr/wt/devicemanager-onap/openroadm71/feature/pom.xml
sdnr/wt/devicemanager-onap/openroadm71/installer/pom.xml
sdnr/wt/devicemanager-onap/openroadm71/model/pom.xml
sdnr/wt/devicemanager-onap/openroadm71/pom.xml
sdnr/wt/devicemanager-onap/openroadm71/provider/pom.xml
sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmInventoryInput.java
sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElement.java
sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementFactory.java
sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device.yang
sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/test/TestChangeNotificationListener.java
sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/test/TestOpenRoadmDeviceChangeNotification.java
sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/test/TestOpenRoadmInventory.java
sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/test/TestOpenRoadmNetworkElement.java
sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/test/TestOpenRoadmNetworkElementFactory.java
sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/test/TestOpenRoadmPMDataBuilder.java
sdnr/wt/featureaggregator/feature-devicemanager-base/pom.xml
sdnr/wt/featureaggregator/feature-devicemanager/pom.xml
sdnr/wt/featureaggregator/feature-oauth/pom.xml
sdnr/wt/featureaggregator/feature/pom.xml
sdnr/wt/featureaggregator/installer/pom.xml
sdnr/wt/featureaggregator/pom.xml
sdnr/wt/helpserver/feature/pom.xml
sdnr/wt/helpserver/installer/pom.xml
sdnr/wt/helpserver/pom.xml
sdnr/wt/helpserver/provider/pom.xml
sdnr/wt/mountpoint-registrar/feature/pom.xml
sdnr/wt/mountpoint-registrar/installer/pom.xml
sdnr/wt/mountpoint-registrar/model/pom.xml
sdnr/wt/mountpoint-registrar/pom.xml
sdnr/wt/mountpoint-registrar/provider/pom.xml
sdnr/wt/mountpoint-state-provider/feature/pom.xml
sdnr/wt/mountpoint-state-provider/installer/pom.xml
sdnr/wt/mountpoint-state-provider/pom.xml
sdnr/wt/mountpoint-state-provider/provider/pom.xml
sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESCommonEventHeaderPOJO.java [deleted file]
sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESEvent.java [deleted file]
sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESNotificationFieldsPOJO.java [deleted file]
sdnr/wt/netconfnode-state-service/feature/pom.xml
sdnr/wt/netconfnode-state-service/installer/pom.xml
sdnr/wt/netconfnode-state-service/model/pom.xml
sdnr/wt/netconfnode-state-service/model/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestCapabilities.java [new file with mode: 0644]
sdnr/wt/netconfnode-state-service/pom.xml
sdnr/wt/netconfnode-state-service/provider/pom.xml
sdnr/wt/netconfnode-state-service/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/impl/NetconfNodeStateServiceImpl.java
sdnr/wt/netconfnode-state-service/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/impl/conf/NetconfStateConfig.java
sdnr/wt/netconfnode-state-service/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/impl/rpc/NetconfnodeStateServiceRpcApiImpl.java
sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestConfig.java [new file with mode: 0644]
sdnr/wt/oauth-provider/pom.xml
sdnr/wt/oauth-provider/provider-jar/pom.xml
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/data/OAuthProviderConfig.java
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/data/OpenIdConfigResponseData.java [new file with mode: 0644]
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/data/UnableToConfigureOAuthService.java [new file with mode: 0644]
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/filters/CustomizedMDSALDynamicAuthorizationFilter.java [new file with mode: 0644]
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/http/AuthHttpServlet.java
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/providers/AuthService.java
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/providers/GitlabProviderService.java
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/providers/KeycloakProviderService.java
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/providers/MdSalAuthorizationStore.java
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/providers/NextcloudProviderService.java
sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/providers/OAuthProviderFactory.java
sdnr/wt/oauth-provider/provider-jar/src/test/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/test/TestGitlabAuthService.java
sdnr/wt/oauth-provider/provider-jar/src/test/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/test/TestKeycloakAuthService.java
sdnr/wt/oauth-provider/provider-osgi/pom.xml
sdnr/wt/pom.xml
sdnr/wt/readthedocs/pom.xml
sdnr/wt/websocketmanager/feature/pom.xml
sdnr/wt/websocketmanager/installer/pom.xml
sdnr/wt/websocketmanager/model/pom.xml
sdnr/wt/websocketmanager/pom.xml
sdnr/wt/websocketmanager/provider/pom.xml

index 2b19ff6..60e2fe8 100644 (file)
@@ -1,6 +1,6 @@
 # wt - wireless transport microservices
 
-ODL version: aluminium sr1
+ODL version: sulfur sr1
 
 ## apigateway (osgi)
 
index 00d63c4..0c0d57a 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index ac10d17..ba104dd 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 901f385..804cefd 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index d562352..46373b3 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -47,6 +48,7 @@
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
@@ -66,6 +68,7 @@
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-common</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 
index 169eaf0..9f8dcfe 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 612bbbf..ddd059f 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 4d03360..ad5d3e9 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index a20e65f..fc8d675 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index f89197b..52ae92c 100644 (file)
@@ -1,58 +1,65 @@
 package org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129;
-
-import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
 import java.math.BigDecimal;
+
+import javax.annotation.processing.Generated;
+
+import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.common.Uint64;
 
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+
 /**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string
- * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 -
- * uint16), or (string - uint32).
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
  *
- * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be
- * finished by the user. This class is generated only once to prevent loss of user code.
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
  *
  */
+@Generated("mdsal-binding-generator")
 @JsonPOJOBuilder(buildMethodName = "build", withPrefix = "set")
 public class PmDataTypeBuilder {
-    private Uint64 _uint64;
-    private Long _int64;
-    private BigDecimal _decimal64;
-
-    public PmDataTypeBuilder() {}
-
-    //Aluminium uses constructor
-    public PmDataTypeBuilder(String v) {
-        this.setUint64(v);
-    }
-
-    public PmDataTypeBuilder setUint64(String v) {
-        _uint64 = Uint64.valueOf(v);
-        return this;
-    }
-
-    public PmDataTypeBuilder setInt64(String v) {
-        _int64 = Long.valueOf(v);
-        return this;
-    }
-
-    public PmDataTypeBuilder setDecimal64(String v) {
-        _decimal64 = new BigDecimal(v);
-        return this;
-    }
-
-    public PmDataType build() {
-        if (_uint64 != null) {
-            return new PmDataType(_uint64);
-        } else if (_int64 != null) {
-            return new PmDataType(_int64);
-        } else {
-            return new PmDataType(_decimal64);
-        }
-    }
-
-    public static PmDataType getDefaultInstance(String defaultValue) {
-        return new PmDataTypeBuilder().setUint64(defaultValue).build();
-    }
+        private Uint64 _uint64;
+           private Long _int64;
+           private Decimal64 _decimal64;
+
+           public PmDataTypeBuilder() {}
+
+           //Aluminium uses constructor
+           public PmDataTypeBuilder(String v) {
+               this.setUint64(v);
+           }
+
+           public PmDataTypeBuilder setUint64(String v) {
+               _uint64 = Uint64.valueOf(v);
+               return this;
+           }
+
+           public PmDataTypeBuilder setInt64(String v) {
+               _int64 = Long.valueOf(v);
+               return this;
+           }
+
+           public PmDataTypeBuilder setDecimal64(String v) {
+               _decimal64 = Decimal64.valueOf(v);
+               return this;
+           }
+
+           public PmDataType build() {
+               if (_uint64 != null) {
+                   return new PmDataType(_uint64);
+               } else if (_int64 != null) {
+                   return new PmDataType(_int64);
+               } else {
+                   return new PmDataType(_decimal64);
+               }
+           }
+
+           public static PmDataType getDefaultInstance(String defaultValue) {
+               return new PmDataTypeBuilder().setUint64(defaultValue).build();
+           }
 
 }
index 888d021..ff8820e 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index f451db9..9459123 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index f8780bb..c3c3252 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 927639f..4fb97cc 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-dom-api</artifactId>
             <scope>provided</scope>
+        </dependency>
+               <dependency>
+                   <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+                   <artifactId>rfc6991-ietf-inet-types</artifactId>
+                   <scope>test</scope>
+               </dependency>
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>**/gen/**</exclude>
+                        <exclude>**/generated-sources/**</exclude>
+                        <exclude>**/yang-gen-sal/**</exclude>
+                        <exclude>**/pax/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yang-maven-plugin</artifactId>
+                <version>7.0.9</version>
+                <executions>
+                    <execution>
+                        <id>binding</id>
+                        <goals>
+                            <goal>generate-sources</goal>
+                        </goals>
+                        <configuration>
+                            <yangFilesRootDir>src/test/yang</yangFilesRootDir>
+                            <inspectDependencies>true</inspectDependencies>
+                        </configuration>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.opendaylight.mdsal</groupId>
+                        <artifactId>mdsal-binding-java-api-generator</artifactId>
+                        <version>8.0.7</version>
+                        <scope>compile</scope>
+                    </dependency>
+                </dependencies>
+            </plugin>
+        </plugins>
+    </build>
 </project>
index 7d73afa..0d90456 100644 (file)
@@ -46,7 +46,8 @@ public class YangToolsMapper extends ObjectMapper {
     private final YangToolsBuilderAnnotationIntrospector annotationIntrospector;
     private final YangToolsModule module;
     private static final long serialVersionUID = 1L;
-    private boolean isModuleRegistered=false;
+    private boolean isModuleRegistered = false;
+
     public YangToolsMapper() {
         this(new YangToolsBuilderAnnotationIntrospector());
     }
@@ -63,6 +64,7 @@ public class YangToolsMapper extends ObjectMapper {
         enable(MapperFeature.USE_GETTERS_AS_SETTERS);
         setAnnotationIntrospector(yangToolsBuilderAnnotationIntrospector);
     }
+
     public void addDeserializer(Class<?> clsToDeserialize, String builderClassName) {
         this.annotationIntrospector.addDeserializer(clsToDeserialize, builderClassName);
     }
@@ -70,21 +72,23 @@ public class YangToolsMapper extends ObjectMapper {
     public void addKeyDeserializer(Class<?> type, KeyDeserializer deserializer) {
         this.module.addKeyDeserializer(type, deserializer);
     }
+
     @Override
     public <T> T readValue(String content, Class<T> valueType) throws JsonProcessingException, JsonMappingException {
-       if(!this.isModuleRegistered) {
-               this.registerModule(this.module);
-               this.isModuleRegistered=true;
-       }
-       return super.readValue(content, valueType);
+        if (!this.isModuleRegistered) {
+            this.registerModule(this.module);
+            this.isModuleRegistered = true;
+        }
+        return super.readValue(content, valueType);
     }
+
     @Override
     public String writeValueAsString(Object value) throws JsonProcessingException {
-       if(!this.isModuleRegistered) {
-               this.registerModule(this.module);
-               this.isModuleRegistered=true;
-       }
-       return super.writeValueAsString(value);
+        if (!this.isModuleRegistered) {
+            this.registerModule(this.module);
+            this.isModuleRegistered = true;
+        }
+        return super.writeValueAsString(value);
     }
 
 }
index 5c5aeb6..6b57040 100644 (file)
@@ -22,6 +22,8 @@
 package org.onap.ccsdk.features.sdnr.wt.yang.mapper;
 
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 import javax.annotation.Nullable;
 import org.eclipse.jdt.annotation.NonNull;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.mapperextensions.YangToolsBuilderAnnotationIntrospector;
@@ -40,7 +42,7 @@ public class YangToolsMapper2<T extends DataObject> extends YangToolsMapper {
     private static final Logger LOG = LoggerFactory.getLogger(YangToolsMapper2.class);
     private static final long serialVersionUID = 1L;
 
-    private @Nullable final Class<? extends Builder<? extends T>> builderClazz;
+    private @Nullable final Class<?> builderClazz;
 
     /**
      * Generic Object creation of yangtools java class builder pattern.
@@ -52,7 +54,7 @@ public class YangToolsMapper2<T extends DataObject> extends YangToolsMapper {
      *        If null the clazz is expected to support normal jackson build pattern.
      * @throws ClassNotFoundException if builderClazz not available in bundle
      */
-    public <X extends T, B extends Builder<X>> YangToolsMapper2(@NonNull Class<T> clazz,
+    public <X extends T, B> YangToolsMapper2(@NonNull Class<T> clazz,
             @Nullable Class<B> builderClazz) throws ClassNotFoundException {
         super(new YangToolsBuilderAnnotationIntrospector(clazz, builderClazz));
 
@@ -67,10 +69,10 @@ public class YangToolsMapper2<T extends DataObject> extends YangToolsMapper {
      * @param clazz class with interface.
      * @return builder for interface or null if not existing
      */
-    public @Nullable Builder<? extends T> getBuilder(Class<T> clazz) {
+    public @Nullable<B> B getBuilder(Class<T> clazz) {
         try {
             if (builderClazz != null)
-                return builderClazz.getDeclaredConstructor().newInstance();
+                return (B) builderClazz.getDeclaredConstructor().newInstance();
             else
                 return null;
         } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
@@ -90,8 +92,9 @@ public class YangToolsMapper2<T extends DataObject> extends YangToolsMapper {
      * @throws ClassNotFoundException
      */
     @SuppressWarnings("unchecked")
-    private <X extends T, B extends Builder<X>> Class<B> getBuilderClass(String name) throws ClassNotFoundException {
+    private <X extends T, B> Class<B> getBuilderClass(String name) throws ClassNotFoundException {
         return (Class<B>) YangToolsMapperHelper.getBuilderClass(name);
     }
 
+   
 }
index fe7631a..e72e962 100644 (file)
@@ -311,4 +311,10 @@ public class YangToolsMapperHelper {
     public static <K extends Identifier<V>, V extends Identifiable<K>> Map<K,V> toMap(List<V> list) {
         return list == null || list.isEmpty() ? null : Maps.uniqueIndex(list, Identifiable::key);
     }
+    
+    @SuppressWarnings("unchecked")
+       public static <S,T> T callBuild(S builder) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+               Method method = builder.getClass().getMethod("build");
+               return (T) method.invoke(builder);
+       }
 }
index 0fe8ab9..b7f1782 100644 (file)
@@ -29,18 +29,19 @@ import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.JsonDeserializer;
 import com.fasterxml.jackson.databind.KeyDeserializer;
 import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
-import com.fasterxml.jackson.databind.type.ArrayType;
 import com.fasterxml.jackson.databind.type.MapType;
-
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.NoSuchElementException;
 import java.util.Optional;
+import java.util.Set;
+
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapperHelper;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.serialize.BaseIdentityDeserializer;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.serialize.ClassDeserializer;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.serialize.IdentifierDeserializer;
+import org.onap.ccsdk.features.sdnr.wt.yang.mapper.serialize.SetDeserializer;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.serialize.TypeObjectDeserializer;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.Identifier;
@@ -51,87 +52,87 @@ import org.slf4j.LoggerFactory;
 
 public class YangToolsDeserializerModifier extends BeanDeserializerModifier {
 
-       private static final Logger LOG = LoggerFactory.getLogger(YangToolsDeserializerModifier.class);
-       private static final String getEnumMethodName = "valueOf";
-       private static final String getEnumMethodName2 = "forName";
+    private static final Logger LOG = LoggerFactory.getLogger(YangToolsDeserializerModifier.class);
+    private static final String getEnumMethodName = "valueOf";
+    private static final String getEnumMethodName2 = "forName";
 
-       @SuppressWarnings("unchecked")
-       public static Enum<?> parseEnum(String value, Class<?> clazz) throws IllegalAccessException,
-                       IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
-               try {
-                       Method method = clazz.getDeclaredMethod(getEnumMethodName, String.class);
-                       Enum<?> result = (Enum<?>) method.invoke(null, value);
-                       LOG.debug("Deserialize '{}' with class '{}' to '{}'", value, clazz.getName(), result);
-                       return result;
-               } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
-                               | NoSuchElementException | SecurityException e) {
-                       Method method = clazz.getDeclaredMethod(getEnumMethodName2, String.class);
-                       Optional<Enum<?>> result = (Optional<Enum<?>>) method.invoke(null, value);
-                       LOG.debug("Deserialize '{}' with class '{}' to '{}'", value, clazz.getName(), result);
-                       return result.orElseThrow();
-               }
-       }
+    @SuppressWarnings("unchecked")
+    public static Enum<?> parseEnum(String value, Class<?> clazz) throws IllegalAccessException,
+            IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+        try {
+            Method method = clazz.getDeclaredMethod(getEnumMethodName, String.class);
+            Enum<?> result = (Enum<?>) method.invoke(null, value);
+            LOG.debug("Deserialize '{}' with class '{}' to '{}'", value, clazz.getName(), result);
+            return result;
+        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
+                | NoSuchElementException | SecurityException e) {
+            Method method = clazz.getDeclaredMethod(getEnumMethodName2, String.class);
+            Optional<Enum<?>> result = (Optional<Enum<?>>) method.invoke(null, value);
+            LOG.debug("Deserialize '{}' with class '{}' to '{}'", value, clazz.getName(), result);
+            return result.orElseThrow();
+        }
+    }
 
-       @Override
-       public JsonDeserializer<Enum<?>> modifyEnumDeserializer(DeserializationConfig config, final JavaType type,
-                       BeanDescription beanDesc, final JsonDeserializer<?> deserializer) {
-               return new JsonDeserializer<Enum<?>>() {
+    @Override
+    public JsonDeserializer<Enum<?>> modifyEnumDeserializer(DeserializationConfig config, final JavaType type,
+            BeanDescription beanDesc, final JsonDeserializer<?> deserializer) {
+        return new JsonDeserializer<Enum<?>>() {
 
-                       @Override
-                       public Enum<?> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
-                               Class<?> clazz = type.getRawClass();
+            @Override
+            public Enum<?> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
+                Class<?> clazz = type.getRawClass();
 
-                               try {
-                                       return parseEnum(jp.getValueAsString(), clazz);
-                               } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
-                                               | NoSuchMethodException | NoSuchElementException | SecurityException e) {
-                                       LOG.warn("problem deserializing enum for {} with value {}: {}", clazz.getName(),
-                                                       jp.getValueAsString(), e);
-                               }
-                               throw new IOException(
-                                               "unable to parse enum (" + type.getRawClass() + ")for value " + jp.getValueAsString());
-                       }
-               };
-       }
+                try {
+                    return parseEnum(jp.getValueAsString(), clazz);
+                } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
+                        | NoSuchMethodException | NoSuchElementException | SecurityException e) {
+                    LOG.warn("problem deserializing enum for {} with value {}: {}", clazz.getName(),
+                            jp.getValueAsString(), e);
+                }
+                throw new IOException(
+                        "unable to parse enum (" + type.getRawClass() + ")for value " + jp.getValueAsString());
+            }
+        };
+    }
 
-       @Override
-       public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
-                       JsonDeserializer<?> deserializer) {
-               final JavaType type = beanDesc.getType();
-               final Class<?> rawClass = type.getRawClass();
+    @Override
+    public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
+            JsonDeserializer<?> deserializer) {
+        final JavaType type = beanDesc.getType();
+        final Class<?> rawClass = type.getRawClass();
 
-               JsonDeserializer<?> deser = super.modifyDeserializer(config, beanDesc, deserializer);
+        JsonDeserializer<?> deser = super.modifyDeserializer(config, beanDesc, deserializer);
 
-               if (YangToolsMapperHelper.implementsInterface(rawClass, TypeObject.class)) {
-                       deser = new TypeObjectDeserializer<TypeObject>(type, deser);
-               } else if (YangToolsMapperHelper.implementsInterface(rawClass, ScalarTypeObject.class)) {
-                       deser = new TypeObjectDeserializer<ScalarTypeObject<?>>(type, deser);
-               } else if (YangToolsMapperHelper.implementsInterface(rawClass, BaseIdentity.class)) {
-                       deser = new BaseIdentityDeserializer<BaseIdentity>(deser);
-               } else if (rawClass.equals(Class.class)) {
-                       deser = new ClassDeserializer(rawClass);
-               }
+        if (YangToolsMapperHelper.implementsInterface(rawClass, TypeObject.class)) {
+            deser = new TypeObjectDeserializer<TypeObject>(type, deser);
+        } else if (YangToolsMapperHelper.implementsInterface(rawClass, ScalarTypeObject.class)) {
+            deser = new TypeObjectDeserializer<ScalarTypeObject<?>>(type, deser);
+        } else if (YangToolsMapperHelper.implementsInterface(rawClass, BaseIdentity.class)) {
+            deser = new BaseIdentityDeserializer<BaseIdentity>(deser);
+        } else if (rawClass.equals(Class.class)) {
+            deser = new ClassDeserializer(rawClass);
+        } 
 
-               LOG.debug("Deserialize '{}' with deserializer '{}'", rawClass.getName(), deser.getClass().getName());
-               return deser;
-       }
+        LOG.debug("Deserialize '{}' with deserializer '{}'", rawClass.getName(), deser.getClass().getName());
+        return deser;
+    }
 
-       @Override
-       public JsonDeserializer<?> modifyMapDeserializer(DeserializationConfig config, MapType type,
-                       BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
-               final Class<?> rawClass = type.getBindings().getBoundType(1).getRawClass();             
-               return new YangtoolsMapDesirializer(rawClass);
-       }
+    @Override
+    public JsonDeserializer<?> modifyMapDeserializer(DeserializationConfig config, MapType type,
+            BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
+        final Class<?> rawClass = type.getBindings().getBoundType(1).getRawClass();
+        return new YangtoolsMapDesirializer(rawClass);
+    }
 
-       @Override
-       public KeyDeserializer modifyKeyDeserializer(DeserializationConfig config, JavaType type, KeyDeserializer deser) {
-               KeyDeserializer res;
-               if (YangToolsMapperHelper.implementsInterface(type.getRawClass(), Identifier.class)) {
-                       res = new IdentifierDeserializer();
-               } else {
-                       res = super.modifyKeyDeserializer(config, type, deser);
-               }
-               LOG.debug("Keydeserialize '{}' with deserializer '{}'", type.getRawClass().getName(), res.getClass().getName());
-               return res;
-       }
+    @Override
+    public KeyDeserializer modifyKeyDeserializer(DeserializationConfig config, JavaType type, KeyDeserializer deser) {
+        KeyDeserializer res;
+        if (YangToolsMapperHelper.implementsInterface(type.getRawClass(), Identifier.class)) {
+            res = new IdentifierDeserializer();
+        } else {
+            res = super.modifyKeyDeserializer(config, type, deser);
+        }
+        LOG.debug("Keydeserialize '{}' with deserializer '{}'", type.getRawClass().getName(), res.getClass().getName());
+        return res;
+    }
 }
index 0697f5f..800f414 100644 (file)
@@ -49,87 +49,87 @@ import org.slf4j.LoggerFactory;
 
 public class YangToolsDeserializerModifier2 extends BeanDeserializerModifier {
 
-       private static final Logger LOG = LoggerFactory.getLogger(YangToolsDeserializerModifier2.class);
-       private static final String getEnumMethodName = "valueOf";
-       private static final String getEnumMethodName2 = "forName";
+    private static final Logger LOG = LoggerFactory.getLogger(YangToolsDeserializerModifier2.class);
+    private static final String getEnumMethodName = "valueOf";
+    private static final String getEnumMethodName2 = "forName";
 
-       @SuppressWarnings("unchecked")
-       public static Enum<?> parseEnum(String value, Class<?> clazz) throws IllegalAccessException,
-                       IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
-               try {
-                       Method method = clazz.getDeclaredMethod(getEnumMethodName, String.class);
-                       Enum<?> result = (Enum<?>) method.invoke(null, value);
-                       LOG.debug("Deserialize '{}' with class '{}' to '{}'", value, clazz.getName(), result);
-                       return result;
-               } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
-                               | NoSuchElementException | SecurityException e) {
-                       Method method = clazz.getDeclaredMethod(getEnumMethodName2, String.class);
-                       Optional<Enum<?>> result = (Optional<Enum<?>>) method.invoke(null, value);
-                       LOG.debug("Deserialize '{}' with class '{}' to '{}'", value, clazz.getName(), result);
-                       return result.orElseThrow();
-               }
-       }
+    @SuppressWarnings("unchecked")
+    public static Enum<?> parseEnum(String value, Class<?> clazz) throws IllegalAccessException,
+            IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+        try {
+            Method method = clazz.getDeclaredMethod(getEnumMethodName, String.class);
+            Enum<?> result = (Enum<?>) method.invoke(null, value);
+            LOG.debug("Deserialize '{}' with class '{}' to '{}'", value, clazz.getName(), result);
+            return result;
+        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
+                | NoSuchElementException | SecurityException e) {
+            Method method = clazz.getDeclaredMethod(getEnumMethodName2, String.class);
+            Optional<Enum<?>> result = (Optional<Enum<?>>) method.invoke(null, value);
+            LOG.debug("Deserialize '{}' with class '{}' to '{}'", value, clazz.getName(), result);
+            return result.orElseThrow();
+        }
+    }
 
-       @Override
-       public JsonDeserializer<Enum<?>> modifyEnumDeserializer(DeserializationConfig config, final JavaType type,
-                       BeanDescription beanDesc, final JsonDeserializer<?> deserializer) {
-               return new JsonDeserializer<Enum<?>>() {
+    @Override
+    public JsonDeserializer<Enum<?>> modifyEnumDeserializer(DeserializationConfig config, final JavaType type,
+            BeanDescription beanDesc, final JsonDeserializer<?> deserializer) {
+        return new JsonDeserializer<Enum<?>>() {
 
-                       @Override
-                       public Enum<?> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
-                               Class<?> clazz = type.getRawClass();
+            @Override
+            public Enum<?> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
+                Class<?> clazz = type.getRawClass();
 
-                               try {
-                                       return parseEnum(jp.getValueAsString(), clazz);
-                               } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
-                                               | NoSuchMethodException | NoSuchElementException | SecurityException e) {
-                                       LOG.warn("problem deserializing enum for {} with value {}: {}", clazz.getName(),
-                                                       jp.getValueAsString(), e);
-                               }
-                               throw new IOException(
-                                               "unable to parse enum (" + type.getRawClass() + ")for value " + jp.getValueAsString());
-                       }
-               };
-       }
+                try {
+                    return parseEnum(jp.getValueAsString(), clazz);
+                } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
+                        | NoSuchMethodException | NoSuchElementException | SecurityException e) {
+                    LOG.warn("problem deserializing enum for {} with value {}: {}", clazz.getName(),
+                            jp.getValueAsString(), e);
+                }
+                throw new IOException(
+                        "unable to parse enum (" + type.getRawClass() + ")for value " + jp.getValueAsString());
+            }
+        };
+    }
 
-       @Override
-       public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
-                       JsonDeserializer<?> deserializer) {
-               final JavaType type = beanDesc.getType();
-               final Class<?> rawClass = type.getRawClass();
+    @Override
+    public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc,
+            JsonDeserializer<?> deserializer) {
+        final JavaType type = beanDesc.getType();
+        final Class<?> rawClass = type.getRawClass();
 
-               JsonDeserializer<?> deser = super.modifyDeserializer(config, beanDesc, deserializer);
+        JsonDeserializer<?> deser = super.modifyDeserializer(config, beanDesc, deserializer);
 
-               if (YangToolsMapperHelper.implementsInterface(rawClass, TypeObject.class)) {
-                       deser = new TypeObjectDeserializer<TypeObject>(type, deser);
-               } else if (YangToolsMapperHelper.implementsInterface(rawClass, ScalarTypeObject.class)) {
-                       deser = new TypeObjectDeserializer<ScalarTypeObject<?>>(type, deser);
-               } else if (YangToolsMapperHelper.implementsInterface(rawClass, BaseIdentity.class)) {
-                       deser = new BaseIdentityDeserializer<BaseIdentity>(deser);
-               } else if (rawClass.equals(Class.class)) {
-                       deser = new ClassDeserializer(rawClass);
-               }
+        if (YangToolsMapperHelper.implementsInterface(rawClass, TypeObject.class)) {
+            deser = new TypeObjectDeserializer<TypeObject>(type, deser);
+        } else if (YangToolsMapperHelper.implementsInterface(rawClass, ScalarTypeObject.class)) {
+            deser = new TypeObjectDeserializer<ScalarTypeObject<?>>(type, deser);
+        } else if (YangToolsMapperHelper.implementsInterface(rawClass, BaseIdentity.class)) {
+            deser = new BaseIdentityDeserializer<BaseIdentity>(deser);
+        } else if (rawClass.equals(Class.class)) {
+            deser = new ClassDeserializer(rawClass);
+        }
 
-               LOG.debug("Deserialize '{}' with deserializer '{}'", rawClass.getName(), deser.getClass().getName());
-               return deser;
-       }
+        LOG.debug("Deserialize '{}' with deserializer '{}'", rawClass.getName(), deser.getClass().getName());
+        return deser;
+    }
 
-       @Override
-       public JsonDeserializer<?> modifyMapDeserializer(DeserializationConfig config, MapType type,
-                       BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
-               final Class<?> rawClass = type.getBindings().getBoundType(1).getRawClass();
-               return new YangtoolsMapDesirializer(rawClass);
-       }
+    @Override
+    public JsonDeserializer<?> modifyMapDeserializer(DeserializationConfig config, MapType type,
+            BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
+        final Class<?> rawClass = type.getBindings().getBoundType(1).getRawClass();
+        return new YangtoolsMapDesirializer(rawClass);
+    }
 
-       @Override
-       public KeyDeserializer modifyKeyDeserializer(DeserializationConfig config, JavaType type, KeyDeserializer deser) {
-               KeyDeserializer res;
-               if (YangToolsMapperHelper.implementsInterface(type.getRawClass(), Identifier.class)) {
-                       res = new IdentifierDeserializer();
-               } else {
-                       res = super.modifyKeyDeserializer(config, type, deser);
-               }
-               LOG.debug("Keydeserialize '{}' with deserializer '{}'", type.getRawClass().getName(), res.getClass().getName());
-               return res;
-       }
+    @Override
+    public KeyDeserializer modifyKeyDeserializer(DeserializationConfig config, JavaType type, KeyDeserializer deser) {
+        KeyDeserializer res;
+        if (YangToolsMapperHelper.implementsInterface(type.getRawClass(), Identifier.class)) {
+            res = new IdentifierDeserializer();
+        } else {
+            res = super.modifyKeyDeserializer(config, type, deser);
+        }
+        LOG.debug("Keydeserialize '{}' with deserializer '{}'", type.getRawClass().getName(), res.getClass().getName());
+        return res;
+    }
 }
index 2fe7fa1..922257d 100644 (file)
@@ -1,44 +1,36 @@
 package org.onap.ccsdk.features.sdnr.wt.yang.mapper.mapperextensions;
 
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.type.CollectionLikeType;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapper;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapperHelper;
 import org.opendaylight.yangtools.yang.binding.Identifiable;
 import org.opendaylight.yangtools.yang.binding.Identifier;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.core.TreeNode;
-import com.fasterxml.jackson.databind.BeanDescription;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.type.CollectionLikeType;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import com.google.common.collect.Maps;
 
 public class YangtoolsMapDesirializer<K extends Identifier<V>, V extends Identifiable<K>>
-               extends JsonDeserializer<Map<K, V>> {
+        extends JsonDeserializer<Map<K, V>> {
+
+    private final Class<V> clazz;
+    private final YangToolsMapper mapper;
 
-       private final Class<V> clazz;
-       private final YangToolsMapper mapper;
-       
-       public YangtoolsMapDesirializer(Class<V> clazz) {
-               super();
-               this.clazz = clazz;
-               this.mapper = new YangToolsMapper();
-       }
+    public YangtoolsMapDesirializer(Class<V> clazz) {
+        super();
+        this.clazz = clazz;
+        this.mapper = new YangToolsMapper();
+    }
 
-       @Override
-       public Map<K, V> deserialize(JsonParser p, DeserializationContext ctxt)
-                       throws IOException, JsonProcessingException {
-               CollectionLikeType type = ctxt.getTypeFactory().constructCollectionType(List.class, clazz);
-               List<V> list = mapper.readValue(p,type);
-               return YangToolsMapperHelper.toMap(list);
-       }
+    @Override
+    public Map<K, V> deserialize(JsonParser p, DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+        CollectionLikeType type = ctxt.getTypeFactory().constructCollectionType(List.class, clazz);
+        List<V> list = mapper.readValue(p, type);
+        return YangToolsMapperHelper.toMap(list);
+    }
 
 }
index 6a419ee..4a52f57 100644 (file)
@@ -14,23 +14,23 @@ import org.opendaylight.yangtools.yang.binding.Identifiable;
 import org.opendaylight.yangtools.yang.binding.Identifier;
 
 public class YangtoolsMapDesirializer2<K extends Identifier<V>, V extends Identifiable<K>>
-               extends JsonDeserializer<Map<K, V>> {
+        extends JsonDeserializer<Map<K, V>> {
 
-       private final Class<V> clazz;
-       private final YangToolsMapper mapper;
+    private final Class<V> clazz;
+    private final YangToolsMapper mapper;
 
-       public YangtoolsMapDesirializer2(Class<V> clazz) {
-               super();
-               this.clazz = clazz;
-               this.mapper = new YangToolsMapper();
-       }
+    public YangtoolsMapDesirializer2(Class<V> clazz) {
+        super();
+        this.clazz = clazz;
+        this.mapper = new YangToolsMapper();
+    }
 
-       @Override
-       public Map<K, V> deserialize(JsonParser p, DeserializationContext ctxt)
-                       throws IOException, JsonProcessingException {
-               CollectionLikeType type = ctxt.getTypeFactory().constructCollectionType(List.class, clazz);
-               List<V> list = mapper.readValue(p,type);
-               return YangToolsMapperHelper.toMap(list);
-       }
+    @Override
+    public Map<K, V> deserialize(JsonParser p, DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+        CollectionLikeType type = ctxt.getTypeFactory().constructCollectionType(List.class, clazz);
+        List<V> list = mapper.readValue(p, type);
+        return YangToolsMapperHelper.toMap(list);
+    }
 
 }
diff --git a/sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/serialize/SetDeserializer.java b/sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/serialize/SetDeserializer.java
new file mode 100644 (file)
index 0000000..2ab3fe7
--- /dev/null
@@ -0,0 +1,39 @@
+package org.onap.ccsdk.features.sdnr.wt.yang.mapper.serialize;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.type.CollectionLikeType;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapper;
+import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapperHelper;
+import org.opendaylight.yangtools.yang.binding.Identifiable;
+import org.opendaylight.yangtools.yang.binding.Identifier;
+
+public class SetDeserializer<V>
+        extends JsonDeserializer<Set<V>> {
+
+    private final Class<V> clazz;
+    private final YangToolsMapper mapper;
+
+    public SetDeserializer(Class<V> clazz) {
+        super();
+        this.clazz = clazz;
+        this.mapper = new YangToolsMapper();
+    }
+
+    @Override
+    public Set<V> deserialize(JsonParser p, DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+        CollectionLikeType type = ctxt.getTypeFactory().constructCollectionType(Set.class, clazz);
+        List<V> list = mapper.readValue(p, type);
+        return new HashSet<>(list);
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java b/sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java
new file mode 100644 (file)
index 0000000..3d859e8
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+import javax.annotation.processing.Generated;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+@Generated("mdsal-binding-generator")
+public class HostBuilder {
+    private HostBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static Host getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java b/sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java
new file mode 100644 (file)
index 0000000..62771f6
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+import javax.annotation.processing.Generated;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+@Generated("mdsal-binding-generator")
+public class IpAddressBuilder {
+    private IpAddressBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static IpAddress getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java b/sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java
new file mode 100644 (file)
index 0000000..d7b2952
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+import javax.annotation.processing.Generated;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+@Generated("mdsal-binding-generator")
+public class IpAddressNoZoneBuilder {
+    private IpAddressNoZoneBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static IpAddressNoZone getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java b/sdnr/wt/common-yang/utils/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java
new file mode 100644 (file)
index 0000000..d5fff3d
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+import javax.annotation.processing.Generated;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+@Generated("mdsal-binding-generator")
+public class IpPrefixBuilder {
+    private IpPrefixBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static IpPrefix getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/test/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/TestYangToolsMapper.java b/sdnr/wt/common-yang/utils/src/test/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/TestYangToolsMapper.java
new file mode 100644 (file)
index 0000000..2e51e84
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
+ * All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.yang.mapper;
+
+import static org.junit.Assert.assertEquals;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.util.HashMap;
+import java.util.Map;
+import org.json.JSONObject;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.yang.mapper.serialize.IdentifierDeserializer;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.test.yang.utils.norev.AddressLocation;
+import org.opendaylight.yang.gen.v1.urn.test.yang.utils.norev.AddressLocationBuilder;
+import org.opendaylight.yang.gen.v1.urn.test.yang.utils.norev.AddressType;
+import org.opendaylight.yang.gen.v1.urn.test.yang.utils.norev.ItemCode;
+import org.opendaylight.yang.gen.v1.urn.test.yang.utils.norev.address.location.entity.ItemList;
+import org.opendaylight.yang.gen.v1.urn.test.yang.utils.norev.address.location.entity.ItemListBuilder;
+import org.opendaylight.yang.gen.v1.urn.test.yang.utils.norev.address.location.entity.ItemListKey;
+
+public class TestYangToolsMapper {
+
+    private static final YangToolsMapper MAPPER = new YangToolsMapper();
+
+    @Before
+    public void init() {
+        MAPPER.addKeyDeserializer(ItemListKey.class, new IdentifierDeserializer());
+    }
+
+    @Test
+    public void testYangMapperDeser() {
+        AddressLocation al = null;
+
+        try {
+            al = MAPPER.readValue(
+                    "{\n"
+                    + "    \"address-type\": \"OFFICE\",\n"
+                    + "    \"delivery-date-time\": \"2022-03-15T11:12:13.890Z\",\n"
+                    + "    \"delivery-url\": \"delivery.uri\",\n"
+                    + "    \"item-list\": [\n"
+                    + "        {\n"
+                    + "            \"item-key\": \"org.opendaylight.yang.gen.v1.urn.test.yang.utils.norev.ItemCode\"\n"
+                    + "        }\n"
+                    + "    ]\n"
+                    + "}",
+                    AddressLocation.class);
+        } catch (JsonProcessingException e) {
+            e.printStackTrace();
+        }
+        assertEquals(AddressType.OFFICE, al.getAddressType());
+        assertEquals("2022-03-15T11:12:13.890Z", al.getDeliveryDateTime().getValue());
+        System.out.println("Delivery Date = " + al.getDeliveryDateTime().getValue());
+        System.out.println(al.getItemList());
+        System.out.println(al.getDeliveryUrl().getValue());
+    }
+
+    @Test
+    public void testYangMapperSer() {
+        Map<ItemListKey, ItemList> items = new HashMap<ItemListKey, ItemList>();
+        ItemList il = new ItemListBuilder().setItemKey(ItemCode.class).build();
+        items.put(new ItemListKey(ItemCode.class), il);
+
+        Uri uri = new Uri("delivery.uri");
+
+        AddressLocation al = new AddressLocationBuilder().setId("99").setAddressType(AddressType.HOME)
+                .setDeliveryDateTime(new DateAndTime("2022-03-15T11:12:13.890Z")).setItemList(items)
+                .setDeliveryUrl(uri).build();
+        String str = null;
+
+        try {
+            str = MAPPER.writeValueAsString(al);
+        } catch (JsonProcessingException e) {
+            e.printStackTrace();
+        }
+        assertEquals("HOME", new JSONObject(str).getString("address-type"));
+        assertEquals("2022-03-15T11:12:13.890Z", new JSONObject(str).getString("delivery-date-time"));
+        System.out.println(new JSONObject(str).getJSONArray("item-list"));
+        System.out.println(str);
+    }
+}
diff --git a/sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java b/sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/HostBuilder.java
new file mode 100644 (file)
index 0000000..3d859e8
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+import javax.annotation.processing.Generated;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+@Generated("mdsal-binding-generator")
+public class HostBuilder {
+    private HostBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static Host getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java b/sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressBuilder.java
new file mode 100644 (file)
index 0000000..62771f6
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+import javax.annotation.processing.Generated;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+@Generated("mdsal-binding-generator")
+public class IpAddressBuilder {
+    private IpAddressBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static IpAddress getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java b/sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilder.java
new file mode 100644 (file)
index 0000000..d7b2952
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+import javax.annotation.processing.Generated;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+@Generated("mdsal-binding-generator")
+public class IpAddressNoZoneBuilder {
+    private IpAddressNoZoneBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static IpAddressNoZone getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java b/sdnr/wt/common-yang/utils/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpPrefixBuilder.java
new file mode 100644 (file)
index 0000000..d5fff3d
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+import javax.annotation.processing.Generated;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+@Generated("mdsal-binding-generator")
+public class IpPrefixBuilder {
+    private IpPrefixBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static IpPrefix getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/test/yang/ietf-inet-types.yang b/sdnr/wt/common-yang/utils/src/test/yang/ietf-inet-types.yang
new file mode 100644 (file)
index 0000000..f91aa1f
--- /dev/null
@@ -0,0 +1,429 @@
+module ietf-inet-types {
+
+  namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";
+  prefix "inet";
+
+  organization
+   "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+  contact
+   "WG Web:   <http://tools.ietf.org/wg/netmod/>
+    WG List:  <mailto:netmod@ietf.org>
+    WG Chair: David Kessens
+              <mailto:david.kessens@nsn.com>
+    WG Chair: Juergen Schoenwaelder
+              <mailto:j.schoenwaelder@jacobs-university.de>
+    Editor:   Juergen Schoenwaelder
+              <mailto:j.schoenwaelder@jacobs-university.de>";
+
+  description
+   "This module contains a collection of generally useful derived
+    YANG data types for Internet addresses and related things.
+    Copyright (c) 2013 IETF Trust and the persons identified as
+    authors of the code.  All rights reserved.
+    Redistribution and use in source and binary forms, with or
+    without modification, is permitted pursuant to, and subject
+    to the license terms contained in, the Simplified BSD License
+    set forth in Section 4.c of the IETF Trust's Legal Provisions
+    Relating to IETF Documents
+    (http://trustee.ietf.org/license-info).
+    This version of this YANG module is part of RFC 6991; see
+    the RFC itself for full legal notices.";
+
+  revision 2013-07-15 {
+    description
+     "This revision adds the following new data types:
+      - ip-address-no-zone
+      - ipv4-address-no-zone
+      - ipv6-address-no-zone";
+    reference
+     "RFC 6991: Common YANG Data Types";
+  }
+
+  revision 2010-09-24 {
+    description
+     "Initial revision.";
+    reference
+     "RFC 6021: Common YANG Data Types";
+  }
+
+  /*** collection of types related to protocol fields ***/
+
+  typedef ip-version {
+    type enumeration {
+      enum unknown {
+        value "0";
+        description
+         "An unknown or unspecified version of the Internet
+          protocol.";
+      }
+      enum ipv4 {
+        value "1";
+        description
+         "The IPv4 protocol as defined in RFC 791.";
+      }
+      enum ipv6 {
+        value "2";
+        description
+         "The IPv6 protocol as defined in RFC 2460.";
+      }
+    }
+    description
+     "This value represents the version of the IP protocol.
+      In the value set and its semantics, this type is equivalent
+      to the InetVersion textual convention of the SMIv2.";
+    reference
+     "RFC  791: Internet Protocol
+      RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
+      RFC 4001: Textual Conventions for Internet Network Addresses";
+  }
+
+  typedef dscp {
+    type uint8 {
+      range "0..63";
+    }
+    description
+     "The dscp type represents a Differentiated Services Code Point
+      that may be used for marking packets in a traffic stream.
+      In the value set and its semantics, this type is equivalent
+      to the Dscp textual convention of the SMIv2.";
+    reference
+     "RFC 3289: Management Information Base for the Differentiated
+                Services Architecture
+      RFC 2474: Definition of the Differentiated Services Field
+                (DS Field) in the IPv4 and IPv6 Headers
+      RFC 2780: IANA Allocation Guidelines For Values In
+                the Internet Protocol and Related Headers";
+  }
+
+  typedef ipv6-flow-label {
+    type uint32 {
+      range "0..1048575";
+    }
+    description
+     "The ipv6-flow-label type represents the flow identifier or Flow
+      Label in an IPv6 packet header that may be used to
+      discriminate traffic flows.
+      In the value set and its semantics, this type is equivalent
+      to the IPv6FlowLabel textual convention of the SMIv2.";
+    reference
+     "RFC 3595: Textual Conventions for IPv6 Flow Label
+      RFC 2460: Internet Protocol, Version 6 (IPv6) Specification";
+  }
+
+  typedef port-number {
+    type uint16 {
+      range "0..65535";
+    }
+    description
+     "The port-number type represents a 16-bit port number of an
+      Internet transport-layer protocol such as UDP, TCP, DCCP, or
+      SCTP.  Port numbers are assigned by IANA.  A current list of
+      all assignments is available from <http://www.iana.org/>.
+      Note that the port number value zero is reserved by IANA.  In
+      situations where the value zero does not make sense, it can
+      be excluded by subtyping the port-number type.
+      In the value set and its semantics, this type is equivalent
+      to the InetPortNumber textual convention of the SMIv2.";
+    reference
+     "RFC  768: User Datagram Protocol
+      RFC  793: Transmission Control Protocol
+      RFC 4960: Stream Control Transmission Protocol
+      RFC 4340: Datagram Congestion Control Protocol (DCCP)
+      RFC 4001: Textual Conventions for Internet Network Addresses";
+  }
+
+  /*** collection of types related to autonomous systems ***/
+
+  typedef as-number {
+    type uint32;
+    description
+     "The as-number type represents autonomous system numbers
+      which identify an Autonomous System (AS).  An AS is a set
+      of routers under a single technical administration, using
+      an interior gateway protocol and common metrics to route
+      packets within the AS, and using an exterior gateway
+      protocol to route packets to other ASes.  IANA maintains
+      the AS number space and has delegated large parts to the
+      regional registries.
+      Autonomous system numbers were originally limited to 16
+      bits.  BGP extensions have enlarged the autonomous system
+      number space to 32 bits.  This type therefore uses an uint32
+      base type without a range restriction in order to support
+      a larger autonomous system number space.
+      In the value set and its semantics, this type is equivalent
+      to the InetAutonomousSystemNumber textual convention of
+      the SMIv2.";
+    reference
+     "RFC 1930: Guidelines for creation, selection, and registration
+                of an Autonomous System (AS)
+      RFC 4271: A Border Gateway Protocol 4 (BGP-4)
+      RFC 4001: Textual Conventions for Internet Network Addresses
+      RFC 6793: BGP Support for Four-Octet Autonomous System (AS)
+                Number Space";
+  }
+
+  /*** collection of types related to IP addresses and hostnames ***/
+
+  typedef ip-address {
+    type union {
+      type inet:ipv4-address;
+      type inet:ipv6-address;
+    }
+    description
+     "The ip-address type represents an IP address and is IP
+      version neutral.  The format of the textual representation
+      implies the IP version.  This type supports scoped addresses
+      by allowing zone identifiers in the address format.";
+    reference
+     "RFC 4007: IPv6 Scoped Address Architecture";
+  }
+
+  typedef ipv4-address {
+    type string {
+      pattern
+        '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+      +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+      + '(%[\p{N}\p{L}]+)?';
+    }
+    description
+      "The ipv4-address type represents an IPv4 address in
+       dotted-quad notation.  The IPv4 address may include a zone
+       index, separated by a % sign.
+       The zone index is used to disambiguate identical address
+       values.  For link-local addresses, the zone index will
+       typically be the interface index number or the name of an
+       interface.  If the zone index is not present, the default
+       zone of the device will be used.
+       The canonical format for the zone index is the numerical
+       format";
+  }
+
+  typedef ipv6-address {
+    type string {
+      pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+            + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+            + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+            + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+            + '(%[\p{N}\p{L}]+)?';
+      pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+            + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+            + '(%.+)?';
+    }
+    description
+     "The ipv6-address type represents an IPv6 address in full,
+      mixed, shortened, and shortened-mixed notation.  The IPv6
+      address may include a zone index, separated by a % sign.
+      The zone index is used to disambiguate identical address
+      values.  For link-local addresses, the zone index will
+      typically be the interface index number or the name of an
+      interface.  If the zone index is not present, the default
+      zone of the device will be used.
+      The canonical format of IPv6 addresses uses the textual
+      representation defined in Section 4 of RFC 5952.  The
+      canonical format for the zone index is the numerical
+      format as described in Section 11.2 of RFC 4007.";
+    reference
+     "RFC 4291: IP Version 6 Addressing Architecture
+      RFC 4007: IPv6 Scoped Address Architecture
+      RFC 5952: A Recommendation for IPv6 Address Text
+                Representation";
+  }
+
+  typedef ip-address-no-zone {
+    type union {
+      type inet:ipv4-address-no-zone;
+      type inet:ipv6-address-no-zone;
+    }
+    description
+     "The ip-address-no-zone type represents an IP address and is
+      IP version neutral.  The format of the textual representation
+      implies the IP version.  This type does not support scoped
+      addresses since it does not allow zone identifiers in the
+      address format.";
+    reference
+     "RFC 4007: IPv6 Scoped Address Architecture";
+  }
+
+  typedef ipv4-address-no-zone {
+    type inet:ipv4-address {
+      pattern '[0-9\.]*';
+    }
+    description
+      "An IPv4 address without a zone index.  This type, derived from
+       ipv4-address, may be used in situations where the zone is
+       known from the context and hence no zone index is needed.";
+  }
+
+  typedef ipv6-address-no-zone {
+    type inet:ipv6-address {
+      pattern '[0-9a-fA-F:\.]*';
+    }
+    description
+      "An IPv6 address without a zone index.  This type, derived from
+       ipv6-address, may be used in situations where the zone is
+       known from the context and hence no zone index is needed.";
+    reference
+     "RFC 4291: IP Version 6 Addressing Architecture
+      RFC 4007: IPv6 Scoped Address Architecture
+      RFC 5952: A Recommendation for IPv6 Address Text
+                Representation";
+  }
+
+  typedef ip-prefix {
+    type union {
+      type inet:ipv4-prefix;
+      type inet:ipv6-prefix;
+    }
+    description
+     "The ip-prefix type represents an IP prefix and is IP
+      version neutral.  The format of the textual representations
+      implies the IP version.";
+  }
+
+  typedef ipv4-prefix {
+    type string {
+      pattern
+         '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+       +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+       + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
+    }
+    description
+     "The ipv4-prefix type represents an IPv4 address prefix.
+      The prefix length is given by the number following the
+      slash character and must be less than or equal to 32.
+      A prefix length value of n corresponds to an IP address
+      mask that has n contiguous 1-bits from the most
+      significant bit (MSB) and all other bits set to 0.
+      The canonical format of an IPv4 prefix has all bits of
+      the IPv4 address set to zero that are not part of the
+      IPv4 prefix.";
+  }
+
+  typedef ipv6-prefix {
+    type string {
+      pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+            + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+            + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+            + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+            + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
+      pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+            + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+            + '(/.+)';
+    }
+
+    description
+     "The ipv6-prefix type represents an IPv6 address prefix.
+      The prefix length is given by the number following the
+      slash character and must be less than or equal to 128.
+      A prefix length value of n corresponds to an IP address
+      mask that has n contiguous 1-bits from the most
+      significant bit (MSB) and all other bits set to 0.
+      The IPv6 address should have all bits that do not belong
+      to the prefix set to zero.
+      The canonical format of an IPv6 prefix has all bits of
+      the IPv6 address set to zero that are not part of the
+      IPv6 prefix.  Furthermore, the IPv6 address is represented
+      as defined in Section 4 of RFC 5952.";
+    reference
+     "RFC 5952: A Recommendation for IPv6 Address Text
+                Representation";
+  }
+
+  /*** collection of domain name and URI types ***/
+
+  typedef domain-name {
+    type string {
+      pattern
+        '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*'
+      + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)'
+      + '|\.';
+      length "1..253";
+    }
+    description
+     "The domain-name type represents a DNS domain name.  The
+      name SHOULD be fully qualified whenever possible.
+      Internet domain names are only loosely specified.  Section
+      3.5 of RFC 1034 recommends a syntax (modified in Section
+      2.1 of RFC 1123).  The pattern above is intended to allow
+      for current practice in domain name use, and some possible
+      future expansion.  It is designed to hold various types of
+      domain names, including names used for A or AAAA records
+      (host names) and other records, such as SRV records.  Note
+      that Internet host names have a stricter syntax (described
+      in RFC 952) than the DNS recommendations in RFCs 1034 and
+      1123, and that systems that want to store host names in
+      schema nodes using the domain-name type are recommended to
+      adhere to this stricter standard to ensure interoperability.
+      The encoding of DNS names in the DNS protocol is limited
+      to 255 characters.  Since the encoding consists of labels
+      prefixed by a length bytes and there is a trailing NULL
+      byte, only 253 characters can appear in the textual dotted
+      notation.
+      The description clause of schema nodes using the domain-name
+      type MUST describe when and how these names are resolved to
+      IP addresses.  Note that the resolution of a domain-name value
+      may require to query multiple DNS records (e.g., A for IPv4
+      and AAAA for IPv6).  The order of the resolution process and
+      which DNS record takes precedence can either be defined
+      explicitly or may depend on the configuration of the
+      resolver.
+      Domain-name values use the US-ASCII encoding.  Their canonical
+      format uses lowercase US-ASCII characters.  Internationalized
+      domain names MUST be A-labels as per RFC 5890.";
+    reference
+     "RFC  952: DoD Internet Host Table Specification
+      RFC 1034: Domain Names - Concepts and Facilities
+      RFC 1123: Requirements for Internet Hosts -- Application
+                and Support
+      RFC 2782: A DNS RR for specifying the location of services
+                (DNS SRV)
+      RFC 5890: Internationalized Domain Names in Applications
+                (IDNA): Definitions and Document Framework";
+  }
+
+  typedef host {
+    type union {
+      type inet:ip-address;
+      type inet:domain-name;
+    }
+    description
+     "The host type represents either an IP address or a DNS
+      domain name.";
+  }
+
+  typedef uri {
+    type string;
+    description
+     "The uri type represents a Uniform Resource Identifier
+      (URI) as defined by STD 66.
+      Objects using the uri type MUST be in US-ASCII encoding,
+      and MUST be normalized as described by RFC 3986 Sections
+      6.2.1, 6.2.2.1, and 6.2.2.2.  All unnecessary
+      percent-encoding is removed, and all case-insensitive
+      characters are set to lowercase except for hexadecimal
+      digits, which are normalized to uppercase as described in
+      Section 6.2.2.1.
+      The purpose of this normalization is to help provide
+      unique URIs.  Note that this normalization is not
+      sufficient to provide uniqueness.  Two URIs that are
+      textually distinct after this normalization may still be
+      equivalent.
+      Objects using the uri type may restrict the schemes that
+      they permit.  For example, 'data:' and 'urn:' schemes
+      might not be appropriate.
+      A zero-length URI is not a valid URI.  This can be used to
+      express 'URI absent' where required.
+      In the value set and its semantics, this type is equivalent
+      to the Uri SMIv2 textual convention defined in RFC 5017.";
+    reference
+     "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
+      RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
+                Group: Uniform Resource Identifiers (URIs), URLs,
+                and Uniform Resource Names (URNs): Clarifications
+                and Recommendations
+      RFC 5017: MIB Textual Conventions for Uniform Resource
+                Identifiers (URIs)";
+  }
+
+}
diff --git a/sdnr/wt/common-yang/utils/src/test/yang/test-yang-utils.yang b/sdnr/wt/common-yang/utils/src/test/yang/test-yang-utils.yang
new file mode 100644 (file)
index 0000000..eb62a85
--- /dev/null
@@ -0,0 +1,79 @@
+module test-yang-utils {
+
+  yang-version 1.1;
+  namespace "urn:test:yang:utils";
+  prefix tesyangutils;
+  
+  import ietf-yang-types {
+    prefix yang;
+    reference
+      "RFC 6991: Common YANG Data Types.";
+  }
+  
+  import ietf-inet-types {
+    prefix inet;
+  }
+  
+  typedef AddressType {
+     type enumeration {
+       enum OFFICE {
+         description 
+            "Office Address";
+       }
+       enum HOME {
+         description 
+            "Home Address";
+       }
+     }
+  }
+  
+  identity item-code {
+    description
+      "Base identity";
+  }
+
+  typedef item-code {
+    type identityref {
+      base item-code;
+    }
+    description
+      "Item code - Could be bar code, QR code or any other code to uniquely identify an item";
+  }
+  
+  grouping address-location-entity {
+    leaf id {
+      type string;
+      description 
+         "Unique ID of the address";
+    }
+    leaf address-type {
+      type AddressType;
+      description 
+          "Type of Address";
+    }
+    leaf delivery-date-time {
+      type yang:date-and-time;
+      description
+        "Package delivery date and time";
+    }
+    leaf delivery-url {
+      type inet:uri;
+      description 
+        "Delivery URL";
+    }
+    list item-list {
+      key "item-key";
+      leaf item-key {
+        type item-code;
+      }
+      description 
+        "Unique code of the ordered item";
+    }
+  }
+  
+  container address-location {
+      description 
+         "builder";
+      uses address-location-entity;
+  }
+}
\ No newline at end of file
index 11fb27c..cda4e97 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -62,6 +63,7 @@
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
         <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.elasticsearch.client</groupId>
             <artifactId>elasticsearch-rest-client</artifactId>
         </dependency>
-<!--         <dependency> -->
-<!--             <groupId>com.fasterxml.jackson.core</groupId> -->
-<!--             <artifactId>jackson-core</artifactId> -->
-<!--         </dependency> -->
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-annotations</artifactId>
+            <scope>provided</scope>
         </dependency>
-<!--         <dependency> -->
-<!--             <groupId>com.fasterxml.jackson.core</groupId> -->
-<!--             <artifactId>jackson-databind</artifactId> -->
-<!--         </dependency> -->
-        <dependency>
-              <groupId>com.google.code.findbugs</groupId>
-              <artifactId>annotations</artifactId>
-        </dependency>
+               <dependency>
+                       <groupId>com.google.code.findbugs</groupId>
+                       <artifactId>annotations</artifactId>
+                       <scope>provided</scope>
+               </dependency>
     </dependencies>
 
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.jacoco</groupId>
-                <artifactId>jacoco-maven-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>**/gen/**</exclude>
-                        <exclude>**/generated-sources/**</exclude>
-                        <exclude>**/yang-gen-sal/**</exclude>
-                        <exclude>**/pax/**</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
             <plugin>
                 <groupId>com.github.alexcojocaru</groupId>
                 <artifactId>elasticsearch-maven-plugin</artifactId>
index 529853e..233f48f 100644 (file)
@@ -23,7 +23,9 @@ package org.onap.ccsdk.features.sdnr.wt.common.database;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 public class SearchResult<T> {
 
@@ -53,6 +55,9 @@ public class SearchResult<T> {
     public List<T> getHits() {
         return this.hits;
     }
+    public Set<T> getHitSets() {
+        return new HashSet<>(this.hits);
+    }
 
     public long getTotal() {
         return this.total;
index b73d3ea..914ee1c 100644 (file)
 package org.onap.ccsdk.features.sdnr.wt.common.database.data;
 
 import java.text.ParseException;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 /**
index c163fac..2f052d6 100644 (file)
@@ -26,7 +26,5 @@ public abstract class GenericRunnableFactory<T,S> {
     public GenericRunnableFactory() {
     }
 
-    public Runnable create(S arg, GenericRunnableFactoryCallback<T> callback) {
-        return null;
-    }
+    public abstract Runnable create(final T key, final S arg);
 }
index f41a903..f507eec 100644 (file)
@@ -23,23 +23,27 @@ package org.onap.ccsdk.features.sdnr.wt.common.threading;
 
 import java.util.AbstractMap.SimpleEntry;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.Queue;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Threadpool for running n instances per key T
  *
  * @author jack
  *
- * @param <T>
- * @param <S>
+ * @param <T> type of key for the pools
+ * @param <S> type of arg to create a runner
  */
 public class KeyBasedThreadpool<T, S> implements GenericRunnableFactoryCallback<T> {
 
+    private static final Logger LOG = LoggerFactory.getLogger(KeyBasedThreadpool.class);
     private final Queue<Entry<T, S>> queue;
     private final List<T> runningKeys;
     private final int keyPoolSize;
@@ -57,37 +61,80 @@ public class KeyBasedThreadpool<T, S> implements GenericRunnableFactoryCallback<
         this.keyPoolSize = keyPoolSize;
         this.factory = factory;
         this.executor = Executors.newFixedThreadPool(poolSize);
-        this.runningKeys = new ArrayList<>();
+        this.runningKeys = Collections.synchronizedList(new ArrayList<T>());
+        LOG.info("starting key-based threadpool with keysize={} and size={}", keyPoolSize, poolSize);
     }
 
     public void execute(T key, S arg) {
         if (this.isKeyPoolSizeReached(key)) {
+            LOG.debug("pool size for key {} reached. add to queue", key);
             queue.add(new SimpleEntry<>(key, arg));
+
         } else {
+            LOG.debug("starting executor for key {}.", key);
             this.runningKeys.add(key);
-            this.executor.execute(this.factory.create(arg, this));
+            this.executor.execute(new RunnableWrapper<T>(this.factory.create(key, arg), key, this));
         }
 
     }
 
     private void executeNext() {
         Entry<T, S> entry = this.queue.peek();
-        if (!this.isKeyPoolSizeReached(entry.getKey())) {
-            this.queue.poll();
-            this.runningKeys.add(entry.getKey());
-            this.executor.execute(this.factory.create(entry.getValue(), this));
+        if (entry != null) {
+            LOG.debug("executing next for key {} with arg {}", entry.getKey(), entry.getValue());
+            if (!this.isKeyPoolSizeReached(entry.getKey())) {
+                this.queue.poll();
+                this.runningKeys.add(entry.getKey());
+                this.executor.execute(new RunnableWrapper<T>(this.factory.create(entry.getKey(), entry.getValue()),
+                        entry.getKey(), this));
+            } else {
+                LOG.debug("key pool size reached. waiting for someone else to stop");
+            }
+        } else {
+            LOG.info("nothing to execute. queue is empty.");
         }
     }
 
     private boolean isKeyPoolSizeReached(T key) {
+        LOG.trace("running keys size={}", this.runningKeys.size());
         return this.runningKeys.stream().filter(e -> e == key).count() >= this.keyPoolSize;
     }
 
     @Override
-    public void onFinish(T key) {
+    public synchronized void onFinish(T key) {
+        LOG.debug("executor finished for key {}.", key);
         this.runningKeys.remove(key);
         this.executeNext();
     }
 
+    public void join() {
+        LOG.debug("wait for all executors to finish");
+        while (this.runningKeys.size() > 0 && this.queue.size() > 0) {
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+            }
+        }
+    }
+
+    private static class RunnableWrapper<T> implements Runnable {
+
+        private final Runnable inner;
+        private final GenericRunnableFactoryCallback<T> callback;
+        private final T key;
 
+        public RunnableWrapper(Runnable inner, T key, GenericRunnableFactoryCallback<T> cb) {
+            this.inner = inner;
+            this.callback = cb;
+            this.key = key;
+        }
+
+        @Override
+        public void run() {
+            this.inner.run();
+            this.callback.onFinish(this.key);
+        }
+
+    }
 }
index 3584d7f..253b790 100644 (file)
@@ -25,7 +25,9 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+import com.sun.net.httpserver.HttpServer;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.InetSocketAddress;
@@ -33,18 +35,12 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.common.http.BaseHTTPClient;
 import org.onap.ccsdk.features.sdnr.wt.common.http.BaseHTTPResponse;
 
-import com.sun.net.httpserver.HttpExchange;
-import com.sun.net.httpserver.HttpHandler;
-import com.sun.net.httpserver.HttpServer;
-
-@SuppressWarnings("restriction")
 public class TestBaseHttpClient {
 
     public static final String HTTPMETHOD_GET = "GET";
diff --git a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestKeybasedThreadpool.java b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestKeybasedThreadpool.java
new file mode 100644 (file)
index 0000000..8682756
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
+ * All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.common.test;
+
+import java.util.Random;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.threading.GenericRunnableFactory;
+import org.onap.ccsdk.features.sdnr.wt.common.threading.KeyBasedThreadpool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TestKeybasedThreadpool {
+
+
+    private static final Logger LOG  = LoggerFactory.getLogger(TestKeybasedThreadpool.class);
+    private static final String KEY_A = "a";
+    private static final String KEY_B = "b";
+    private static final String KEY_C = "c";
+    private static final String KEY_D = "d";
+
+    @Ignore
+    @Test
+    public void test1() {
+        GenericRunnableFactory<String, TestClass> factory1 =
+                new GenericRunnableFactory<String, TestKeybasedThreadpool.TestClass>() {
+                    @Override
+                    public Runnable create(final String key, final TestClass arg) {
+                        return new Runnable() {
+
+                            @Override
+                            public void run() {
+                                final String key2 = arg.value;
+                                final long sleep = arg.sleep;
+                                LOG.info("{}: sleeping now for {} seconds",key2, sleep);
+                                try {
+                                    Thread.sleep(sleep*1000);
+                                } catch (InterruptedException e) {
+                                    LOG.error("InterruptedException",e);
+                                    Thread.currentThread().interrupt();
+                                }
+                                LOG.info("{}: finished",key2);
+                            }
+                        };
+                    }
+                };
+        LOG.info("starting");
+        KeyBasedThreadpool<String, TestClass> threadpool = new KeyBasedThreadpool<String, TestClass>(10, 1, factory1);
+        threadpool.execute(KEY_A, new TestClass(KEY_A));
+        threadpool.execute(KEY_A, new TestClass(KEY_A));
+        threadpool.execute(KEY_A, new TestClass(KEY_A));
+        threadpool.execute(KEY_B, new TestClass(KEY_B));
+        threadpool.execute(KEY_C, new TestClass(KEY_C));
+        threadpool.execute(KEY_D, new TestClass(KEY_D));
+        threadpool.execute(KEY_D, new TestClass(KEY_D));
+        threadpool.join();
+        LOG.info("done");
+    }
+
+    private static int counter=0;
+
+
+    public class TestClass {
+        protected final long sleep;
+        private final String value;
+
+        public TestClass(String value) {
+
+            this.value = value+ String.valueOf(counter++);
+            Random rnd = new Random();
+            this.sleep = rnd.nextInt(20);
+            LOG.info("instatiate {}",this);
+        }
+
+        @Override
+        public String toString() {
+            return "TestClass [sleep=" + sleep + ", value=" + value + "]";
+        }
+    }
+}
index a3d2c9b..6913ec2 100644 (file)
@@ -45,7 +45,6 @@ import org.junit.Before;
 import org.onap.ccsdk.features.sdnr.wt.common.test.ServletInputStreamFromByteArrayInputStream;
 import org.onap.ccsdk.features.sdnr.wt.common.test.ServletOutputStreamToStringWriter;
 
-@SuppressWarnings("restriction")
 public class HelpServletBase {
 
     public static final String RESPONSE_GET = "This is the response get";
index 3e73290..073d95a 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 20b86e6..fbd105a 100644 (file)
@@ -48,6 +48,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.pro
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadEventlogListOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultcurrentListOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadFaultlogListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadGuiCutThroughEntryOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadGuiCutThroughEntryOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadInventoryListOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadMaintenanceListOutputBuilder;
@@ -102,7 +103,7 @@ public interface DatabaseDataProvider {
 
     ReadPmdata24hDeviceListOutputBuilder readPmdata24hDeviceList(EntityInput input) throws IOException;
 
-    ReadStatusOutputBuilder readStatus() throws IOException;
+    ReadStatusOutputBuilder readStatus(EntityInput input) throws IOException;
 
     boolean waitForYellowDatabaseStatus(long timeout, TimeUnit unit);
 
index 1bb30dc..cabe6be 100644 (file)
@@ -297,7 +297,7 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
         outputBuilder.setPagination(
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.ltp.list.output.PaginationBuilder(
                         result.getPagination()).build());
-        outputBuilder.setData(result.getResult());
+        outputBuilder.setData(result.getResultSet());
         return outputBuilder;
     }
 
@@ -308,7 +308,7 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
         outputBuilder.setPagination(
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.device.list.output.PaginationBuilder(
                         result.getPagination()).build());
-        outputBuilder.setData(result.getResult());
+        outputBuilder.setData(result.getResultSet());
         return outputBuilder;
     }
 
@@ -322,7 +322,7 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
         outputBuilder.setPagination(
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.ltp.list.output.PaginationBuilder(
                         result.getPagination()).build());
-        outputBuilder.setData(result.getResult());
+        outputBuilder.setData(result.getResultSet());
         return outputBuilder;
     }
 
@@ -335,14 +335,14 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
         outputBuilder.setPagination(
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.device.list.output.PaginationBuilder(
                         result.getPagination()).build());
-        outputBuilder.setData(result.getResult());
+        outputBuilder.setData(result.getResultSet());
         return outputBuilder;
     }
 
     @Override
-    public ReadStatusOutputBuilder readStatus() throws IOException {
+    public ReadStatusOutputBuilder readStatus(EntityInput input) throws IOException {
         QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.Data> result =
-                readStatus.getDataStatus();
+                readStatus.getDataStatus(input);
 
         ReadStatusOutputBuilder outputBuilder = new ReadStatusOutputBuilder();
         outputBuilder.setData(result.getResult());
@@ -352,7 +352,7 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
     @Override
     public CreateNetworkElementConnectionOutputBuilder createNetworkElementConnection(
             NetworkElementConnectionEntity input) throws IOException {
-        String id = this.networkelementConnectionRW.write(input, input.getNodeId());
+        String id = this.networkelementConnectionRW.updateOrInsert(input, input.getNodeId());
         if (id == null) {
             throw new IOException(EXCEPTION_UNABLE_TO_WRITE_IN_DATABASE);
         }
index c817250..db4e980 100644 (file)
 package org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.data.rpctypehelper;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PaginationOutputG;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.connectionlog.list.output.PaginationBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
@@ -43,8 +46,11 @@ public class QueryResult<T> {
         pagination = x.build();
     }
 
+    public Set<T> getResultSet() {
+        return new HashSet<>(this.result);
+    }
     public List<T> getResult() {
-        return result;
+        return this.result;
     }
 
     public PaginationOutputG getPagination() {
index 19323b9..1c24636 100644 (file)
@@ -33,6 +33,8 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query.filters.DBKeyValuePair;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapper;
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapperHelper;
@@ -40,7 +42,6 @@ import org.onap.ccsdk.features.sdnr.wt.yang.mapper.mapperextensions.YangToolsBui
 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.mapperextensions.YangToolsDeserializerModifier;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity;
-import org.opendaylight.yangtools.concepts.Builder;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.Enumeration;
 import org.opendaylight.yangtools.yang.common.Uint16;
@@ -223,7 +224,7 @@ public class SqlDBMapper {
         String type = mariaDBTypeMap.getOrDefault(valueType, null);
         if (type == null) {
             if (implementsInterface(valueType, DataObject.class) || implementsInterface(valueType, List.class)
-                    || implementsInterface(valueType, Map.class)) {
+                    || implementsInterface(valueType, Map.class) || implementsInterface(valueType, Set.class)) {
                 return "JSON";
             }
             if (implementsInterface(valueType, Enumeration.class)) {
@@ -352,13 +353,13 @@ public class SqlDBMapper {
     }
 
     @SuppressWarnings("unchecked")
-    public static <T> List<T> read(ResultSet data, Class<T> clazz, String column)
+    public static <S,T> List<T> read(ResultSet data, Class<T> clazz, String column)
             throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, SQLException,
             InstantiationException, SecurityException, NoSuchMethodException, JsonProcessingException {
         if(data==null) {
             return Arrays.asList();
         }
-        Builder<T> builder = findPOJOBuilder(clazz);
+        S builder = findPOJOBuilder(clazz);
         if(builder==null && column==null) {
             throw new InstantiationException("unable to find builder for class "+clazz.getName());
         }
@@ -374,7 +375,7 @@ public class SqlDBMapper {
                     m.setAccessible(true);
                     m.invoke(builder, getValueOrDefault(data, col, argType, null));
                 }
-                list.add(builder.build());
+                list.add(callBuild(builder));
             } else {
                 Object value = getValueOrDefault(data, column, clazz, null);
                 if (value != null) {
@@ -386,7 +387,13 @@ public class SqlDBMapper {
     }
 
     @SuppressWarnings("unchecked")
-    private static <T> Builder<T> findPOJOBuilder(Class<T> ac) throws InstantiationException, IllegalAccessException,
+       private static <S,T> T callBuild(S builder) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+       Method method = builder.getClass().getMethod("build");
+               return (T) method.invoke(builder);
+       }
+
+       @SuppressWarnings("unchecked")
+    private static <S,T> S findPOJOBuilder(Class<T> ac) throws InstantiationException, IllegalAccessException,
             IllegalArgumentException, InvocationTargetException, SecurityException, NoSuchMethodException {
         try {
             String builder = null;
@@ -400,8 +407,8 @@ public class SqlDBMapper {
             }
             if (builder != null) {
                 Class<?> innerBuilder = YangToolsMapperHelper.findClass(builder);
-                Class<Builder<T>> builderClass = (Class<Builder<T>>) innerBuilder;
-                return builderClass.getDeclaredConstructor().newInstance();
+                //Class<Builder<T>> builderClass = (Class<Builder<T>>) innerBuilder;
+                return (S) innerBuilder.getDeclaredConstructor().newInstance();
             }
         } catch (ClassNotFoundException e) {
 
index b0b169d..75d8c9a 100644 (file)
@@ -24,11 +24,16 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.database;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Arrays;
+import java.util.Map;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.SqlDBClient;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.data.rpctypehelper.QueryResult;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query.SqlQuery;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionLogStatus;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.Data;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.DataBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.status.entity.FaultsBuilder;
@@ -49,8 +54,8 @@ public class SqlDBStatusReader {
         this.controllerId = controllerId;
     }
 
-    public QueryResult<Data> getDataStatus() {
-        String selectQuery = createCountQuery("severity", Entity.Faultcurrent, this.controllerId);
+    public QueryResult<Data> getDataStatus(EntityInput input) {
+        String selectQuery = createCountQuery("severity", Entity.Faultcurrent, this.controllerId, input);
         long criticalCount = 0;
         long majorCount = 0;
         long minorCount = 0;
@@ -81,7 +86,7 @@ public class SqlDBStatusReader {
         DataBuilder builder = new DataBuilder().setFaults(
                 new FaultsBuilder().setCriticals(Uint32.valueOf(criticalCount)).setMajors(Uint32.valueOf(majorCount))
                         .setMinors(Uint32.valueOf(minorCount)).setWarnings(Uint32.valueOf(warningCount)).build());
-        selectQuery = createCountQuery("status", Entity.NetworkelementConnection, this.controllerId);
+        selectQuery = createCountQuery("status", Entity.NetworkelementConnection, this.controllerId, input);
         NetworkElementConnectionsBuilder neBuilder = new NetworkElementConnectionsBuilder();
         String state;
         long connectedCount = 0, connectingCount = 0, disconnectedCount = 0, mountedCount = 0, unableToConnectCount = 0,
@@ -123,10 +128,11 @@ public class SqlDBStatusReader {
         return new QueryResult<Data>(Arrays.asList(builder.build()), 1, 1, 1);
     }
 
-    private static String createCountQuery(String key, Entity e, String controllerId) {
+    private static String createCountQuery(String key, Entity e, String controllerId, EntityInput input) {
+        Map<FilterKey, Filter> filter = input != null ? input.getFilter() : null;
         return String.format("SELECT `%s`, COUNT(`%s`) " + "FROM `%s` " + "%s " + "GROUP BY `%s`;", key, key,
                 e.getName(),
-                controllerId != null ? String.format("WHERE `%s`='%s'", SqlDBMapper.ODLID_DBCOL, controllerId) : "",
+                SqlQuery.getWhereExpression(filter!=null?filter.values():null, controllerId),
                 key);
     }
 
index 6403a5c..a4df26b 100644 (file)
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.stream.Collectors;
 import org.eclipse.jdt.annotation.Nullable;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.database.SqlDBMapper;
@@ -114,7 +115,7 @@ public class SelectQuery implements SqlQuery {
 
     private static Filter cleanFilter(Filter filter) {
         final String sFilter = filter.getFiltervalue();
-        final List<String> sFilters = filter.getFiltervalues();
+        final Set<String> sFilters = filter.getFiltervalues();
         //if only single filter value is set
         if (sFilter != null && (sFilters == null || sFilter.isEmpty())) {
             return "*".equals(filter.getFiltervalue()) ? null : filter;
@@ -128,7 +129,7 @@ public class SelectQuery implements SqlQuery {
             } ;
             return new FilterBuilder().setProperty(filter.getProperty()).setFiltervalue(filter.getFiltervalue())
                     .setFiltervalues(
-                            filter.getFiltervalues().stream().filter(e -> !"*".equals(e)).collect(Collectors.toList()))
+                            filter.getFiltervalues().stream().filter(e -> !"*".equals(e)).collect(Collectors.toSet()))
                     .build();
         }
     }
index 3e26d09..c954faa 100644 (file)
@@ -24,18 +24,22 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
+import java.util.Collection;
 import java.util.Date;
 import java.util.List;
+import java.util.Set;
 import java.util.TimeZone;
 import java.util.stream.Collectors;
 import org.eclipse.jdt.annotation.Nullable;
 import org.onap.ccsdk.features.sdnr.wt.common.database.data.DbFilter;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.database.SqlDBMapper;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query.filters.DBFilterKeyValuePair;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query.filters.RangeSqlDBFilter;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query.filters.RegexSqlDBFilter;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter;
+import io.netty.util.internal.StringUtil;
 
 public interface SqlQuery {
 
@@ -50,18 +54,25 @@ public interface SqlQuery {
     static final boolean DEFAULT_IGNORE_CONTROLLERID = false;
     static final boolean DEFAULT_IGNORE_ID_FIELD = false;
 
-    public static String getWhereExpression(List<Filter> filters) {
-        if (filters == null) {
+    public static String getWhereExpression(Collection<Filter> filters) {
+        return getWhereExpression(filters, null);
+    }
+    public static String getWhereExpression(Collection<Filter> filters, String controllerId) {
+        if (filters == null && controllerId == null) {
             return "";
         }
         StringBuilder sb = new StringBuilder();
-        filters = filters.stream().filter(e -> !"*".equals(e.getFiltervalue())).collect(Collectors.toList());
-        if (!filters.isEmpty()) {
-
-            sb.append(" WHERE (" + getFilterExpression(filters.get(0)) + ")");
-            for (int i = 1; i < filters.size(); i++) {
-                sb.append(" AND (" + getFilterExpression(filters.get(i)) + ")");
-            }
+        List<String> filters2 =
+                filters != null
+                        ? filters.stream().filter(e -> !"*".equals(e.getFiltervalue())).map(e -> getFilterExpression(e))
+                                .collect(Collectors.toList())
+                        : new ArrayList<>();
+        if(controllerId!=null) {
+            filters2.add(getFilterExpression(SqlDBMapper.ODLID_DBCOL, controllerId));
+        }
+        if (!filters2.isEmpty() ) {
+            sb.append(" WHERE ");
+            sb.append(StringUtil.join(" AND ", filters2));
         }
         return sb.toString();
     }
@@ -107,7 +118,7 @@ public interface SqlQuery {
         return new DBFilterKeyValuePair(property, value).getFilterExpression();
     }
 
-    static List<String> collectValues(String filtervalue, List<String> filtervalues) {
+    static List<String> collectValues(String filtervalue, Set<String> filtervalues) {
         if (filtervalues == null) {
             return Arrays.asList(filtervalue);
         }
index 4ef1b9a..65e0c54 100644 (file)
@@ -21,7 +21,7 @@
  */
 package org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query.filters;
 
-public class RegexSqlDBFilter extends DBKeyValuePair<String> implements SqlDBFilter{
+public class RegexSqlDBFilter extends DBKeyValuePair<String> implements SqlDBFilter {
 
 
     public RegexSqlDBFilter(String key, String value) {
@@ -32,4 +32,11 @@ public class RegexSqlDBFilter extends DBKeyValuePair<String> implements SqlDBFil
     public String getFilterExpression() {
         return String.format("`%s` RLIKE '%s'", this.getKey(), this.getValue());
     }
+
+    @Override
+    public String getValue() {
+        String value = super.getValue();
+        return value != null ? value.replace("*", ".*") : null;
+    }
 }
+
index c9cf27c..34c4d6f 100644 (file)
@@ -183,7 +183,8 @@ public class TestMariaDataProvider {
         assertEquals(2, faultCurrents.getData().size());
         ReadStatusOutputBuilder status = null;
         try {
-            status = dbProvider.readStatus();
+            EntityInput input=null;
+            status = dbProvider.readStatus(input);
         } catch (IOException e) {
             e.printStackTrace();
             fail("failed to read status");
@@ -567,7 +568,8 @@ public class TestMariaDataProvider {
 
         ReadStatusOutputBuilder status = null;
         try {
-            status = dbProvider.readStatus();
+            EntityInput input=null;
+            status = dbProvider.readStatus(input);
         } catch (IOException e) {
             e.printStackTrace();
             fail("failed to read status");
index 576a382..7dd2464 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * ============LICENSE_START=======================================================
+/* ============LICENSE_START=======================================================
  * ONAP : ccsdk features
  * ================================================================================
  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
@@ -27,6 +26,8 @@ import static org.junit.Assert.assertTrue;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
+
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query.CountQuery;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.query.SelectQuery;
@@ -169,7 +170,7 @@ public class TestQuerySyntax {
     public void testSelectForFilterValues() {
         EntityInput input = new ReadGuiCutThroughEntryInputBuilder()
                 .setFilter(YangToolsMapperHelper.toMap(Arrays.asList(
-                        new FilterBuilder().setProperty("id").setFiltervalues(Arrays.asList("das", "das2")).build())))
+                        new FilterBuilder().setProperty("id").setFiltervalues(Set.of("das", "das2")).build())))
                 .setPagination(new PaginationBuilder().setSize(Uint32.valueOf(20)).setPage(Uint64.valueOf(1)).build())
                 .build();
         SelectQuery query = new SelectQuery(TABLENAME1, input, CONTROLLERID);
@@ -190,7 +191,7 @@ public class TestQuerySyntax {
     public void testSelectForFilterValues3() {
         EntityInput input = new ReadGuiCutThroughEntryInputBuilder()
                 .setFilter(YangToolsMapperHelper.toMap(Arrays.asList(
-                        new FilterBuilder().setProperty("id").setFiltervalues(Arrays.asList("*","abc")).build())))
+                        new FilterBuilder().setProperty("id").setFiltervalues(Set.of("*","abc")).build())))
                 .setPagination(new PaginationBuilder().setSize(Uint32.valueOf(20)).setPage(Uint64.valueOf(1)).build())
                 .build();
         SelectQuery query = new SelectQuery(TABLENAME1, input, CONTROLLERID);
@@ -201,8 +202,8 @@ public class TestQuerySyntax {
     public void testSelectForFilterValues4() {
         EntityInput input = new ReadGuiCutThroughEntryInputBuilder()
                 .setFilter(YangToolsMapperHelper.toMap(Arrays.asList(
-                        new FilterBuilder().setProperty("id").setFiltervalues(Arrays.asList("abc")).build(),
-                        new FilterBuilder().setProperty("node-id").setFiltervalues(Arrays.asList("*")).build())))
+                        new FilterBuilder().setProperty("id").setFiltervalues(Set.of("abc")).build(),
+                        new FilterBuilder().setProperty("node-id").setFiltervalues(Set.of("*")).build())))
                 .setPagination(new PaginationBuilder().setSize(Uint32.valueOf(20)).setPage(Uint64.valueOf(1)).build())
                 .build();
         SelectQuery query = new SelectQuery(TABLENAME1, input, CONTROLLERID);
@@ -210,6 +211,20 @@ public class TestQuerySyntax {
         assertFalse(query.toSql().contains("RLIKE"));
     }
     @Test
+    public void testSelectForFilterValues5() {
+        EntityInput input = new ReadGuiCutThroughEntryInputBuilder()
+                .setFilter(YangToolsMapperHelper.toMap(Arrays.asList(
+                        new FilterBuilder().setProperty("id").setFiltervalues(Set.of("abc")).build(),
+                        new FilterBuilder().setProperty("node-id").setFiltervalues(Set.of("*ran*")).build())))
+                .setPagination(new PaginationBuilder().setSize(Uint32.valueOf(20)).setPage(Uint64.valueOf(1)).build())
+                .build();
+        SelectQuery query = new SelectQuery(TABLENAME1, input, CONTROLLERID);
+        System.out.println(query.toSql());
+        assertTrue(query.toSql().contains("RLIKE"));
+        assertTrue(query.toSql().contains(".*"));
+
+    }
+    @Test
     public void testCount() {
         CountQuery query = new CountQuery(Entity.Eventlog, TestMariaDataProvider.createInput(1, 20));
         String sQuery = query.toSql();
index 1a8d0fd..d6a0c4d 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index fd50c90..6160686 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index d5a6fc7..a673741 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -59,6 +60,7 @@
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-common</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
@@ -68,6 +70,7 @@
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 
index 8b905f4..72ac45a 100644 (file)
@@ -2018,6 +2018,9 @@ module data-provider {
   rpc read-status {
     description
       "Read status information of controller";
+    input {
+      uses entity-input;
+    }
     output {
       list data {
         uses status-entity;
index 9530b10..fb3a000 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 2120641..cc43133 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -60,6 +61,7 @@
         <dependency>
             <groupId>org.apache.karaf.bundle</groupId>
             <artifactId>org.apache.karaf.bundle.core</artifactId>
+             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
@@ -90,6 +92,7 @@
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-annotations</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
+             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.karaf.shell</groupId>
index cb0f22d..a10864c 100644 (file)
@@ -24,6 +24,7 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import java.io.IOException;
 import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
 import java.util.List;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -92,7 +93,7 @@ public class EsDataObjectReaderWriter2<T extends DataObject> {
      * @param syncAfterWrite
      * @throws ClassNotFoundException
      */
-    public <X extends T, @NonNull B extends Builder<X>> EsDataObjectReaderWriter2(DatabaseClient db,
+    public <X extends T, B> EsDataObjectReaderWriter2(DatabaseClient db,
             String dataTypeName, @Nonnull Class<T> clazz, @Nullable Class<B> builderClazz, boolean syncAfterWrite)
             throws ClassNotFoundException {
         LOG.info("Create {} for datatype {} class {}", this.getClass().getName(), dataTypeName, clazz.getName());
@@ -111,13 +112,13 @@ public class EsDataObjectReaderWriter2<T extends DataObject> {
     public void setFullsizeRequest(boolean fullsizeRequest) {
         this.doFullsizeRequest = fullsizeRequest;
     }
-    public <X extends T, @NonNull B extends Builder<X>> EsDataObjectReaderWriter2(DatabaseClient db,
+    public <X extends T, B> EsDataObjectReaderWriter2(DatabaseClient db,
             Entity dataTypeName, @Nonnull Class<T> clazz, @Nullable Class<B> builderClazz)
             throws ClassNotFoundException {
         this(db, dataTypeName.getName(), clazz, builderClazz, false);
     }
 
-    public <X extends T, @NonNull B extends Builder<X>> EsDataObjectReaderWriter2(DatabaseClient db,
+    public <X extends T, B> EsDataObjectReaderWriter2(DatabaseClient db,
             Entity dataTypeName, @Nonnull Class<T> clazz, @Nullable Class<B> builderClazz, boolean syncAfterWrite)
             throws ClassNotFoundException {
         this(db, dataTypeName.getName(), clazz, builderClazz, syncAfterWrite);
@@ -160,20 +161,20 @@ public class EsDataObjectReaderWriter2<T extends DataObject> {
      * @return this for further operations.
      * @throws SecurityException if no access or IllegalArgumentException if wrong type or no attribute with this name.
      */
-    public EsDataObjectReaderWriter2<T> setEsIdAttributeName(String esIdAttributeName) {
+    public <B> EsDataObjectReaderWriter2<T> setEsIdAttributeName(String esIdAttributeName) {
         LOG.debug("Set attribute '{}'", esIdAttributeName);
         this.esIdAddAtributteName = null; // Reset status
         this.field = null;
 
         Field attributeField;
         try {
-            Builder<? extends T> builder = yangtoolsMapper.getBuilder(clazz);
+            B builder = yangtoolsMapper.getBuilder(clazz);
             if (builder == null) {
                 String msg = "No builder for " + clazz;
                 LOG.debug(msg);
                 throw new IllegalArgumentException(msg);
             } else {
-                T object = builder.build();
+                T object = YangToolsMapperHelper.callBuild(builder);
                 attributeField = object.getClass().getDeclaredField(esIdAttributeName);
                 if (attributeField.getType().equals(String.class)) {
                     attributeField.setAccessible(true);
@@ -193,7 +194,19 @@ public class EsDataObjectReaderWriter2<T extends DataObject> {
         } catch (SecurityException e) {
             LOG.debug("Access problem " + esIdAttributeName, e);
             throw e;
-        }
+        } catch (NoSuchMethodException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               } catch (IllegalAccessException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               } catch (IllegalArgumentException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               } catch (InvocationTargetException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
         return this;
     }
 
index 5811550..9a4033b 100644 (file)
@@ -26,14 +26,15 @@ import org.onap.ccsdk.features.sdnr.wt.common.database.ExtRestClient;
 import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
 import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
 import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
-import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.SearchRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.AggregationEntries;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch.data.rpctypehelper.QueryByFilter;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch.data.rpctypehelper.QueryResult;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionLogStatus;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.Data;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.DataBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.status.entity.FaultsBuilder;
@@ -54,9 +55,11 @@ public class DataObjectAcessorStatus extends DataObjectAcessor<Data> {
 
     }
 
-    public QueryResult<Data> getDataStatus() throws IOException {
+    public QueryResult<Data> getDataStatus(EntityInput input) throws IOException {
         SearchRequest request = getNewInstanceOfSearchRequest(Entity.Faultcurrent);
-        QueryBuilder query = QueryBuilders.matchAllQuery().aggregations(ESDATATYPE_FAULTCURRENT_SEVERITY_KEY).size(0);
+        QueryByFilter queryByFilter = new QueryByFilter(input);
+        QueryBuilder query = queryByFilter.getQueryBuilderByFilter();
+        query.aggregations(ESDATATYPE_FAULTCURRENT_SEVERITY_KEY).size(0);
         if(this.doFullsizeRequest) {
             query.doFullsizeRequest();
         }
@@ -71,7 +74,7 @@ public class DataObjectAcessorStatus extends DataObjectAcessor<Data> {
                         .setWarnings(YangHelper2.getLongOrUint32(aggs.getOrDefault("Warning", 0L))).build());
 
         request = getNewInstanceOfSearchRequest(Entity.NetworkelementConnection);
-        query = QueryBuilders.matchAllQuery().aggregations(ESDATATYPE_NECON_CONNECTIONSTATE_KEY).size(0);
+        query.aggregations(ESDATATYPE_NECON_CONNECTIONSTATE_KEY).size(0);
         if(this.doFullsizeRequest) {
             query.doFullsizeRequest();
         }
index 38ea804..753930c 100644 (file)
@@ -352,7 +352,7 @@ public class ElasticSearchDataProvider implements DatabaseDataProvider {
         outputBuilder.setPagination(
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.ltp.list.output.PaginationBuilder(
                         result.getPagination()).build());
-        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setData(result.getResult().getHitSets());
         return outputBuilder;
     }
 
@@ -363,7 +363,7 @@ public class ElasticSearchDataProvider implements DatabaseDataProvider {
         outputBuilder.setPagination(
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.device.list.output.PaginationBuilder(
                         result.getPagination()).build());
-        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setData(result.getResult().getHitSets());
         return outputBuilder;
     }
 
@@ -377,7 +377,7 @@ public class ElasticSearchDataProvider implements DatabaseDataProvider {
         outputBuilder.setPagination(
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.ltp.list.output.PaginationBuilder(
                         result.getPagination()).build());
-        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setData(result.getResult().getHitSets());
         return outputBuilder;
     }
 
@@ -390,14 +390,15 @@ public class ElasticSearchDataProvider implements DatabaseDataProvider {
         outputBuilder.setPagination(
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._24h.device.list.output.PaginationBuilder(
                         result.getPagination()).build());
-        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setData(result.getResult().getHitSets());
         return outputBuilder;
     }
 
+
     @Override
-    public ReadStatusOutputBuilder readStatus() throws IOException {
+    public ReadStatusOutputBuilder readStatus(EntityInput input) throws IOException {
         QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.Data> result =
-                readStatus.getDataStatus();
+                readStatus.getDataStatus(input);
 
         ReadStatusOutputBuilder outputBuilder = new ReadStatusOutputBuilder();
         outputBuilder.setData(result.getResult().getHits());
index 7b7dccc..21e2694 100644 (file)
@@ -21,7 +21,6 @@
  */
 package org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch.impl;
 
-import org.json.JSONObject;
 import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
 import org.onap.ccsdk.features.sdnr.wt.common.database.SearchHit;
 import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
@@ -47,9 +46,7 @@ public class HtUserdataManagerImpl extends HtUserdataManagerBase {
 
     @Override
     public boolean setUserdata(String username, String data) {
-        JSONObject o = new JSONObject(this.getUserdata(username));
-        JSONObject merge = mergeData(new JSONObject(data), o);
-        return this.dbClient.doWriteRaw(Entity.Userdata.getName(), username, merge.toString()) != null;
+        return this.dbClient.doWriteRaw(Entity.Userdata.getName(), username, data) != null;
     }
 
     @Override
index e2ba956..54cf32c 100644 (file)
@@ -72,7 +72,7 @@ public class NoDbDatabaseDataProvider implements DatabaseDataProvider {
     private final HtDatabaseMediatorserver mediatorserver;
     private final HtDatabaseMaintenance maintenance;
     private final DataProvider dataprovider;
-    
+
     public NoDbDatabaseDataProvider() {
         this.usermanger = new NoDbHtUserdataManager();
         this.mediatorserver = new NoDbHtDatabaseMediatorserver();
@@ -160,7 +160,7 @@ public class NoDbDatabaseDataProvider implements DatabaseDataProvider {
     }
 
     @Override
-    public ReadStatusOutputBuilder readStatus() throws IOException {
+    public ReadStatusOutputBuilder readStatus(EntityInput input) throws IOException {
         return new ReadStatusOutputBuilder();
     }
 
index 29d9ee9..6ddc092 100644 (file)
@@ -32,6 +32,9 @@ public class ODLVersionLUT {
         if (onapCCSDKVersion == null) {
             return def;
         }
+        if (onapCCSDKVersion.startsWith("2.4.")) {
+            return "ONAP Kohn";
+        } 
         if (onapCCSDKVersion.startsWith("2.3.")) {
             return "ONAP Jakarta";
         }
@@ -66,6 +69,8 @@ public class ODLVersionLUT {
         }
         if(odlMdsalVersionLUT==null) {
             odlMdsalVersionLUT = new HashMap<>();
+            odlMdsalVersionLUT.put("9.0.2","sulfur-SR0 (0.16.0)");
+            odlMdsalVersionLUT.put("8.0.11","phosphorus-SR2 (0.15.2)");
             odlMdsalVersionLUT.put("8.0.7","phosphorus-SR1 (0.15.1)");
             odlMdsalVersionLUT.put("8.0.5","phosphorus-SR0 (0.15.0)");
             odlMdsalVersionLUT.put("7.0.9","silicon-SR2 (0.14.2)");
index 41fee76..b75108a 100644 (file)
@@ -27,9 +27,12 @@ import com.google.common.util.concurrent.ListenableFuture;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.Map;
 import java.util.Optional;
+import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -38,7 +41,6 @@ import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRep
 import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.DatabaseDataProvider;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch.impl.ElasticSearchDataProvider;
-import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.elasticsearch.impl.HtUserdataManagerImpl;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.nodb.NoDbDatabaseDataProvider;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.data.SqlDBDataProvider;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.MsServlet;
@@ -47,6 +49,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtUserdataManager;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEsConfig;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.SdnrDbType;
+import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapperHelper;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
@@ -112,11 +115,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.pro
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.tls.key.entry.output.Pagination;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.tls.key.entry.output.PaginationBuilder;
-import org.opendaylight.yangtools.concepts.Builder;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
+import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
@@ -165,7 +167,7 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab
         // Register ourselves as the REST API RPC implementation
         LOG.info("Register RPC Service {}", DataProviderServiceImpl.class.getSimpleName());
         this.rpcReg = rpcProviderService.registerRpcImplementation(DataProviderService.class, this);
-        
+
     }
 
     private void sendResyncCallbackToApiGateway() {
@@ -279,7 +281,8 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab
     @Override
     public ListenableFuture<RpcResult<ReadStatusOutput>> readStatus(ReadStatusInput input) {
         LOG.debug("RPC Request: readStatusEntityList with input {}", input);
-        RpcResultBuilder<ReadStatusOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.readStatus());
+        RpcResultBuilder<ReadStatusOutput> result =
+                read(() -> DataProviderServiceImpl.this.dataProvider.readStatus(input));
         return result.buildFuture();
 
     }
@@ -460,11 +463,11 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab
         }
         ReadTlsKeyEntryOutputBuilder output = new ReadTlsKeyEntryOutputBuilder();
         if (result.isEmpty()) {
-            return output.setData(Arrays.asList()).setPagination(EMPTY_PAGINATION);
+            return output.setData(Set.of()).setPagination(EMPTY_PAGINATION);
         }
         Map<KeyCredentialKey, KeyCredential> keyCredential = result.get().getKeyCredential();
         if (keyCredential == null) {
-            return output.setData(Arrays.asList()).setPagination(EMPTY_PAGINATION);
+            return output.setData(Set.of()).setPagination(EMPTY_PAGINATION);
         }
         org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Pagination pagination =
                 input.getPagination();
@@ -474,7 +477,7 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab
                 : pagination.getSize() == null ? DEFAULT_PAGESIZE : pagination.getSize().longValue();
         long from = pageNum > 0 ? (pageNum - 1) * size : 0;
         output.setData(keyCredential.keySet().stream().skip(from).limit(size).map(e -> e.getKeyId())
-                .collect(Collectors.toList()));
+                .collect(Collectors.toSet()));
         output.setPagination(new PaginationBuilder().setPage(Uint64.valueOf(pageNum))
                 .setSize(Uint32.valueOf(output.getData().size())).setTotal(Uint64.valueOf(keyCredential.size()))
                 .build());
@@ -492,16 +495,16 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab
         return buf.toString();
     }
 
-    private interface GetEntityInput<O extends DataObject> {
-        Builder<O> get() throws IOException;
+    private interface GetEntityInput<O extends DataObject,B> {
+        B get() throws IOException;
     }
 
-    private static <O extends DataObject, I extends DataObject> RpcResultBuilder<O> read(
-            GetEntityInput<O> inputgetter) {
+    private static <O extends DataObject, B> RpcResultBuilder<O> read(
+            GetEntityInput<O,B> inputgetter) {
         RpcResultBuilder<O> result;
         try {
-            Builder<O> outputBuilder = inputgetter.get();
-            result = RpcResultBuilder.success(outputBuilder);
+            B outputBuilder = inputgetter.get();
+            result = RpcResultBuilder.success(YangToolsMapperHelper.callBuild(outputBuilder));
         } catch (Exception e) {
             LOG.info("Exception", e);
             result = RpcResultBuilder.failed();
@@ -510,6 +513,7 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab
         return result;
     }
 
+    
     public HtUserdataManager getHtDatabaseUserManager() {
         return this.dbUserManager;
     }
index 00e8075..08b1d00 100644 (file)
@@ -31,8 +31,13 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import java.io.IOException;
 import java.math.BigInteger;
+import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
+
+import org.eclipse.jdt.annotation.Nullable;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
@@ -48,10 +53,12 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.UserdataHttpServlet;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.test.util.HostInfoForTest;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.DataProviderYangToolsMapper;
+import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapperHelper;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmNotificationType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmOperation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CmSourceIndicator;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionLogStatus;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMaintenanceOutputBuilder;
@@ -68,9 +75,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.pro
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Faultlog;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GranularityPeriodType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadCmlogListInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadCmlogListInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadCmlogListOutputBuilder;
@@ -116,6 +125,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.pro
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadPmdata24hLtpListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ReadStatusInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateMaintenanceInputBuilder;
@@ -126,11 +136,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.pro
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Pagination;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.PaginationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class TestCRUDforDatabase {
 
@@ -164,27 +176,49 @@ public class TestCRUDforDatabase {
         //== CLEAR AND CREATE ================================
         clearAndCreatefaultEntity("1", Entity.Faultcurrent.getName(),
                 "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput",
-                SeverityType.Critical);
+                SeverityType.Critical, "nodeA");
         createFaultEntity("Lorem Ipsum", Entity.Faultcurrent.getName(),
                 "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput",
-                SeverityType.Major);
+                SeverityType.Major, "nodeB");
         createFaultEntity("3", Entity.Faultcurrent.getName(),
                 "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput",
-                SeverityType.Minor);
+                SeverityType.Minor, "nodeC");
         createFaultEntity("4", Entity.Faultcurrent.getName(),
                 "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateFaultcurrentInput",
-                SeverityType.Warning);
-
+                SeverityType.Warning, "nodeA");
+
+        createNeConnection("nodeA","10.20.30.40",30000, ConnectionLogStatus.Connected);
+        createNeConnection("nodeB","10.20.30.40",31000, ConnectionLogStatus.Connected);
+        createNeConnection("nodeC","10.20.30.40",32000, ConnectionLogStatus.Connected);
+        createNeConnection("nodeAD","10.20.30.40",33000, ConnectionLogStatus.Connected);
+        createNeConnection("nodeE","10.20.30.40",34000, ConnectionLogStatus.Connected);
+        createNeConnection("nodeF","10.20.30.40",35000, ConnectionLogStatus.Connected);
         //== READ ================================
 
         List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.status.output.Data> readOutput =
-                dbProvider.readStatus().getData();
+                dbProvider.readStatus(null).getData();
         System.out.println(readOutput);
 
+
+
         assertEquals(1, readOutput.get(0).getFaults().getMajors().intValue());
         assertEquals(1, readOutput.get(0).getFaults().getMinors().intValue());
         assertEquals(1, readOutput.get(0).getFaults().getWarnings().intValue());
         assertEquals(1, readOutput.get(0).getFaults().getCriticals().intValue());
+        Map<FilterKey, Filter> filter = YangToolsMapperHelper
+                .toMap(Arrays.asList(new FilterBuilder().setProperty("node-id").setFiltervalue("nodeA").build()));
+        EntityInput input = new ReadStatusInputBuilder().setFilter(filter).build();
+        readOutput = dbProvider.readStatus(input).getData();
+        System.out.println(readOutput);
+        assertEquals(1, readOutput.get(0).getNetworkElementConnections().getConnected().intValue());
+        assertEquals(0, readOutput.get(0).getNetworkElementConnections().getConnecting().intValue());
+        assertEquals(0, readOutput.get(0).getNetworkElementConnections().getDisconnected().intValue());
+        assertEquals(0, readOutput.get(0).getNetworkElementConnections().getMounted().intValue());
+        assertEquals(0, readOutput.get(0).getFaults().getMajors().intValue());
+        assertEquals(0, readOutput.get(0).getFaults().getMinors().intValue());
+        assertEquals(1, readOutput.get(0).getFaults().getWarnings().intValue());
+        assertEquals(1, readOutput.get(0).getFaults().getCriticals().intValue());
+
 
         //== DELETE ================================
 
@@ -197,13 +231,15 @@ public class TestCRUDforDatabase {
 
         //== VERIFY DELETE ===========================
         System.out.println("verify entries were deleted");
-        readOutput = dbProvider.readStatus().getData();
+        readOutput = dbProvider.readStatus(null).getData();
         assertEquals(0, readOutput.get(0).getFaults().getMajors().intValue());
         assertEquals(0, readOutput.get(0).getFaults().getMinors().intValue());
         assertEquals(0, readOutput.get(0).getFaults().getWarnings().intValue());
         assertEquals(0, readOutput.get(0).getFaults().getCriticals().intValue());
     }
 
+
+
     @Test
     public void testMediatorServer() {
         final String NAME = "ms1";
@@ -599,14 +635,14 @@ public class TestCRUDforDatabase {
     public void testCMLog() {
         System.out.println("Starting CM log test...");
         String dbId = clearAndCreateCMEntity("1", Entity.Cmlog.getName(),
-            "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateCmlogInput");
+                "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateCmlogInput");
         // ==READ===========================
         System.out.println("try to read entry");
 
         ReadCmlogListInput readinput = new ReadCmlogListInputBuilder()
-            .setFilter(YangHelper2.getListOrMap(FilterKey.class,
-                new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
-            .setPagination(getPagination(20, 1)).build();
+                .setFilter(YangHelper2.getListOrMap(FilterKey.class,
+                        new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
 
         ReadCmlogListOutputBuilder readResult = null;
         try {
@@ -616,8 +652,8 @@ public class TestCRUDforDatabase {
             fail("CM log not read: " + e.getMessage());
         }
 
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.cmlog.list.output.Data>
-            data = readResult.getData();
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.cmlog.list.output.Data> data =
+                readResult.getData();
 
         assertNotNull(data);
         assertEquals("1", dbId);
@@ -634,13 +670,13 @@ public class TestCRUDforDatabase {
         System.out.println("try to update entry");
 
         dbRawProvider.doUpdateOrCreate(Entity.Cmlog.getName(), "1",
-            "{'node-id': 'test4657-78','operation': 'CREATE', 'notification-id': '1'}");
+                "{'node-id': 'test4657-78','operation': 'CREATE', 'notification-id': '1'}");
 
         System.out.println("try to search entry 1");
         readinput = new ReadCmlogListInputBuilder()
-            .setFilter(YangHelper2.getListOrMap(FilterKey.class,
-                new FilterBuilder().setProperty("node-id").setFiltervalue("test").build()))
-            .setPagination(getPagination(20, 1)).build();
+                .setFilter(YangHelper2.getListOrMap(FilterKey.class,
+                        new FilterBuilder().setProperty("node-id").setFiltervalue("test").build()))
+                .setPagination(getPagination(20, 1)).build();
 
         //== VERIFY UPDATE ================================
         readResult = dbProvider.readCMLogList(readinput);
@@ -652,9 +688,9 @@ public class TestCRUDforDatabase {
 
         System.out.println("try to search entry 2");
         readinput = new ReadCmlogListInputBuilder()
-            .setFilter(YangHelper2.getListOrMap(FilterKey.class,
-                new FilterBuilder().setProperty("node-id").setFiltervalue("test*").build()))
-            .setPagination(getPagination(20, 1)).build();
+                .setFilter(YangHelper2.getListOrMap(FilterKey.class,
+                        new FilterBuilder().setProperty("node-id").setFiltervalue("test*").build()))
+                .setPagination(getPagination(20, 1)).build();
 
         readResult = dbProvider.readCMLogList(readinput);
         data = readResult.getData();
@@ -676,7 +712,7 @@ public class TestCRUDforDatabase {
         //== VERIFY DELETE ===========================
         System.out.println("verify entries deleted");
         readResult = dbProvider
-            .readCMLogList(new ReadFaultlogListInputBuilder().setPagination(getPagination(20, 1)).build());
+                .readCMLogList(new ReadFaultlogListInputBuilder().setPagination(getPagination(20, 1)).build());
         data = readResult.getData();
         assertEquals(0, data.size());
     }
@@ -1012,10 +1048,11 @@ public class TestCRUDforDatabase {
         assertEquals("2008-11-21T00:00:00.0Z", data.get(0).getDate());
         assertEquals("sd-dsa-eww", data.get(0).getSerial());
         assertEquals(holderArray.length, data.get(0).getContainedHolder().size());
-        assertEquals(holderArray[0], data.get(0).getContainedHolder().get(0));
-        assertEquals(holderArray[1], data.get(0).getContainedHolder().get(1));
-        assertEquals(holderArray[2], data.get(0).getContainedHolder().get(2));
-
+        Set<String> holder = data.get(0).getContainedHolder();
+        assertTrue(holder.contains(holderArray[0]));
+        assertTrue(holder.contains(holderArray[1]));
+        assertTrue(holder.contains(holderArray[2]));
+       
         // ==DELETE============================
 
         System.out.println("delete after test");
@@ -1159,7 +1196,7 @@ public class TestCRUDforDatabase {
             fail("Problem reading 15m ltp data");
         }
 
-        List<String> dataLtp = readltpResult.getData();
+        Set<String> dataLtp = readltpResult.getData();
 
         assertNotNull(dataLtp);
         assertEquals(2, dataLtp.size());
@@ -1179,7 +1216,7 @@ public class TestCRUDforDatabase {
             fail("Problem reading 15m device data");
         }
 
-        List<String> dataDevice = readDeviceResult.getData();
+        Set<String> dataDevice = readDeviceResult.getData();
 
         assertNotNull(dataDevice);
         assertEquals(2, dataDevice.size());
@@ -1278,7 +1315,7 @@ public class TestCRUDforDatabase {
             fail("Problem reading 24h ltp data");
         }
 
-        List<String> dataLtp = readltpResult.getData();
+        Set<String> dataLtp = readltpResult.getData();
 
         assertNotNull(dataLtp);
         assertEquals(3, dataLtp.size());
@@ -1300,7 +1337,7 @@ public class TestCRUDforDatabase {
             fail("Problem reading 24h device data");
         }
 
-        List<String> dataDevice = readDeviceResult.getData();
+        Set<String> dataDevice = readDeviceResult.getData();
 
         assertNotNull(dataDevice);
         assertEquals(2, dataDevice.size());
@@ -1505,8 +1542,8 @@ public class TestCRUDforDatabase {
 
         assertEquals("admin", UserdataHttpServlet.decodeJWTPayloadUsername(String.format("Bearer %s",
                 "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbkBzZG4iLCJyb2xlcyI6WyJ1c2VyIiwiYWRtaW4iXSwiaXN"
-                + "zIjoiT3BlbmRheWxpZ2h0IiwibmFtZSI6ImFkbWluQHNkbiIsImV4cCI6MTYxNTc5NTg1NywiZmFtaWx5X25hbWUiOiIifQ.wB"
-                + "PdB45_bryU6_kSCu3be3dq3yth24niSXi6b2_1ufc"),
+                        + "zIjoiT3BlbmRheWxpZ2h0IiwibmFtZSI6ImFkbWluQHNkbiIsImV4cCI6MTYxNTc5NTg1NywiZmFtaWx5X25hbWUiOiIifQ.wB"
+                        + "PdB45_bryU6_kSCu3be3dq3yth24niSXi6b2_1ufc"),
                 "sub"));
     }
 
@@ -1515,9 +1552,13 @@ public class TestCRUDforDatabase {
                 .setSize(YangHelper2.getLongOrUint32(pageSize)).build();
     }
 
-
     private String clearAndCreatefaultEntity(String initialDbId, String entityType, String implementedInterface,
             SeverityType severity) {
+        return clearAndCreatefaultEntity(initialDbId, entityType, implementedInterface, severity, "s1");
+    }
+
+    private String clearAndCreatefaultEntity(String initialDbId, String entityType, String implementedInterface,
+            SeverityType severity, String nodeId) {
         // ==CLEAR BEFORE TEST============================
         System.out.println("try to clear entry");
         try {
@@ -1527,11 +1568,24 @@ public class TestCRUDforDatabase {
         }
 
 
-        return createFaultEntity(initialDbId, entityType, implementedInterface, severity);
+        return createFaultEntity(initialDbId, entityType, implementedInterface, severity, nodeId);
     }
 
+    private void createNeConnection(String nodeId, String host, int port, ConnectionLogStatus connectionStatus) {
+       try {
+            dbProvider.createNetworkElementConnection(new NetworkElementConnectionBuilder().setId(nodeId)
+                    .setNodeId(nodeId).setStatus(connectionStatus).setHost(host).setPort(Uint32.valueOf(port)).build());
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
     private String createFaultEntity(String initialDbId, String entityType, String implementedInterface,
             SeverityType severity) {
+        return createFaultEntity(initialDbId, entityType, implementedInterface, severity, "s1");
+    }
+    private String createFaultEntity(String initialDbId, String entityType, String implementedInterface,
+            SeverityType severity, String nodeId) {
         // ==CREATE============================
         System.out.println("try to create entry");
         String dbId = null;
@@ -1540,7 +1594,7 @@ public class TestCRUDforDatabase {
 
             dbId = dbRawProvider.doUpdateOrCreate(entityType, initialDbId,
                     "{\n" + "\"timestamp\": \"2019-10-28T11:55:58.3Z\",\n" + "\"object-id\": \"LP-MWPS-RADIO\",\n"
-                            + "\"severity\": \"" + severity.toString() + "\",\n" + "\"node-id\": \"s1\",\n"
+                            + "\"severity\": \"" + severity.toString() + "\",\n" + "\"node-id\": \""+nodeId+"\",\n"
                             + "\"implemented-interface\": \"" + implementedInterface + "\",\n" + "\"counter\": 4340,\n"
                             + "\"problem\": \"signalIsLost\",\n" + "\"type\": \"ProblemNotificationXml\"\n" + "}");
 
@@ -1566,23 +1620,19 @@ public class TestCRUDforDatabase {
 
     private String createCMEntity(String initialDbId, String entityType, String implementedInterface) {
         // ==CREATE============================
-            System.out.println("try to create entry");
-            String dbId = null;
+        System.out.println("try to create entry");
+        String dbId = null;
 
         try {
             dbId = dbRawProvider.doUpdateOrCreate(entityType, initialDbId,
-                "{\n" + "\"timestamp\": \"2019-10-28T11:55:58.3Z\",\n"
-                    + "\" object-id\": \"LP-MWPS-RADIO\",\n"
-                    + "\"node-id\": \"node-1\",\n"
-                    + "\"counter\": 1,\n"
-                    + "\"notification-type\": \"" + CmNotificationType.NotifyMOIChanges.toString() + "\",\n"
-                    + "\"notification-id\": 123,\n"
-                    + "\"source-indicator\": \"" + CmSourceIndicator.MANAGEMENTOPERATION.toString() + "\",\n"
-                    + "\" path\": \"https://samsung.com/3GPP/simulation/network-function/ves=1\",\n"
-                    + "\"operation\": \"" + CmOperation.REPLACE.toString() + "\",\n"
-                    + "\"value\": \"pnf-registration:true\",\n"
-                    + "\"implemented-interface\": \"" + implementedInterface + "\"\n"
-                    + "}");
+                    "{\n" + "\"timestamp\": \"2019-10-28T11:55:58.3Z\",\n" + "\" object-id\": \"LP-MWPS-RADIO\",\n"
+                            + "\"node-id\": \"node-1\",\n" + "\"counter\": 1,\n" + "\"notification-type\": \""
+                            + CmNotificationType.NotifyMOIChanges.toString() + "\",\n" + "\"notification-id\": 123,\n"
+                            + "\"source-indicator\": \"" + CmSourceIndicator.MANAGEMENTOPERATION.toString() + "\",\n"
+                            + "\" path\": \"https://samsung.com/3GPP/simulation/network-function/ves=1\",\n"
+                            + "\"operation\": \"" + CmOperation.REPLACE.toString() + "\",\n"
+                            + "\"value\": \"pnf-registration:true\",\n" + "\"implemented-interface\": \""
+                            + implementedInterface + "\"\n" + "}");
 
         } catch (Exception e) {
             fail("Problem creating CM log entry" + e.getMessage());
index 611533b..910f63d 100644 (file)
@@ -24,7 +24,10 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
 import java.io.IOException;
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+
 import org.eclipse.jdt.annotation.Nullable;
 import org.json.JSONObject;
 import org.junit.Test;
@@ -81,7 +84,7 @@ public class TestYangGenSalMapping {
 
         OdlHelloMessageCapabilitiesBuilder odlHelloMessageCapabilitiesBuilder =
                 new OdlHelloMessageCapabilitiesBuilder();
-        List<Uri> uriList = new ArrayList<>();
+        Set<Uri> uriList = new HashSet<>();
         uriList.add(new Uri("test.uri"));
         odlHelloMessageCapabilitiesBuilder.setCapability(uriList);
         netconfNodeBuilder.setOdlHelloMessageCapabilities(odlHelloMessageCapabilitiesBuilder.build());
index ec5f365..f36d5ae 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
             <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
             <artifactId>rfc6991-ietf-yang-types</artifactId>
         </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
index a2a1fcd..2845613 100644 (file)
@@ -61,6 +61,7 @@ public class MariaDBTestBase {
     private static final Map<String, String> envDefaultValues = initEnvDefaultValues();
     private static final String SDNRDBDATABASETEST="test";
     private static final String TESTPROPFILE = "test.properties";
+    private static final String SUFFIX = "";
 
     public MariaDBTestBase() throws ManagedProcessException {
         this(new Random().nextInt(1000) + 50000);
@@ -169,7 +170,7 @@ public class MariaDBTestBase {
             boolean withControllerId) {
         String createStatement = null;
         try {
-            createStatement = SqlDBMapper.createTable(cls, entity, "", autoIndex,withControllerId);
+            createStatement = SqlDBMapper.createTable(cls, entity, SUFFIX, autoIndex,withControllerId);
         } catch (UnableToMapClassException e) {
             fail(e.getMessage());
         }
index ef89988..ceec97e 100644 (file)
@@ -27,6 +27,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 import org.junit.AfterClass;
@@ -72,6 +73,7 @@ public class TestMariaDBMapper {
 
     //    private static DbLibService dbService;
 
+    private static final String SUFFIX = "";
     private static MariaDBTestBase testBase;
     private static SqlDBDataProvider dbProvider;
 
@@ -123,10 +125,10 @@ public class TestMariaDBMapper {
         builder.setDeviceType(NetworkElementDeviceType.OROADM);
         builder.setHost("10.20.30.40");
         builder.setIsRequired(true);
-        NodeDetails nodeDetails = new NodeDetailsBuilder().setAvailableCapabilities(Arrays.asList(
+        NodeDetails nodeDetails = new NodeDetailsBuilder().setAvailableCapabilities(new HashSet<>(Arrays.asList(
                 "urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all,"
                         + "report-all-tagged,trim,explicit",
-                "urn:ietf:params:netconf:capability:validate:1.1", "urn:ietf:params:netconf:capability:url:1.0"))
+                "urn:ietf:params:netconf:capability:validate:1.1", "urn:ietf:params:netconf:capability:url:1.0")))
                 .build();
         builder.setNodeDetails(nodeDetails);
         builder.setPassword("password");
@@ -202,7 +204,7 @@ public class TestMariaDBMapper {
             boolean withControllerId) {
         String createStatement = null;
         try {
-            createStatement = SqlDBMapper.createTable(cls, entity, "", autoIndex,withControllerId);
+            createStatement = SqlDBMapper.createTable(cls, entity, SUFFIX, autoIndex,withControllerId);
         } catch (UnableToMapClassException e) {
             fail(e.getMessage());
         }
index 5882823..e65580d 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 1124c5b..1d84071 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 070d384..56bec8c 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <parent>
+       <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
+
     <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
     <artifactId>sdnr-wt-devicemanager-core-model</artifactId>
     <version>1.4.0-SNAPSHOT</version>
             <artifactId>sdnr-wt-data-provider-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
+        </dependency>        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-websocketmanager-model</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
index e12991b..5edf394 100644 (file)
@@ -1,6 +1,6 @@
 module devicemanager {
 
-  yang-version 1;
+  yang-version 1.1;
   namespace "urn:opendaylight:params:xml:ns:yang:devicemanager";
   prefix devicemanager;
 
index 18be33b..24a99fe 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 05a6127..4c373d5 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     </properties>
 
     <dependencies>
-        <!-- begin for testing -->
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <!-- end for testing -->
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-devicemanager-core-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
             <artifactId>sdnr-wt-websocketmanager-model</artifactId>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
-            <scope>provided</scope>
+           <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal.model</groupId>
             <artifactId>ietf-topology</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>jaxb-runtime</artifactId>
             <scope>provided</scope>
         </dependency>
+               <dependency>
+                       <groupId>com.google.code.findbugs</groupId>
+                       <artifactId>annotations</artifactId>
+                       <scope>provided</scope>
+               </dependency>
+        <!-- begin for testing -->
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- end for testing -->
     </dependencies>
 
     <build>
index e31b79a..4d5823a 100644 (file)
  */
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.impl;
 
+import com.google.common.util.concurrent.ForwardingListenableFuture;
 import com.google.common.util.concurrent.ListenableFuture;
+
+import java.util.HashSet;
 import java.util.List;
+import java.util.stream.Collectors;
+
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.housekeeping.ResyncNetworkElementsListener;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.maintenance.MaintenanceRPCServiceAPI;
@@ -52,7 +58,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.devicema
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.devicemanager.rev190109.TestMaintenanceModeOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.devicemanager.rev190109.TestMaintenanceModeOutputBuilder;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
-import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
+import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
@@ -105,7 +111,7 @@ public class DeviceManagerApiServiceImpl implements DevicemanagerService, AutoCl
         try {
             GetRequiredNetworkElementKeysOutputBuilder outputBuilder =
                     maintenanceService.getRequiredNetworkElementKeys();
-            result = RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder.build());
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -123,7 +129,7 @@ public class DeviceManagerApiServiceImpl implements DevicemanagerService, AutoCl
         try {
             ShowRequiredNetworkElementOutputBuilder outputBuilder =
                     maintenanceService.showRequiredNetworkElement(input);
-            result = RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder.build());
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -139,13 +145,12 @@ public class DeviceManagerApiServiceImpl implements DevicemanagerService, AutoCl
 
         try {
             SetMaintenanceModeOutputBuilder outputBuilder = maintenanceService.setMaintenanceMode(input);
-            result = RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder.build());
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
         }
         return result.buildFuture();
-
     }
 
 
@@ -154,11 +159,11 @@ public class DeviceManagerApiServiceImpl implements DevicemanagerService, AutoCl
     public ListenableFuture<RpcResult<GetMaintenanceModeOutput>> getMaintenanceMode(GetMaintenanceModeInput input) {
 
         LOG.info("RPC Request: getMaintenanceMode input: {}", input.getMountpointName());
-        RpcResultBuilder<GetMaintenanceModeOutput> result;
+        @NonNull RpcResultBuilder<GetMaintenanceModeOutput> result;
 
         try {
             GetMaintenanceModeOutputBuilder outputBuilder = maintenanceService.getMaintenanceMode(input);
-            result = RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder.build());
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -174,7 +179,7 @@ public class DeviceManagerApiServiceImpl implements DevicemanagerService, AutoCl
 
         try {
             TestMaintenanceModeOutputBuilder outputBuilder = maintenanceService.testMaintenanceMode(input);
-            result = RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder.build());
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -192,10 +197,10 @@ public class DeviceManagerApiServiceImpl implements DevicemanagerService, AutoCl
         try {
             if (this.resyncCallbackListener != null) {
                 List<String> nodeNames =
-                        this.resyncCallbackListener.doClearCurrentFaultByNodename(input.getNodenames());
+                        this.resyncCallbackListener.doClearCurrentFaultByNodename(input.getNodenames().stream().collect(Collectors.toList()));
                 ClearCurrentFaultByNodenameOutputBuilder outputBuilder = new ClearCurrentFaultByNodenameOutputBuilder();
-                outputBuilder.setNodenames(nodeNames);
-                result = RpcResultBuilder.success(outputBuilder);
+                outputBuilder.setNodenames(new HashSet<>(nodeNames));
+                result = RpcResultBuilder.success(outputBuilder.build());
             } else {
                 result = RpcResultBuilder.failed();
                 result.withError(ErrorType.APPLICATION, "Startup running");
@@ -251,6 +256,4 @@ public class DeviceManagerApiServiceImpl implements DevicemanagerService, AutoCl
         return result.buildFuture();
     }
 
-
-
 }
index 4369af0..13eca8f 100644 (file)
@@ -17,6 +17,7 @@
  */
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.util;
 
+import java.util.HashSet;
 import java.util.Optional;
 import javax.annotation.Nonnull;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InternalConnectionStatus;
@@ -82,8 +83,8 @@ public class NetworkElementConnectionEntitiyUtil {
         Capabilities unAvailableCapabilities = Capabilities.getUnavailableCapabilities(nNode);
 
         NodeDetailsBuilder nodeDetails =
-                new NodeDetailsBuilder().setAvailableCapabilities(availableCapabilities.getCapabilities())
-                        .setUnavailableCapabilities(unAvailableCapabilities.getCapabilities());
+                new NodeDetailsBuilder().setAvailableCapabilities(new HashSet<>(availableCapabilities.getCapabilities()))
+                        .setUnavailableCapabilities(new HashSet<>(unAvailableCapabilities.getCapabilities()));
         eb.setNodeDetails(nodeDetails.build());
         // -- host information
         Host host = nNode.getHost();
index 6351f39..b8b67fd 100644 (file)
@@ -19,7 +19,10 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.maintenance.impl;
 
 import java.time.ZonedDateTime;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.maintenance.MaintenanceRPCServiceAPI;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.MaintenanceService;
@@ -79,7 +82,7 @@ public class MaintenanceServiceImpl implements MaintenanceService, MaintenanceRP
     public GetRequiredNetworkElementKeysOutputBuilder getRequiredNetworkElementKeys() {
         List<MaintenanceEntity> all = database.getAll();
 
-        List<String> mountpointList = new ArrayList<>();
+        Set<String> mountpointList = new HashSet<>();
         for (MaintenanceEntity oneOfAll : all) {
             mountpointList.add(oneOfAll.getNodeId());
 
index 06b8259..07c4f6a 100644 (file)
@@ -22,6 +22,8 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
 
 import static org.junit.Assert.assertTrue;
 import java.util.Arrays;
+import java.util.HashSet;
+
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -179,7 +181,7 @@ public class TestDevicemanager extends Mockito {
         log.info("testResync");
 
         ClearCurrentFaultByNodenameInputBuilder inputBuilder = new ClearCurrentFaultByNodenameInputBuilder();
-        inputBuilder.setNodenames(Arrays.asList("test1", "test2"));
+        inputBuilder.setNodenames(new HashSet<>(Arrays.asList("test1", "test2")));
         apiService.clearCurrentFaultByNodename(inputBuilder.build());
 
     }
index 475ba0f..635d3b9 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 76993dd..0e137d9 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index a221543..2354c3a 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index aaf4727..9cbe897 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index ebb1c63..ee4f84f 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     </properties>
 
     <dependencies>
-        <!-- begin for testing -->
         <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>sdnr-wt-devicemanager-core-provider</artifactId>
+            <artifactId>sdnr-wt-devicemanager-o-ran-sc-oran-model</artifactId>
             <version>${project.version}</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
-        <!-- end for testing -->
         <dependency>
-            <groupId>org.json</groupId>
-            <artifactId>json</artifactId>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-devicemanager-core-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>sdnr-wt-devicemanager-o-ran-sc-oran-model</artifactId>
+            <artifactId>sdnr-wt-netconfnode-state-service-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>sdnr-wt-devicemanager-core-model</artifactId>
+            <artifactId>sdnr-wt-websocketmanager-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>sdnr-wt-netconfnode-state-service-model</artifactId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
             <artifactId>onap-system</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <!-- begin for testing -->
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-devicemanager-core-provider</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+         <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- end for testing -->
+        
     </dependencies>
 
     <build>
index 279620c..a3bd14e 100644 (file)
@@ -24,8 +24,11 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom;
 import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
+
 import org.opendaylight.mdsal.dom.api.DOMEvent;
 import org.opendaylight.mdsal.dom.api.DOMNotification;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -63,8 +66,8 @@ public class ORanDMDOMUtility {
         }
     }
 
-    public static List<String> getLeafListValue(DataContainerNode componentEntry, QName leafListQName) {
-        List<String> containsChildList = new ArrayList<String>();
+    public static Set<String> getLeafListValue(DataContainerNode componentEntry, QName leafListQName) {
+        Set<String> containsChildList = new HashSet<String>();
         try {
             DataContainerChild childSet = componentEntry.getChildByArg(new NodeIdentifier(leafListQName));
             Collection<?> childEntry = (Collection<?>) childSet.body();
index b157ae4..25a54f0 100644 (file)
@@ -90,8 +90,8 @@ public class ORanDOMToInternalDataModel {
             inventoryResultList.add(oInventory.get());
         }
         //Walk through list of child keys and add to list
-        for (String childUuid : CodeHelpers.nonnull(ORanDMDOMUtility.getLeafListValue(component,
-                ORanDeviceManagerQNames.IETF_HW_COMPONENT_LIST_CONTAINS_CHILD))) {
+        for (String childUuid : CodeHelpers.nonnull(new ArrayList<>(ORanDMDOMUtility.getLeafListValue(component,
+                ORanDeviceManagerQNames.IETF_HW_COMPONENT_LIST_CONTAINS_CHILD)))) {
             for (MapEntryNode c : getComponentsByName(childUuid, componentList)) {
                 inventoryResultList = recurseGetInventory(nodeId, c, componentList, treeLevel + 1, inventoryResultList);
             }
index b2c6698..e3113db 100644 (file)
@@ -34,7 +34,6 @@ import javax.xml.stream.XMLStreamReader;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom.util.TestYangParserUtil;
 import org.opendaylight.mdsal.dom.api.DOMEvent;
 import org.opendaylight.mdsal.dom.api.DOMNotification;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity;
@@ -80,7 +79,7 @@ public class TestORanDOMToInternalDataModel {
 
     @BeforeClass
     public static void setup() throws IOException {
-        schemaContext = TestYangParserUtil.parseYangResourceDirectory("/");
+        schemaContext = YangParserTestUtils.parseYangResourceDirectory("/");
         hwContainerSchema = Inference.ofDataTreePath(schemaContext, HW_CONTAINER);
         systemSchema = Inference.ofDataTreePath(schemaContext, IETF_CONTAINER);
     }
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/YangParserTestUtils.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/YangParserTestUtils.java
new file mode 100644 (file)
index 0000000..80c18ae
--- /dev/null
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom;
+
+import com.google.common.annotations.Beta;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.YangConstants;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.api.YangParser;
+import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
+import org.opendaylight.yangtools.yang.parser.api.YangParserException;
+import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
+import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
+import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
+import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+/**
+ * Utility class which provides convenience methods for producing effective schema context based on the supplied
+ * yang/yin sources or paths to these sources.
+ */
+@Beta
+public final class YangParserTestUtils {
+
+    private static final FileFilter YANG_FILE_FILTER = file -> {
+        // Locale keeps SpotBugs happy. It should not matter that much anyway.
+        final String name = file.getName().toLowerCase(Locale.ENGLISH);
+        return name.endsWith(YangConstants.RFC6020_YANG_FILE_EXTENSION) && file.isFile();
+    };
+
+    private static final @NonNull YangParserFactory PARSER_FACTORY;
+
+    static {
+        final Iterator<@NonNull YangParserFactory> it = ServiceLoader.load(YangParserFactory.class).iterator();
+        if (!it.hasNext()) {
+            throw new IllegalStateException("No YangParserFactory found");
+        }
+        PARSER_FACTORY = it.next();
+    }
+
+    private YangParserTestUtils() {
+        // Hidden on purpose
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG source. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param resource relative path to the YANG file to be parsed
+     *
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResource(final String resource) {
+        return parseYangResource(resource, YangParserConfiguration.DEFAULT);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG source. All YANG features are supported.
+     *
+     * @param resource relative path to the YANG file to be parsed
+     * @param parserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResource(final String resource, final YangParserConfiguration config) {
+        return parseYangResource(resource, config, null);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG source. Statement parser mode is set to
+     * default mode.
+     *
+     * @param resource relative path to the YANG file to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          model are resolved
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResource(final String resource, final Set<QName> supportedFeatures) {
+        return parseYangResource(resource, YangParserConfiguration.DEFAULT, supportedFeatures);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG source.
+     *
+     * @param resource relative path to the YANG file to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          model are resolved
+     * @param parserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResource(final String resource, final YangParserConfiguration config,
+            final Set<QName> supportedFeatures) {
+        final YangTextSchemaSource source = YangTextSchemaSource.forResource(YangParserTestUtils.class, resource);
+        return parseYangSources(config, supportedFeatures, source);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final File... files) {
+        return parseYangFiles(Arrays.asList(files));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param files collection of YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final Collection<File> files) {
+        return parseYangFiles(YangParserConfiguration.DEFAULT, files);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode.
+     *
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final Set<QName> supportedFeatures, final File... files) {
+        return parseYangFiles(supportedFeatures, Arrays.asList(files));
+    }
+
+    public static EffectiveModelContext parseYangFiles(final Set<QName> supportedFeatures,
+            final Collection<File> files) {
+        return parseYangFiles(supportedFeatures, YangParserConfiguration.DEFAULT, files);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.
+     *
+     * @param parserMode mode of statement parser
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final YangParserConfiguration config, final File... files) {
+        return parseYangFiles(config, Arrays.asList(files));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.
+     *
+     * @param parserMode mode of statement parser
+     * @param files collection of YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final YangParserConfiguration config,
+            final Collection<File> files) {
+        return parseYangFiles(null, config, files);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources.
+     *
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param parserMode mode of statement parser
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final Set<QName> supportedFeatures,
+               final YangParserConfiguration config, final File... files) {
+        return parseYangFiles(supportedFeatures, config, Arrays.asList(files));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources.
+     *
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param parserMode mode of statement parser
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final Set<QName> supportedFeatures,
+               final YangParserConfiguration config, final Collection<File> files) {
+        return parseSources(config, supportedFeatures,
+            files.stream().map(e->e.toPath()).map(YangTextSchemaSource::forPath).collect(Collectors.toList()));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param resourcePath relative path to the directory with YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath) {
+        return parseYangResourceDirectory(resourcePath, YangParserConfiguration.DEFAULT);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.
+     *
+     * @param resourcePath relative path to the directory with YANG files to be parsed
+     * @param parserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath,
+               final YangParserConfiguration config) {
+        return parseYangResourceDirectory(resourcePath, null, config);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode.
+     *
+     * @param resourcePath relative path to the directory with YANG files to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath,
+            final Set<QName> supportedFeatures) {
+        return parseYangResourceDirectory(resourcePath, supportedFeatures, YangParserConfiguration.DEFAULT);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources.
+     *
+     * @param resourcePath relative path to the directory with YANG files to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param parserMode mode of statement parser
+     * @return effective schema context
+     */
+    @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Wrong inferent on listFiles")
+    public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath,
+            final Set<QName> supportedFeatures, final YangParserConfiguration config) {
+        final URI directoryPath;
+        try {
+            directoryPath = YangParserTestUtils.class.getResource(resourcePath).toURI();
+        } catch (URISyntaxException e) {
+            throw new IllegalArgumentException("Failed to open resource " + resourcePath, e);
+        }
+        return parseYangFiles(supportedFeatures, config, new File(directoryPath).listFiles(YANG_FILE_FILTER));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param clazz Resource lookup base
+     * @param resources Resource names to be looked up
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResources(final Class<?> clazz, final String... resources) {
+        return parseYangResources(clazz, Arrays.asList(resources));
+    }
+
+    public static EffectiveModelContext parseYangResources(final Class<?> clazz, final Collection<String> resources) {
+        final List<YangTextSchemaSource> sources = new ArrayList<>(resources.size());
+        for (final String r : resources) {
+            sources.add(YangTextSchemaSource.forResource(clazz, r));
+        }
+        return parseSources(YangParserConfiguration.DEFAULT, null, sources);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode.
+     *
+     * @param yangDirs relative paths to the directories containing YANG files to be parsed
+     * @param yangFiles relative paths to the YANG files to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResources(final List<String> yangDirs, final List<String> yangFiles,
+            final Set<QName> supportedFeatures) {
+        return parseYangResources(yangDirs, yangFiles, supportedFeatures, YangParserConfiguration.DEFAULT);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.
+     *
+     * @param yangResourceDirs relative paths to the directories containing YANG files to be parsed
+     * @param yangResources relative paths to the YANG files to be parsed
+     * @param statementParserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResources(final List<String> yangResourceDirs,
+            final List<String> yangResources, final YangParserConfiguration config) {
+        return parseYangResources(yangResourceDirs, yangResources, null, config);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources.
+     *
+     * @param yangResourceDirs relative paths to the directories containing YANG files to be parsed
+     * @param yangResources relative paths to the YANG files to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param statementParserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResources(final List<String> yangResourceDirs,
+            final List<String> yangResources, final Set<QName> supportedFeatures,
+            final YangParserConfiguration config) {
+        final List<File> allYangFiles = new ArrayList<>();
+        for (final String yangDir : yangResourceDirs) {
+            allYangFiles.addAll(getYangFiles(yangDir));
+        }
+
+        for (final String yangFile : yangResources) {
+            try {
+                allYangFiles.add(new File(YangParserTestUtils.class.getResource(yangFile).toURI()));
+            } catch (URISyntaxException e) {
+                throw new IllegalArgumentException("Invalid resource " + yangFile, e);
+            }
+        }
+
+        return parseYangFiles(supportedFeatures, config, allYangFiles);
+    }
+
+    public static EffectiveModelContext parseYangSources(final YangParserConfiguration config,
+            final Set<QName> supportedFeatures, final YangTextSchemaSource... sources) {
+        return parseSources(config, supportedFeatures, Arrays.asList(sources));
+    }
+
+    public static EffectiveModelContext parseSources(final YangParserConfiguration config,
+            final Set<QName> supportedFeatures, final Collection<? extends SchemaSourceRepresentation> sources) {
+        final YangParser parser = PARSER_FACTORY.createParser(config);
+        if (supportedFeatures != null) {
+            parser.setSupportedFeatures(supportedFeatures);
+        }
+
+        try {
+            parser.addSources(sources);
+        } catch (YangSyntaxErrorException e) {
+            throw new IllegalArgumentException("Malformed source", e);
+        } catch (IOException e) {
+            throw new IllegalArgumentException("Failed to read a source", e);
+        }
+
+        try {
+            return parser.buildEffectiveModel();
+        } catch (YangParserException e) {
+            throw new IllegalStateException("Failed to assemble SchemaContext", e);
+        }
+    }
+
+    @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Wrong inferent on listFiles")
+    private static Collection<File> getYangFiles(final String resourcePath) {
+        final URI directoryPath;
+        try {
+            directoryPath = YangParserTestUtils.class.getResource(resourcePath).toURI();
+        } catch (URISyntaxException e) {
+            throw new IllegalArgumentException("Failed to open resource directory " + resourcePath, e);
+        }
+        return Arrays.asList(new File(directoryPath).listFiles(YANG_FILE_FILTER));
+    }
+}
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/util/TestYangParserUtil.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/util/TestYangParserUtil.java
deleted file mode 100644 (file)
index 35a6605..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * ONAP : ccsdk features
- * ================================================================================
- * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property.
- * All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- *
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom.util;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.YangConstants;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
-import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.parser.api.YangParser;
-import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
-import org.opendaylight.yangtools.yang.parser.api.YangParserException;
-import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
-import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
-
-public final class TestYangParserUtil {
-
-       private static final FileFilter YANG_FILE_FILTER = file -> {
-               final String name = file.getName();
-               return name.endsWith(YangConstants.RFC6020_YANG_FILE_EXTENSION) && file.isFile();
-       };
-
-       private static final @NonNull YangParserFactory PARSER_FACTORY;
-
-       static {
-               final Iterator<@NonNull YangParserFactory> it = ServiceLoader.load(YangParserFactory.class).iterator();
-               if (!it.hasNext()) {
-                       throw new IllegalStateException("No YangParserFactory found");
-               }
-               PARSER_FACTORY = it.next();
-       }
-
-       public static EffectiveModelContext parseYangFiles(final YangParserConfiguration config, final File... files) {
-               return parseYangFiles(config, Arrays.asList(files));
-       }
-
-       public static EffectiveModelContext parseYangFiles(final YangParserConfiguration config,
-                       final Collection<File> files) {
-               return parseSources(config, files.stream().map(YangTextSchemaSource::forFile).collect(Collectors.toList()));
-       }
-
-       public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath) {
-               return parseYangResourceDirectory(resourcePath, YangParserConfiguration.DEFAULT);
-       }
-
-       public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath,
-                       final YangParserConfiguration config) {
-               final URI directoryPath;
-               try {
-                       directoryPath = TestYangParserUtil.class.getResource(resourcePath).toURI();
-               } catch (URISyntaxException e) {
-                       throw new IllegalArgumentException("Failed to open resource " + resourcePath, e);
-               }
-               return parseYangFiles(config, new File(directoryPath).listFiles(YANG_FILE_FILTER));
-       }
-
-       public static EffectiveModelContext parseYangSources(final YangParserConfiguration config,
-                       final Set<QName> supportedFeatures, final YangTextSchemaSource... sources) {
-               return parseSources(config, Arrays.asList(sources));
-       }
-
-       public static EffectiveModelContext parseSources(final YangParserConfiguration config,
-                       final Collection<? extends SchemaSourceRepresentation> sources) {
-               final YangParser parser = PARSER_FACTORY.createParser(config);
-
-               try {
-                       parser.addSources(sources);
-               } catch (YangSyntaxErrorException e) {
-                       throw new IllegalArgumentException("Malformed source", e);
-               } catch (IOException e) {
-                       throw new IllegalArgumentException("Failed to read a source", e);
-               }
-
-               try {
-                       return parser.buildEffectiveModel();
-               } catch (YangParserException e) {
-                       throw new IllegalStateException("Failed to assemble SchemaContext", e);
-               }
-       }
-}
index 433c51c..60f9986 100644 (file)
@@ -8,10 +8,10 @@
             <admin-state>unlocked</admin-state>
             <oper-state>enabled</oper-state>
         </state>
-        <serial-num>1234</serial-num>
-        <software-rev>1.2.3 (2022-10-30 09:34:59)</software-rev>
-        <mfg-name>Highstreet</mfg-name>
-        <model-name>HS O-RU</model-name>
+        <serial-num>10283</serial-num>
+        <software-rev>3.8.1 (2020-10-30 11:47:59)</software-rev>
+        <mfg-name>ISCO</mfg-name>
+        <model-name>ProteusCPRI Compact</model-name>
         <description>HighStreet-ONAP40</description>
         <contains-child>chassis-temperature-exhaust</contains-child>
         <contains-child>chassis-temperature-inlet</contains-child>
@@ -36,7 +36,7 @@
         <sensor-data>
             <value>30</value>
             <value-type>celsius</value-type>
-            <value-timestamp>2022-03-18T19:51:50.3Z</value-timestamp>
+            <value-timestamp>2021-03-18T19:51:50.3Z</value-timestamp>
             <oper-status>ok</oper-status>
         </sensor-data>
     </component>
@@ -53,7 +53,7 @@
         <sensor-data>
             <value>29</value>
             <value-type>celsius</value-type>
-            <value-timestamp>2022-03-18T19:51:50.3Z</value-timestamp>
+            <value-timestamp>2021-03-18T19:51:50.3Z</value-timestamp>
             <oper-status>ok</oper-status>
         </sensor-data>
     </component>
@@ -82,7 +82,7 @@
         <sensor-data>
             <value>4100</value>
             <value-type>rpm</value-type>
-            <value-timestamp>2022-03-18T19:51:50.3Z</value-timestamp>
+            <value-timestamp>2021-03-18T19:51:50.3Z</value-timestamp>
             <oper-status>ok</oper-status>
         </sensor-data>
     </component>
         </state>
         <parent>chassis</parent>
         <parent-rel-pos>7</parent-rel-pos>
-        <serial-num>1020304050</serial-num>
-        <firmware-rev>123456 (0ABC56D1)</firmware-rev>
+        <serial-num>7220530</serial-num>
+        <firmware-rev>12.00.42-S (0F7F1001)</firmware-rev>
         <software-rev>0</software-rev>
-        <model-name>00AA-SFP-99-BB-CCC</model-name>
+        <model-name>385A-SFP-2P-40-FHL-JC3</model-name>
         <contains-child>slot0-temperature</contains-child>
         <contains-child>slot0-logical0</contains-child>
         <contains-child>slot0-logical1</contains-child>
         <parent>slot0-logical0</parent>
         <parent-rel-pos>0</parent-rel-pos>
         <o-ran-name xmlns="urn:o-ran:hardware:1.0">slot0-logical0-bbu</o-ran-name>
-        <serial-num>ABC12DF3</serial-num>
-        <mfg-name>Highstreet</mfg-name>
-        <model-name>HS-99-56</model-name>
+        <serial-num>AYR3GA2</serial-num>
+        <mfg-name>FINISAR CORP.</mfg-name>
+        <model-name>FTLX1475D3BTL-E7</model-name>
         <contains-child>slot0-logical0-bbu-temperature</contains-child>
     </component>
     <component>
         <parent>slot0-logical0</parent>
         <parent-rel-pos>1</parent-rel-pos>
         <o-ran-name xmlns="urn:o-ran:hardware:1.0">slot0-logical0-rrh</o-ran-name>
-        <serial-num>ABC78YZ</serial-num>
-        <mfg-name>Highstreet</mfg-name>
-        <model-name>2W3E4R5T6Y</model-name>
+        <serial-num>AYR3GA9</serial-num>
+        <mfg-name>FINISAR CORP.</mfg-name>
+        <model-name>FTLX1475D3BTL-E7</model-name>
         <contains-child>slot0-logical0-rrh-temperature</contains-child>
     </component>
     <component>
         </state>
         <parent>chassis</parent>
         <parent-rel-pos>9</parent-rel-pos>
-        <serial-num>23561289</serial-num>
-        <firmware-rev>12.00.42-S (0ABC45HJ)</firmware-rev>
+        <serial-num>7220718</serial-num>
+        <firmware-rev>12.00.42-S (0F7F1001)</firmware-rev>
         <software-rev>0</software-rev>
-        <model-name>ABC-123-DEF-XYZ</model-name>
+        <model-name>385A-SFP-2P-40-FHL-JC3</model-name>
         <mfg-date>2021-10-12T14:41:55.234Z</mfg-date>
         <contains-child>slot2-temperature</contains-child>
         <contains-child>slot2-logical0</contains-child>
index e5425ed..4a8865d 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index c57d1af..d110338 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 840418a..521b43c 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 0b4c485..f95768b 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 4f98031..32699dd 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-websocketmanager-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-netconfnode-state-service-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>sal-netconf-connector</artifactId>
index 5549506..f25cdb9 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 9de3910..ad95be3 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index fc64b64..9057415 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 40eb330..8d4dd1f 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index f86a398..0a5d1d5 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     </properties>
 
     <dependencies>
-        <!-- begin for testing -->
+       
         <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-devicemanager-onap-onf12-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
-
-        <!-- end for testing -->
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>sdnr-wt-devicemanager-onap-onf12-model</artifactId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-websocketmanager-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>sal-netconf-connector</artifactId>
             <scope>provided</scope>
+        </dependency>
+         <!-- begin for testing -->
+         <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>3.4.2</version>      
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>org.osgi.core</artifactId>
             <scope>test</scope>
         </dependency>
+        <!-- end for testing -->
     </dependencies>
 
     <build>
index e6c3865..bbdf66c 100644 (file)
@@ -19,7 +19,10 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+
 import org.onap.ccsdk.features.sdnr.wt.common.YangHelper;
 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.Equipment;
 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.equipment.g.ContainedHolder;
@@ -91,7 +94,7 @@ public class ExtendedEquipment {
         if (getEquipment() != null) {
             inventoryBuilder.setUuid(getEquipment().getUuid().getValue());
             // -- String list with ids of holders
-            List<String> containerHolderKeyList = new ArrayList<>();
+            Set<String> containerHolderKeyList = new HashSet<>();
             Collection<ContainedHolder> containerHolderList = YangHelper.getCollection(getEquipment().getContainedHolder());
             if (containerHolderList != null) {
                 for (ContainedHolder containerHolder : containerHolderList) {
index b935690..d1598ad 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 23da17b..74474ea 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 35c38a0..6bec869 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 48cc2b8..ec81099 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index b1040de..4714fe9 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     </properties>
     
     <dependencies>
-        <!-- begin for testing -->
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <!-- end for testing -->
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-devicemanager-onap-onf14-model</artifactId>
             <artifactId>sdnr-wt-devicemanager-core-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
+        </dependency>        
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-websocketmanager-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>     
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-binding-dom-codec-api</artifactId>
@@ -86,7 +97,6 @@
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>sal-netconf-connector</artifactId>
-            <version>2.0.4</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <artifactId>rfc6991-ietf-yang-types</artifactId>
             <scope>provided</scope>
         </dependency>
+        <!-- begin for testing -->
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>   
+        <!-- end for testing -->
     </dependencies>
 
     <build>
                <plugin>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>yang-maven-plugin</artifactId>
+          <version>7.0.9</version>
           <executions>
             <execution>
               <id>binding</id>
index 8a75bbc..2a93137 100644 (file)
@@ -2,8 +2,11 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovide
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Objects;
+import java.util.Set;
+
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DMDOMUtility;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory;
@@ -35,7 +38,7 @@ public class Onf14DomToInternalDataModel {
         inventoryBuilder.setUuid(Onf14DMDOMUtility.getUuidFromEquipment(currentEq));
         inventoryBuilder.setParentUuid(parentUuid);
 
-        List<String> containedHolderKeyList = new ArrayList<>();
+        Set<String> containedHolderKeyList = new HashSet<>();
         MapNode containedHolderMap = (MapNode) currentEq
                 .childByArg(new NodeIdentifier(Onf14DevicemanagerQNames.CORE_MODEL_CC_EQPT_CONTAINED_HOLDER));
         if (containedHolderMap != null) {
index ad79a5c..6dc9b50 100644 (file)
@@ -82,7 +82,7 @@ public class Onf14DomTestUtils {
 
 
     public static NormalizedNode getNormalizedNodeFromJson() throws IOException, URISyntaxException {
-        schemaContext = TestYangParserUtil.parseYangResourceDirectory("/");
+        schemaContext = YangParserTestUtils.parseYangResourceDirectory("/");
         lhotkaCodecFactory = JSONCodecFactorySupplier.DRAFT_LHOTKA_NETMOD_YANG_JSON_02.getShared(schemaContext);
         streamAsString =
                 loadTextFile(new File(Onf14DomTestUtils.class.getResource("/ControlConstruct-data-test.json").toURI()));
@@ -105,7 +105,7 @@ public class Onf14DomTestUtils {
 
     public static NormalizedNode getNormalizedNodeFromXML()
             throws XMLStreamException, URISyntaxException, IOException, SAXException {
-        schemaContext = TestYangParserUtil.parseYangResourceDirectory("/");
+        schemaContext = YangParserTestUtils.parseYangResourceDirectory("/");
         hwContainerSchema = Inference.ofDataTreePath(schemaContext, CORE_MODEL_CONTROL_CONSTRUCT_CONTAINER);
         final InputStream resourceAsStream =
                 Onf14DomTestUtils.class.getResourceAsStream("/ControlConstruct-data-test.xml");
diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/TestYangParserUtil.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/TestYangParserUtil.java
deleted file mode 100644 (file)
index a0cfa67..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * ONAP : ccsdk features
- * ================================================================================
- * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property.
- * All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- *
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.util;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.YangConstants;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
-import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.parser.api.YangParser;
-import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
-import org.opendaylight.yangtools.yang.parser.api.YangParserException;
-import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
-import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
-
-public final class TestYangParserUtil {
-
-       private static final FileFilter YANG_FILE_FILTER = file -> {
-               final String name = file.getName();
-               return name.endsWith(YangConstants.RFC6020_YANG_FILE_EXTENSION) && file.isFile();
-       };
-
-       private static final @NonNull YangParserFactory PARSER_FACTORY;
-
-       static {
-               final Iterator<@NonNull YangParserFactory> it = ServiceLoader.load(YangParserFactory.class).iterator();
-               if (!it.hasNext()) {
-                       throw new IllegalStateException("No YangParserFactory found");
-               }
-               PARSER_FACTORY = it.next();
-       }
-
-       public static EffectiveModelContext parseYangFiles(final YangParserConfiguration config, final File... files) {
-               return parseYangFiles(config, Arrays.asList(files));
-       }
-
-       public static EffectiveModelContext parseYangFiles(final YangParserConfiguration config,
-                       final Collection<File> files) {
-               return parseSources(config, files.stream().map(YangTextSchemaSource::forFile).collect(Collectors.toList()));
-       }
-
-       public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath) {
-               return parseYangResourceDirectory(resourcePath, YangParserConfiguration.DEFAULT);
-       }
-
-       public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath,
-                       final YangParserConfiguration config) {
-               final URI directoryPath;
-               try {
-                       directoryPath = TestYangParserUtil.class.getResource(resourcePath).toURI();
-               } catch (URISyntaxException e) {
-                       throw new IllegalArgumentException("Failed to open resource " + resourcePath, e);
-               }
-               return parseYangFiles(config, new File(directoryPath).listFiles(YANG_FILE_FILTER));
-       }
-
-       public static EffectiveModelContext parseYangSources(final YangParserConfiguration config,
-                       final Set<QName> supportedFeatures, final YangTextSchemaSource... sources) {
-               return parseSources(config, Arrays.asList(sources));
-       }
-
-       public static EffectiveModelContext parseSources(final YangParserConfiguration config,
-                       final Collection<? extends SchemaSourceRepresentation> sources) {
-               final YangParser parser = PARSER_FACTORY.createParser(config);
-
-               try {
-                       parser.addSources(sources);
-               } catch (YangSyntaxErrorException e) {
-                       throw new IllegalArgumentException("Malformed source", e);
-               } catch (IOException e) {
-                       throw new IllegalArgumentException("Failed to read a source", e);
-               }
-
-               try {
-                       return parser.buildEffectiveModel();
-               } catch (YangParserException e) {
-                       throw new IllegalStateException("Failed to assemble SchemaContext", e);
-               }
-       }
-}
diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/YangParserTestUtils.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/YangParserTestUtils.java
new file mode 100644 (file)
index 0000000..ee20dcc
--- /dev/null
@@ -0,0 +1,382 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.util;
+
+import com.google.common.annotations.Beta;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.YangConstants;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.api.YangParser;
+import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
+import org.opendaylight.yangtools.yang.parser.api.YangParserException;
+import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
+import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
+import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
+import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+/**
+ * Utility class which provides convenience methods for producing effective schema context based on the supplied
+ * yang/yin sources or paths to these sources.
+ */
+@Beta
+public final class YangParserTestUtils {
+
+    private static final FileFilter YANG_FILE_FILTER = file -> {
+        // Locale keeps SpotBugs happy. It should not matter that much anyway.
+        final String name = file.getName().toLowerCase(Locale.ENGLISH);
+        return name.endsWith(YangConstants.RFC6020_YANG_FILE_EXTENSION) && file.isFile();
+    };
+
+    private static final @NonNull YangParserFactory PARSER_FACTORY;
+
+    static {
+        final Iterator<@NonNull YangParserFactory> it = ServiceLoader.load(YangParserFactory.class).iterator();
+        if (!it.hasNext()) {
+            throw new IllegalStateException("No YangParserFactory found");
+        }
+        PARSER_FACTORY = it.next();
+    }
+
+    private YangParserTestUtils() {
+        // Hidden on purpose
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG source. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param resource relative path to the YANG file to be parsed
+     *
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResource(final String resource) {
+        return parseYangResource(resource, YangParserConfiguration.DEFAULT);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG source. All YANG features are supported.
+     *
+     * @param resource relative path to the YANG file to be parsed
+     * @param parserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResource(final String resource, final YangParserConfiguration config) {
+        return parseYangResource(resource, config, null);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG source. Statement parser mode is set to
+     * default mode.
+     *
+     * @param resource relative path to the YANG file to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          model are resolved
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResource(final String resource, final Set<QName> supportedFeatures) {
+        return parseYangResource(resource, YangParserConfiguration.DEFAULT, supportedFeatures);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG source.
+     *
+     * @param resource relative path to the YANG file to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          model are resolved
+     * @param parserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResource(final String resource, final YangParserConfiguration config,
+            final Set<QName> supportedFeatures) {
+        final YangTextSchemaSource source = YangTextSchemaSource.forResource(YangParserTestUtils.class, resource);
+        return parseYangSources(config, supportedFeatures, source);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final File... files) {
+        return parseYangFiles(Arrays.asList(files));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param files collection of YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final Collection<File> files) {
+        return parseYangFiles(YangParserConfiguration.DEFAULT, files);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode.
+     *
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final Set<QName> supportedFeatures, final File... files) {
+        return parseYangFiles(supportedFeatures, Arrays.asList(files));
+    }
+
+    public static EffectiveModelContext parseYangFiles(final Set<QName> supportedFeatures,
+            final Collection<File> files) {
+        return parseYangFiles(supportedFeatures, YangParserConfiguration.DEFAULT, files.stream().map(e->e.toPath()).collect(Collectors.toList()));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.
+     *
+     * @param parserMode mode of statement parser
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final YangParserConfiguration config, final File... files) {
+        return parseYangFiles(config, Arrays.asList(files));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.
+     *
+     * @param parserMode mode of statement parser
+     * @param files collection of YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final YangParserConfiguration config,
+            final Collection<File> files) {
+        return parseYangFiles(null, config, files.stream().map(e->e.toPath()).collect(Collectors.toList()));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources.
+     *
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param parserMode mode of statement parser
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final Set<QName> supportedFeatures,
+               final YangParserConfiguration config, final Path... files) {
+        return parseYangFiles(supportedFeatures, config, Arrays.asList(files));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources.
+     *
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param parserMode mode of statement parser
+     * @param files YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangFiles(final Set<QName> supportedFeatures,
+               final YangParserConfiguration config, final Collection<Path> files) {
+        return parseSources(config, supportedFeatures,
+            files.stream().map(YangTextSchemaSource::forPath).collect(Collectors.toList()));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param resourcePath relative path to the directory with YANG files to be parsed
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath) {
+        return parseYangResourceDirectory(resourcePath, YangParserConfiguration.DEFAULT);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.
+     *
+     * @param resourcePath relative path to the directory with YANG files to be parsed
+     * @param parserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath,
+               final YangParserConfiguration config) {
+        return parseYangResourceDirectory(resourcePath, null, config);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode.
+     *
+     * @param resourcePath relative path to the directory with YANG files to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath,
+            final Set<QName> supportedFeatures) {
+        return parseYangResourceDirectory(resourcePath, supportedFeatures, YangParserConfiguration.DEFAULT);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources.
+     *
+     * @param resourcePath relative path to the directory with YANG files to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param parserMode mode of statement parser
+     * @return effective schema context
+     */
+    @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Wrong inferent on listFiles")
+    public static EffectiveModelContext parseYangResourceDirectory(final String resourcePath,
+            final Set<QName> supportedFeatures, final YangParserConfiguration config) {
+        final URI directoryPath;
+        try {
+            directoryPath = YangParserTestUtils.class.getResource(resourcePath).toURI();
+        } catch (URISyntaxException e) {
+            throw new IllegalArgumentException("Failed to open resource " + resourcePath, e);
+        }
+        File[] files = new File(directoryPath).listFiles(YANG_FILE_FILTER);
+        return parseYangFiles(supportedFeatures, config, Arrays.asList(files).stream().map(e->e.toPath()).collect(Collectors.toList()));
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode and all YANG features are supported.
+     *
+     * @param clazz Resource lookup base
+     * @param resources Resource names to be looked up
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResources(final Class<?> clazz, final String... resources) {
+        return parseYangResources(clazz, Arrays.asList(resources));
+    }
+
+    public static EffectiveModelContext parseYangResources(final Class<?> clazz, final Collection<String> resources) {
+        final List<YangTextSchemaSource> sources = new ArrayList<>(resources.size());
+        for (final String r : resources) {
+            sources.add(YangTextSchemaSource.forResource(clazz, r));
+        }
+        return parseSources(YangParserConfiguration.DEFAULT, null, sources);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
+     * default mode.
+     *
+     * @param yangDirs relative paths to the directories containing YANG files to be parsed
+     * @param yangFiles relative paths to the YANG files to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResources(final List<String> yangDirs, final List<String> yangFiles,
+            final Set<QName> supportedFeatures) {
+        return parseYangResources(yangDirs, yangFiles, supportedFeatures, YangParserConfiguration.DEFAULT);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.
+     *
+     * @param yangResourceDirs relative paths to the directories containing YANG files to be parsed
+     * @param yangResources relative paths to the YANG files to be parsed
+     * @param statementParserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResources(final List<String> yangResourceDirs,
+            final List<String> yangResources, final YangParserConfiguration config) {
+        return parseYangResources(yangResourceDirs, yangResources, null, config);
+    }
+
+    /**
+     * Creates a new effective schema context containing the specified YANG sources.
+     *
+     * @param yangResourceDirs relative paths to the directories containing YANG files to be parsed
+     * @param yangResources relative paths to the YANG files to be parsed
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG
+     *                          models are resolved
+     * @param statementParserMode mode of statement parser
+     * @return effective schema context
+     */
+    public static EffectiveModelContext parseYangResources(final List<String> yangResourceDirs,
+            final List<String> yangResources, final Set<QName> supportedFeatures,
+            final YangParserConfiguration config) {
+        final List<File> allYangFiles = new ArrayList<>();
+        for (final String yangDir : yangResourceDirs) {
+            allYangFiles.addAll(getYangFiles(yangDir));
+        }
+
+        for (final String yangFile : yangResources) {
+            try {
+                allYangFiles.add(new File(YangParserTestUtils.class.getResource(yangFile).toURI()));
+            } catch (URISyntaxException e) {
+                throw new IllegalArgumentException("Invalid resource " + yangFile, e);
+            }
+        }
+
+        return parseYangFiles(supportedFeatures, config, allYangFiles.stream().map(e->e.toPath()).collect(Collectors.toList()));
+    }
+
+    public static EffectiveModelContext parseYangSources(final YangParserConfiguration config,
+            final Set<QName> supportedFeatures, final YangTextSchemaSource... sources) {
+        return parseSources(config, supportedFeatures, Arrays.asList(sources));
+    }
+
+    public static EffectiveModelContext parseSources(final YangParserConfiguration config,
+            final Set<QName> supportedFeatures, final Collection<? extends SchemaSourceRepresentation> sources) {
+        final YangParser parser = PARSER_FACTORY.createParser(config);
+        if (supportedFeatures != null) {
+            parser.setSupportedFeatures(supportedFeatures);
+        }
+
+        try {
+            parser.addSources(sources);
+        } catch (YangSyntaxErrorException e) {
+            throw new IllegalArgumentException("Malformed source", e);
+        } catch (IOException e) {
+            throw new IllegalArgumentException("Failed to read a source", e);
+        }
+
+        try {
+            return parser.buildEffectiveModel();
+        } catch (YangParserException e) {
+            throw new IllegalStateException("Failed to assemble SchemaContext", e);
+        }
+    }
+
+    @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Wrong inferent on listFiles")
+    private static Collection<File> getYangFiles(final String resourcePath) {
+        final URI directoryPath;
+        try {
+            directoryPath = YangParserTestUtils.class.getResource(resourcePath).toURI();
+        } catch (URISyntaxException e) {
+            throw new IllegalArgumentException("Failed to open resource directory " + resourcePath, e);
+        }
+        return Arrays.asList(new File(directoryPath).listFiles(YANG_FILE_FILTER));
+    }
+}
index 74abefe..ecfdaa6 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index b956c1c..ccb6203 100755 (executable)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index b6b9c1c..b628bfa 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index bd1d486..11ce28e 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 5098575..0505bb0 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     </properties>
 
     <dependencies>
-        <!-- begin for testing -->
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <version>2.28.2</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <artifactId>byte-buddy</artifactId>
-            <groupId>net.bytebuddy</groupId>
-            <version>1.9.10</version>
-            <scope>test</scope>
-        </dependency>
-
-        <!-- end for testing -->
-            
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>ietf-alarms</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-data-provider-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
-      </dependency>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-websocketmanager-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-netconfnode-state-service-model</artifactId>
             <artifactId>org.osgi.core</artifactId>
             <scope>provided</scope>
         </dependency>
+         <!-- begin for testing -->
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>3.2.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <artifactId>byte-buddy</artifactId>
+            <groupId>net.bytebuddy</groupId>
+            <scope>test</scope>
+        </dependency>
+        <!-- end for testing -->
     </dependencies>
 
     <build>
index 87f195d..4d64cca 100644 (file)
@@ -32,6 +32,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.OpenroadmChangeNotificationListener;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
 import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.pack.features.CircuitPackComponents;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfigChange;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.Edit;
@@ -56,7 +57,7 @@ public class TestChangeNotificationListener {
         OpenroadmChangeNotificationListener notifListener =
                 new OpenroadmChangeNotificationListener(netconfAccessor, databaseService, notificationService);
         when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID));
-        Iterable<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
+        List<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
 
             @Override
             public int compareTo(PathArgument arg0) {
@@ -65,10 +66,10 @@ public class TestChangeNotificationListener {
 
             @Override
             public Class<? extends DataObject> getType() {
-                return DataObject.class;
+                return CircuitPackComponents.class;
             }
         });
-        InstanceIdentifier<?> target = InstanceIdentifier.create(pathArguments);
+        InstanceIdentifier<?> target = InstanceIdentifier.unsafeOf(pathArguments);
 
         notifListener.onNetconfConfigChange(createNotification(EditOperationType.Create, target));
         EventlogEntity event = new EventlogBuilder().setNodeId(NODEID)
index ca9ce35..2e94e79 100644 (file)
@@ -41,6 +41,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.CreateTe
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.CreateTechInfoNotificationBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.change.notification.Edit;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.change.notification.EditBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.pack.features.circuit.pack.components.Component;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
@@ -65,7 +66,7 @@ public class TestOpenRoadmDeviceChangeNotification {
     public void testOnChangeNotification() {
 
         when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID));
-        Iterable<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
+        List<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
 
             @Override
             public int compareTo(PathArgument arg0) {
@@ -74,10 +75,10 @@ public class TestOpenRoadmDeviceChangeNotification {
 
             @Override
             public Class<? extends DataObject> getType() {
-                return DataObject.class;
+                return Component.class;
             }
         });
-        InstanceIdentifier<?> target = InstanceIdentifier.create(pathArguments);
+        InstanceIdentifier<?> target = InstanceIdentifier.unsafeOf(pathArguments);
 
         deviceChangeListener.onChangeNotification(createNotification(EditOperationType.Create, target));
         EventlogEntity event =
index 2a70ec7..2024490 100644 (file)
@@ -40,6 +40,7 @@ import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.alarm.pm.types.rev191129.Direction;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.alarm.pm.types.rev191129.Location;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.pack.features.circuit.pack.components.Component;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.HistoricalPmList;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.group.HistoricalPm;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.group.HistoricalPmBuilder;
@@ -142,10 +143,10 @@ public class TestOpenRoadmPMDataBuilder {
             @Override
             public @NonNull Class<? extends DataObject> getType() {
                 // TODO Auto-generated method stub
-                return Pmdata15mEntity.class;
+                return Component.class;
             }
         };
-        historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.create(Arrays.asList(pa)))
+        historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.unsafeOf(Arrays.asList(pa)))
         .setPmResourceTypeExtension("dshjdekjdewkk")
                 .setPmResourceType(ResourceTypeEnum.CircuitPack).setHistoricalPm(historicalPMCollection);
 
@@ -179,11 +180,11 @@ public class TestOpenRoadmPMDataBuilder {
             @Override
             public Class<? extends DataObject> getType() {
                 // TODO Auto-generated method stub
-                return Pmdata15mEntity.class;
+                return Component.class;
             }
         };
         historicalPMCollection.put(historicalPmBuilder.key(), historicalPmBuilder.build());
-        historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.create(Arrays.asList(pa)))
+        historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.unsafeOf(Arrays.asList(pa)))
             .setPmResourceTypeExtension("dshjdekjdewkk")
                 .setPmResourceType(ResourceTypeEnum.Device).setHistoricalPm(historicalPMCollection);
 
index e8603fa..b74d9e1 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 45f41a0..c1aa2ac 100755 (executable)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 264b224..b5e6933 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 93814a0..7dc7a5f 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 40d1b6e..2d94bc2 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     </properties>
 
     <dependencies>
-        <!-- begin for testing -->
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-<!--             <version>2.28.2</version> -->
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <artifactId>byte-buddy</artifactId>
-            <groupId>net.bytebuddy</groupId>
-<!--             <version>1.9.10</version> -->
-            <scope>test</scope>
-        </dependency>
-
-        <!-- end for testing -->
             
         <dependency>
             <groupId>${project.groupId}</groupId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-websocketmanager-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-netconfnode-state-service-model</artifactId>
             <artifactId>org.osgi.core</artifactId>
             <scope>provided</scope>
         </dependency>
+        <!-- begin for testing -->
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <artifactId>byte-buddy</artifactId>
+            <groupId>net.bytebuddy</groupId>
+            <scope>test</scope>
+        </dependency>
+        <!-- end for testing -->
     </dependencies>
 
     <build>
index 1f6cfd6..2f48d79 100644 (file)
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl;
 
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.Interface;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Info;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Xponder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.Info;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.Xponder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.Shelves;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.InventoryBuilder;
index 1800917..2a22e1e 100644 (file)
@@ -33,10 +33,10 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServic
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.Interface;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Xponder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.Xponder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelf.Slots;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.Shelves;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.xponder.XpdrPort;
@@ -310,7 +310,8 @@ public class OpenroadmNetworkElement extends OpenroadmNetworkElementBase {
     }
 
     private OrgOpenroadmDevice readDevice(NetconfBindingAccessor accessor) {
-        InstanceIdentifier<OrgOpenroadmDevice> deviceId = InstanceIdentifier.create(OrgOpenroadmDevice.class);
+       final Class<OrgOpenroadmDevice> openRoadmDev = OrgOpenroadmDevice.class;
+        InstanceIdentifier<OrgOpenroadmDevice> deviceId = InstanceIdentifier.builder(openRoadmDev).build();
         return accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
                 deviceId);
     }
index 552058f..04b6b2a 100644 (file)
@@ -28,7 +28,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.OrgOpenroadmDevice;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 5e690f5..281e94b 100644 (file)
@@ -1851,7 +1851,7 @@ module org-openroadm-device {
       "Mux group grouping";
   }
 
-  grouping org-openroadm-device-container {
// grouping org-openroadm-device-container {
     container org-openroadm-device {
       container info {
         uses device-common;
@@ -2286,7 +2286,7 @@ module org-openroadm-device {
         uses mux-grp;
       }
     }
-  }
// }
 
   grouping common-session-parms {
     description
@@ -2604,5 +2604,5 @@ module org-openroadm-device {
     }
   }
 
-  uses org-openroadm-device-container;
+  //uses org-openroadm-device-container;
 }
index f7732c7..fa21e77 100644 (file)
@@ -32,6 +32,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmChangeNotificationListener;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
 import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.pack.features.circuit.pack.components.Component;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfigChange;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.Edit;
@@ -56,7 +57,7 @@ public class TestChangeNotificationListener {
         OpenroadmChangeNotificationListener notifListener =
                 new OpenroadmChangeNotificationListener(netconfAccessor, databaseService, notificationService);
         when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID));
-        Iterable<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
+        List<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
 
             @Override
             public int compareTo(PathArgument arg0) {
@@ -65,10 +66,10 @@ public class TestChangeNotificationListener {
 
             @Override
             public Class<? extends DataObject> getType() {
-                return DataObject.class;
+                return Component.class;
             }
         });
-        InstanceIdentifier<?> target = InstanceIdentifier.create(pathArguments);
+        InstanceIdentifier<?> target = InstanceIdentifier.unsafeOf(pathArguments);
 
         notifListener.onNetconfConfigChange(createNotification(EditOperationType.Create, target));
         EventlogEntity event = new EventlogBuilder().setNodeId(NODEID)
index 6188cc5..f9b5b51 100644 (file)
@@ -41,6 +41,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.CreateTe
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.CreateTechInfoNotificationBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.change.notification.Edit;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.change.notification.EditBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.pack.features.circuit.pack.components.Component;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
@@ -65,7 +66,7 @@ public class TestOpenRoadmDeviceChangeNotification {
     public void testOnChangeNotification() {
 
         when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID));
-        Iterable<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
+        List<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() {
 
             @Override
             public int compareTo(PathArgument arg0) {
@@ -74,10 +75,10 @@ public class TestOpenRoadmDeviceChangeNotification {
 
             @Override
             public Class<? extends DataObject> getType() {
-                return DataObject.class;
+                return Component.class;
             }
         });
-        InstanceIdentifier<?> target = InstanceIdentifier.create(pathArguments);
+        InstanceIdentifier<?> target = InstanceIdentifier.unsafeOf(pathArguments);
 
         deviceChangeListener.onChangeNotification(createNotification(EditOperationType.Create, target));
         EventlogEntity event =
index 2b2b2c6..7a03aa3 100644 (file)
@@ -32,12 +32,12 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev1911
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.LifecycleState;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev200529.OpenroadmVersionType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.Interface;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Info;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.InfoBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Xponder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.Info;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.InfoBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.Xponder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.Shelves;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.XpdrNodeTypes;
index 9ef0f64..a018df7 100644 (file)
@@ -50,16 +50,16 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev1911
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.LifecycleState;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev200529.OpenroadmVersionType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.pack.ParentCircuitPack;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacksKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.Interface;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.InterfaceKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Info;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.InfoBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Xponder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.XponderKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.Info;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.InfoBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.Xponder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.XponderKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelf.Slots;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelf.SlotsKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.Shelves;
index a35c5f0..5e71fac 100644 (file)
@@ -37,7 +37,7 @@ import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAcc
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
index 3a0781e..49585ac 100644 (file)
@@ -40,6 +40,7 @@ import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.alarm.pm.types.rev191129.Direction;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.alarm.pm.types.rev191129.Location;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.pack.features.circuit.pack.components.Component;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.HistoricalPmList;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.group.HistoricalPm;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.group.HistoricalPmBuilder;
@@ -142,10 +143,10 @@ public class TestOpenRoadmPMDataBuilder {
             @Override
             public @NonNull Class<? extends DataObject> getType() {
                 // TODO Auto-generated method stub
-                return Pmdata15mEntity.class;
+                return Component.class;
             }
         };
-        historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.create(Arrays.asList(pa)))
+        historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.unsafeOf(Arrays.asList(pa)))
         .setPmResourceTypeExtension("dshjdekjdewkk")
                 .setPmResourceType(ResourceTypeEnum.CircuitPack).setHistoricalPm(historicalPMCollection);
 
@@ -179,11 +180,11 @@ public class TestOpenRoadmPMDataBuilder {
             @Override
             public Class<? extends DataObject> getType() {
                 // TODO Auto-generated method stub
-                return Pmdata15mEntity.class;
+                return Component.class;
             }
         };
         historicalPMCollection.put(historicalPmBuilder.key(), historicalPmBuilder.build());
-        historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.create(Arrays.asList(pa)))
+        historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.unsafeOf(Arrays.asList(pa)))
             .setPmResourceTypeExtension("dshjdekjdewkk")
                 .setPmResourceType(ResourceTypeEnum.Device).setHistoricalPm(historicalPMCollection);
 
index 10b129b..d61cb28 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
-        <dependency>
+        <!-- <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-mountpoint-registrar-feature</artifactId>
             <version>${project.version}</version>
             <type>xml</type>
             <classifier>features</classifier>
-        </dependency>
+        </dependency> -->
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-mountpoint-state-provider-feature</artifactId>
index 063aae2..155cf14 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index f33ad4e..2137872 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 164f073..b5398a5 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
-        <dependency>
+       <!-- <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-mountpoint-registrar-feature</artifactId>
             <version>${project.version}</version>
             <type>xml</type>
             <classifier>features</classifier>
-        </dependency>
+        </dependency>-->
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-mountpoint-state-provider-feature</artifactId>
index aed60f7..a6ce808 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index b467f8c..7ea89d0 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -41,6 +42,7 @@
 
     <modules>
         <module>feature</module>
+<!--        <module>feature-minimal</module> -->
         <module>feature-oauth</module>
         <module>feature-devicemanager</module>
         <module>feature-devicemanager-base</module>
index cdfda4e..4dc7fd8 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 81e9e5f..bff0ed9 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 40a47a6..37c14aa 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 7a33bea..a961d52 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -52,6 +53,7 @@
         <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
index f8a9d1a..d6a36a2 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 6cc83af..66673a2 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 71dab84..d83d934 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index ab9c87b..dfe93c0 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 8aea0b0..dc75bb3 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
-        <relativePath/>
+        <version>2.4.1-SNAPSHOT</version>
+        <relativePath />
     </parent>
 
     <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
     </properties>
 
     <dependencies>
-        <!-- begin for testing -->
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <!-- end for testing -->
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-mountpoint-registrar-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-devicemanager-core-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
             <artifactId>dmaapClient</artifactId>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>sdnr-wt-data-provider-model</artifactId>
-            <version>${project.version}</version>
-            <scope>provided</scope>
-        </dependency>
+                       <groupId>com.google.code.findbugs</groupId>
+                       <artifactId>annotations</artifactId>
+                       <scope>provided</scope>
+               </dependency>
+        <!-- begin for testing -->
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>sdnr-wt-devicemanager-core-model</artifactId>
-            <version>${project.version}</version>
-            <scope>provided</scope>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
         </dependency>
+        <!-- end for testing -->
+        
     </dependencies>
 
     <build>
index 346b2fa..e2922a3 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 1170289..2b8367c 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 2af5f9d..5473bb8 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 9bc1530..5094f49 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     </properties>
 
     <dependencies>
-        <!-- begin for testing -->
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <!-- end for testing -->
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-common</artifactId>
@@ -75,6 +69,7 @@
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-netconfnode-state-service-model</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
             <scope>provided</scope>
+        </dependency>        
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+             <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+             <scope>provided</scope>
         </dependency>
+        <!-- begin for testing -->
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <!-- <version>3.4.2</version> -->
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-websocketmanager-model</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- end for testing -->
     </dependencies>
 
     <build>
diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESCommonEventHeaderPOJO.java b/sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESCommonEventHeaderPOJO.java
deleted file mode 100644 (file)
index 7b15ae1..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
- * =================================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- * ============LICENSE_END==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.impl;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonPropertyOrder({"domain", "eventId", "eventName", "eventType", "lastEpochMicrosec", "nfcNamingCode", "nfNamingCode", "nfVendorName", "priority", "reportingEntityId",
-    "reportingEntityName", "sequence", "sourceId", "sourceName", "startEpochMicrosec", "timeZoneOffset", "version", "vesEventListenerVersion"})
-public class VESCommonEventHeaderPOJO {
-
-    private String domain = "";
-    private String eventId = "";
-    private String eventName = "";
-    private String eventType = "";
-    private long sequence = 0L;
-    private String priority = "";
-    @JsonIgnore
-    private String reportingEntityId = "";
-    private String reportingEntityName = "";
-    private String sourceId = "";
-    private String sourceName = "";
-    private long startEpochMicrosec = 0L;
-    private long lastEpochMicrosec = 0L;
-    private String nfcNamingCode = "";
-    private String nfNamingCode = "";
-    private String nfVendorName = "";
-    private String timeZoneOffset = "+00:00";
-    private String version = "4.1";
-    private String vesEventListenerVersion = "7.1.1";
-
-    public String getDomain() {
-        return domain;
-    }
-
-    public void setDomain(String domain) {
-        this.domain = domain;
-    }
-
-    public String getEventId() {
-        return eventId;
-    }
-
-    public void setEventId(String eventId) {
-        this.eventId = eventId;
-    }
-
-    public String getEventName() {
-        return eventName;
-    }
-
-    public void setEventName(String eventName) {
-        this.eventName = eventName;
-    }
-
-    public String getEventType() {
-        return eventType;
-    }
-
-    public void setEventType(String eventType) {
-        this.eventType = eventType;
-    }
-
-    public Long getSequence() {
-        return sequence;
-    }
-
-    public void setSequence(long sequenceNo) {
-        this.sequence = sequenceNo;
-    }
-
-    public String getPriority() {
-        return priority;
-    }
-
-    public void setPriority(String priority) {
-        this.priority = priority;
-    }
-
-    public String getReportingEntityId() {
-        return reportingEntityId;
-    }
-
-    public void setReportingEntityId(String reportingEntityId) {
-        this.reportingEntityId = reportingEntityId;
-    }
-
-    public String getReportingEntityName() {
-        return reportingEntityName;
-    }
-
-    public void setReportingEntityName(String reportingEntityName) {
-        this.reportingEntityName = reportingEntityName;
-    }
-
-    public String getSourceId() {
-        return sourceId;
-    }
-
-    public void setSourceId(String sourceId) {
-        this.sourceId = sourceId;
-    }
-
-    public String getSourceName() {
-        return sourceName;
-    }
-
-    public void setSourceName(String sourceName) {
-        this.sourceName = sourceName;
-    }
-
-    public long getStartEpochMicrosec() {
-        return startEpochMicrosec;
-    }
-
-    public void setStartEpochMicrosec(long startEpochMicrosec) {
-        this.startEpochMicrosec = startEpochMicrosec;
-    }
-
-    public long getLastEpochMicrosec() {
-        return lastEpochMicrosec;
-    }
-
-    public void setLastEpochMicrosec(long lastEpochMicrosec) {
-        this.lastEpochMicrosec = lastEpochMicrosec;
-    }
-
-    public String getNfcNamingCode() {
-        return nfcNamingCode;
-    }
-
-    public void setNfcNamingCode(String nfcNamingCode) {
-        this.nfcNamingCode = nfcNamingCode;
-    }
-
-    public String getNfNamingCode() {
-        return nfNamingCode;
-    }
-
-    public void setNfNamingCode(String nfNamingCode) {
-        this.nfNamingCode = nfNamingCode;
-    }
-
-    public String getNfVendorName() {
-        return nfVendorName;
-    }
-
-    public void setNfVendorName(String nfVendorName) {
-        this.nfVendorName = nfVendorName;
-    }
-
-    public String getTimeZoneOffset() {
-        return timeZoneOffset;
-    }
-
-    public void setTimeZoneOffset(String timeZoneOffset) {
-        this.timeZoneOffset = timeZoneOffset;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public String getVesEventListenerVersion() {
-        return vesEventListenerVersion;
-    }
-
-    public void setVesEventListenerVersion(String vesEventListenerVersion) {
-        this.vesEventListenerVersion = vesEventListenerVersion;
-    }
-}
diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESEvent.java b/sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESEvent.java
deleted file mode 100644 (file)
index 7989166..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
- * =================================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- * ============LICENSE_END==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class VESEvent {
-    private Map<String, Object> event = new HashMap<>();
-
-    public void addEventObjects(Object eventObject) {
-        if (eventObject instanceof VESCommonEventHeaderPOJO)
-            event.put("commonEventHeader", eventObject);
-        else if (eventObject instanceof VESNotificationFieldsPOJO)
-            event.put("notificationFields", eventObject);
-
-    }
-
-    public Map<String, Object> getEvent() {
-        return event;
-    }
-}
diff --git a/sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESNotificationFieldsPOJO.java b/sdnr/wt/mountpoint-state-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointstateprovider/impl/VESNotificationFieldsPOJO.java
deleted file mode 100644 (file)
index 1d2c2dc..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
- * =================================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- * ============LICENSE_END==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.mountpointstateprovider.impl;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@JsonPropertyOrder({"arrayOfNamedHashMap", "changeContact", "changeIdentifier", "changeType", "newState", "oldState", "notificationFieldsVersion"})
-public class VESNotificationFieldsPOJO {
-
-    private List<HashMap<String, Object>> arrayOfNamedHashMap = new ArrayList<>();
-    @JsonIgnore
-    private Map<String, Object> namedHashMap = new HashMap<>();
-    @JsonIgnore
-    private Map<String, String> hashMap = new HashMap<>();
-    @JsonIgnore
-    private String changeContact = "";
-    private String changeIdentifier = "";
-    private String changeType = "";
-    //@JsonIgnore
-    private String newState = "";
-    @JsonIgnore
-    private String oldState = "";
-    @JsonIgnore
-    private String stateInterface = "";
-    private String notificationFieldsVersion = "2.0";
-
-    public List<HashMap<String, Object>> getArrayOfNamedHashMap() {
-        return arrayOfNamedHashMap;
-    }
-
-    public void setArrayOfNamedHashMap(List<HashMap<String, Object>> arrayOfNamedHashMap) {
-        this.arrayOfNamedHashMap = arrayOfNamedHashMap;
-    }
-
-    public String getChangeContact() {
-        return changeContact;
-    }
-
-    public void setChangeContact(String changeContact) {
-        this.changeContact = changeContact;
-    }
-
-    public String getChangeIdentifier() {
-        return changeIdentifier;
-    }
-
-    public void setChangeIdentifier(String changeIdentifier) {
-        this.changeIdentifier = changeIdentifier;
-    }
-
-    public String getChangeType() {
-        return changeType;
-    }
-
-    public void setChangeType(String changeType) {
-        this.changeType = changeType;
-    }
-
-    public String getNewState() {
-        return newState;
-    }
-
-    public void setNewState(String newState) {
-        this.newState = newState;
-    }
-
-    public String getOldState() {
-        return oldState;
-    }
-
-    public void setOldState(String oldState) {
-        this.oldState = oldState;
-    }
-
-    public String getStateInterface() {
-        return stateInterface;
-    }
-
-    public void setStateInterface(String stateInterface) {
-        this.stateInterface = stateInterface;
-    }
-
-    public String getNotificationFieldsVersion() {
-        return notificationFieldsVersion;
-    }
-
-    public void setNotificationFieldsVersion(String notificationFieldsVersion) {
-        this.notificationFieldsVersion = notificationFieldsVersion;
-    }
-}
index b972d74..07e69cf 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 90a1523..2b6bdc6 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 8f15f3e..e1b2a42 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-data-provider-model</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+              <groupId>com.google.code.findbugs</groupId>
+              <artifactId>annotations</artifactId>
+              <scope>provided</scope>
         </dependency>
     </dependencies>
 
diff --git a/sdnr/wt/netconfnode-state-service/model/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestCapabilities.java b/sdnr/wt/netconfnode-state-service/model/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestCapabilities.java
new file mode 100644 (file)
index 0000000..0471460
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property.
+ * All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import java.util.Arrays;
+import java.util.List;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.AvailableCapabilities;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.AvailableCapabilitiesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.UnavailableCapabilitiesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.available.capabilities.AvailableCapability;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.available.capabilities.AvailableCapabilityBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.unavailable.capabilities.UnavailableCapability;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.unavailable.capabilities.UnavailableCapabilityBuilder;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Revision;
+
+public class TestCapabilities {
+
+    @Test
+    public void testavailableCapabilities() {
+
+        NetconfNodeBuilder nnodeBuilder = new NetconfNodeBuilder().setAvailableCapabilities(getAvailableCapabilities());
+        Capabilities avcapabilities = Capabilities.getAvailableCapabilities(nnodeBuilder.build());
+
+        assertTrue(avcapabilities != null);
+
+    }
+
+    @Test
+    public void testunavailableCapabilities() {
+
+        List<UnavailableCapability> ucapList =
+                Arrays.asList(new UnavailableCapabilityBuilder().setCapability("(test-unavailable-capability?revision=2022-11-03)test").build());
+        UnavailableCapabilitiesBuilder ucb = new UnavailableCapabilitiesBuilder().setUnavailableCapability(ucapList);
+
+        NetconfNodeBuilder nnodeBuilder = new NetconfNodeBuilder().setUnavailableCapabilities(ucb.build());
+        Capabilities uavcapabilities = Capabilities.getUnavailableCapabilities(nnodeBuilder.build());
+        assert (uavcapabilities != null);
+
+    }
+
+    @Test
+    public void testNameSpaceRevision() {
+        QName qname = QName.create("test-capability", "test", Revision.of("2022-11-03"));
+        NetconfNodeBuilder nnodeBuilder = new NetconfNodeBuilder().setAvailableCapabilities(getAvailableCapabilities());
+        Capabilities avcapabilities = Capabilities.getAvailableCapabilities(nnodeBuilder.build());
+
+        NetconfAccessor accessor = mock(NetconfAccessor.class);
+        when(accessor.getCapabilites()).thenReturn(avcapabilities);
+        assertEquals("2022-11-03", accessor.getCapabilites().getRevisionForNamespace(qname));
+        assertEquals("test-capability?2022-11-03", Capabilities.getNamespaceAndRevisionAsString(qname));
+        assertTrue(accessor.getCapabilites().isSupportingNamespace(qname));
+        assertTrue(accessor.getCapabilites().isSupportingNamespace("test-capability"));
+        assertTrue(accessor.getCapabilites().isSupportingNamespaceAndRevision(qname));
+
+    }
+
+    private AvailableCapabilities getAvailableCapabilities() {
+
+        List<AvailableCapability> acapList =
+                Arrays.asList(new AvailableCapabilityBuilder().setCapability("(test-capability?revision=2022-11-03)test").build());
+        AvailableCapabilitiesBuilder acb = new AvailableCapabilitiesBuilder().setAvailableCapability(acapList);
+        return acb.build();
+
+    }
+}
index bdc018c..04add46 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 927c709..fe374be 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-singleton-common-api</artifactId>
             <scope>provided</scope>
+        </dependency>        
+        <dependency>
+              <groupId>com.google.code.findbugs</groupId>
+              <artifactId>annotations</artifactId>
+              <scope>provided</scope>
         </dependency>
         <!-- md-sal -->
         <dependency>
             <artifactId>config</artifactId>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+             <scope>provided</scope>
+        </dependency>
         <!-- wt -->
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-common</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
index 8605274..988dbd2 100644 (file)
 package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl;
 
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 import javax.annotation.Nullable;
 import org.eclipse.jdt.annotation.NonNull;
 import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
 import org.onap.ccsdk.features.sdnr.wt.common.configuration.filechange.IConfigChangedListener;
+import org.onap.ccsdk.features.sdnr.wt.common.threading.GenericRunnableFactory;
+import org.onap.ccsdk.features.sdnr.wt.common.threading.KeyBasedThreadpool;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEntityDataProvider;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.StatusChangedHandler.StatusKey;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
@@ -76,7 +74,6 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.parser.api.YangParserException;
 import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -102,6 +99,7 @@ public class NetconfNodeStateServiceImpl
 
     // Name of ODL controller NETCONF instance
     private static final NodeId CONTROLLER = new NodeId("controller-config");
+    private static final int ASYNC_EXECUTION_POOLSIZE = 20;
 
     // -- OSGi services, provided
     private DataBroker dataBroker;
@@ -147,7 +145,8 @@ public class NetconfNodeStateServiceImpl
     private String clusterName;
 
     /** nodeId to threadPool (size=1) for datatreechange handling) **/
-    private final Map<String, ExecutorService> handlingPool;
+    //    private final Map<String, ExecutorService> handlingPool;
+    private KeyBasedThreadpool<NodeId, NetconfChangeDataHolder> handlingPool;
 
     private boolean handleDataTreeAsync;
 
@@ -177,10 +176,8 @@ public class NetconfNodeStateServiceImpl
         this.netconfNodeStateListenerList = new CopyOnWriteArrayList<>();
         this.vesNotificationListenerList = new CopyOnWriteArrayList<>();
         this.accessorManager = null;
-        this.handlingPool = new HashMap<>();
-
+        this.handlingPool = null;
     }
-
     public void setDataBroker(DataBroker dataBroker) {
         this.dataBroker = dataBroker;
     }
@@ -221,13 +218,17 @@ public class NetconfNodeStateServiceImpl
         this.bindingNormalizedNodeSerializer = bindingNormalizedNodeSerializer;
     }
 
-    /** Blueprint initialization
-     * @throws YangParserException **/
+    /**
+     * Blueprint initialization
+     *
+     * @throws YangParserException
+     **/
     public void init() {
 
         LOG.info("Session Initiated start {}", APPLICATION_NAME);
         this.domContext = new DomContext(this.yangParserFactory, this.bindingNormalizedNodeSerializer);
-        this.netconfCommunicatorManager = new NetconfCommunicatorManager(mountPointService, domMountPointService, domContext);
+        this.netconfCommunicatorManager =
+                new NetconfCommunicatorManager(mountPointService, domMountPointService, domContext);
         this.accessorManager = new NetconfAccessorManager(netconfCommunicatorManager, domContext, this);
         // Start RPC Service
         this.rpcApiService = new NetconfnodeStateServiceRpcApiImpl(rpcProviderRegistry, vesNotificationListenerList);
@@ -257,7 +258,19 @@ public class NetconfNodeStateServiceImpl
 
         listenerL1 = dataBroker.registerDataTreeChangeListener(NETCONF_NODE_TOPO_TREE_ID, new L1());
         listenerL2 = dataBroker.registerDataTreeChangeListener(NETCONF_NODE_TOPO_TREE_ID, new L2());
-
+        this.handlingPool = new KeyBasedThreadpool<NodeId, NetconfChangeDataHolder>(this.config.getAsyncHandlingPoolsize(), 1,
+                new GenericRunnableFactory<>() {
+                    public Runnable create(final NodeId key, final NetconfChangeDataHolder arg) {
+                        return new Runnable() {
+
+                            @Override
+                            public void run() {
+                                NetconfNodeStateServiceImpl.this.handleDataTreeChange(arg.root, key,
+                                        arg.modificationTyp);
+                            }
+                        };
+                    };
+                });
         this.initializationSuccessful = true;
 
         LOG.info("Session Initiated end. Initialization done {}", initializationSuccessful);
@@ -270,7 +283,7 @@ public class NetconfNodeStateServiceImpl
     }
 
     public DomContext getDomContext() {
-        return Objects.requireNonNull(domContext, "Initialization not completed for domContext" );
+        return Objects.requireNonNull(domContext, "Initialization not completed for domContext");
     }
 
     public DataBroker getDataBroker() {
@@ -282,7 +295,7 @@ public class NetconfNodeStateServiceImpl
     }
 
     public NetconfnodeStateServiceRpcApiImpl getNetconfnodeStateServiceRpcApiImpl() {
-        return Objects.requireNonNull(rpcApiService, "Initialization not completed for rpcApiService" );
+        return Objects.requireNonNull(rpcApiService, "Initialization not completed for rpcApiService");
     }
 
     @Override
@@ -418,19 +431,19 @@ public class NetconfNodeStateServiceImpl
         LOG.info("isNetconfNodeMaster indication {} for mountpoint {}", isNetconfNodeMaster, mountPointNodeName);
         if (isNetconfNodeMaster) {
             NetconfAccessor acessor = accessorManager.getAccessor(nNodeId, netconfNode);
-                /*
-                 * --> Call Listers for onConnect() Indication
-                   for (all)
-                 */
-                netconfNodeConnectListenerList.forEach(item -> {
-                    try {
-                        item.onEnterConnected(acessor);
-                    } catch (Exception e) {
-                        LOG.info("Exception during onEnterConnected listener call", e);
-                    }
-                });
+            /*
+             * --> Call Listers for onConnect() Indication
+               for (all)
+             */
+            netconfNodeConnectListenerList.forEach(item -> {
+                try {
+                    item.onEnterConnected(acessor);
+                } catch (Exception e) {
+                    LOG.info("Exception during onEnterConnected listener call", e);
+                }
+            });
 
-                LOG.info("Connect indication forwarded for {}", mountPointNodeName);
+            LOG.info("Connect indication forwarded for {}", mountPointNodeName);
         }
     }
 
@@ -565,18 +578,9 @@ public class NetconfNodeStateServiceImpl
                         if (modificationTyp == null) {
                             LOG.warn("L1 empty modification type");
                         } else {
+                            LOG.trace("handle data tree change with async={}",this.handleDataTreeAsync);
                             if (this.handleDataTreeAsync) {
-                                ExecutorService executor = this.handlingPool.getOrDefault(nodeId.getValue(), null);
-                                if (executor == null) {
-                                    executor = Executors.newFixedThreadPool(5);
-                                    this.handlingPool.put(nodeId.getValue(), executor);
-                                }
-                                executor.execute(new Thread() {
-                                    @Override
-                                    public void run() {
-                                        handleDataTreeChange(root, nodeId, modificationTyp);
-                                    }
-                                });
+                                this.handlingPool.execute(nodeId, new NetconfChangeDataHolder(root, modificationTyp));
 
                             } else {
                                 handleDataTreeChange(root, nodeId, modificationTyp);
@@ -683,7 +687,20 @@ public class NetconfNodeStateServiceImpl
     @Override
     public void onConfigChanged() {
         this.handleDataTreeAsync = this.config.handleAsync();
+        //setting poolsize is not possible atm
+        //this.handlingPool.setPoolSize(this.config.getAsyncHandlingPoolsize());
 
     }
 
+    public class NetconfChangeDataHolder {
+
+        protected final DataObjectModification<Node> root;
+        protected final ModificationType modificationTyp;
+
+        public NetconfChangeDataHolder(DataObjectModification<Node> root, ModificationType modificationTyp) {
+            this.root = root;
+            this.modificationTyp = modificationTyp;
+        }
+
+    }
 }
index af09537..c781575 100644 (file)
@@ -21,6 +21,7 @@
  */
 package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl.conf;
 
+import java.util.Optional;
 import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
 import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
 import org.slf4j.Logger;
@@ -34,9 +35,11 @@ public class NetconfStateConfig implements Configuration {
     public static final String SECTION_MARKER_NCSTATE = "netconfstate";
 
     private static final String PROPERTY_KEY_HANDLEASYNC = "asynchandling";
-
-    private static final Object DEFAULT_VALUE_TRUSTALLCERTS = false;
-
+    private static final String PROPERTY_KEY_POOLSIZE= "poolsize";
+    private static final String DEFAULT_HANDLEASYNC = "${SDNR_ASYNC_HANDLING}";
+    private static final String DEFAULT_POOLSIZE = "${SDNR_ASYNC_POOLSIZE}";
+    private static final boolean DEFAULT_HANDLEASYNC_IFNOTSET = false;
+    private static final int DEFAULT_POOLSIZE_IFNOTSET = 20;
 
 
     private final ConfigurationFileRepresentation configuration;
@@ -50,7 +53,18 @@ public class NetconfStateConfig implements Configuration {
 
 
     public boolean handleAsync() {
-        return configuration.getPropertyBoolean(SECTION_MARKER_NCSTATE, PROPERTY_KEY_HANDLEASYNC);
+        final String s = this.configuration.getProperty(SECTION_MARKER_NCSTATE, PROPERTY_KEY_HANDLEASYNC);
+        if(s!= null && !s.isBlank()) {
+            return "true".equals(s);
+        }
+        return DEFAULT_HANDLEASYNC_IFNOTSET;
+    }
+    public int getAsyncHandlingPoolsize() {
+        Optional<Long> optional = this.configuration.getPropertyLong(SECTION_MARKER_NCSTATE,PROPERTY_KEY_POOLSIZE);
+        if(optional.isPresent()) {
+            return optional.get().intValue();
+        }
+        return DEFAULT_POOLSIZE_IFNOTSET;
     }
 
     @Override
@@ -62,7 +76,9 @@ public class NetconfStateConfig implements Configuration {
     public synchronized void defaults() {
         // Add default if not available
         configuration.setPropertyIfNotAvailable(SECTION_MARKER_NCSTATE, PROPERTY_KEY_HANDLEASYNC,
-                DEFAULT_VALUE_TRUSTALLCERTS);
+                DEFAULT_HANDLEASYNC);
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_NCSTATE, PROPERTY_KEY_POOLSIZE,
+                DEFAULT_POOLSIZE);
 
     }
 }
index 896f010..818f8a3 100644 (file)
@@ -30,7 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconfn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconfnode.state.rev191011.PushFaultNotificationInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconfnode.state.rev191011.PushFaultNotificationOutput;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
-import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
+import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
@@ -83,7 +83,7 @@ public class NetconfnodeStateServiceRpcApiImpl implements NetconfnodeStateServic
         try {
             GetStatusOutputBuilder outputBuilder = new GetStatusOutputBuilder();
             getStatusCallback.getStatus(input);
-            result = RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder.build());
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
diff --git a/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestConfig.java b/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestConfig.java
new file mode 100644 (file)
index 0000000..d66508f
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
+ * All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.test;
+
+import static org.junit.Assert.assertTrue;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.subtypes.Section;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.subtypes.Section.EnvGetter;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl.conf.NetconfStateConfig;
+
+public class TestConfig {
+
+    private static final String FILENAME="test.config";
+    @BeforeClass
+    @AfterClass
+    public static void clearFiles(){
+        try {
+            Files.deleteIfExists(new File(FILENAME).toPath());
+        } catch (IOException e) {
+
+        }
+    }
+    @Test
+    public void test() {
+
+        ConfigurationFileRepresentation cfg = new ConfigurationFileRepresentation(FILENAME);
+        NetconfStateConfig config = new NetconfStateConfig(cfg);
+
+        Section.setEnvGetter(new EnvGetter() {
+
+            @Override
+            public String getenv(String env) {
+                if("SDNR_ASYNC_HANDLING".equals(env)) {
+                    return "true";
+                }
+                return null;
+            }
+        });
+        assertTrue(config.handleAsync());
+    }
+}
index faba3be..b6d86cd 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 974e433..0657cb5 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 11e13e2..4fb0d00 100644 (file)
@@ -36,6 +36,8 @@ public class OAuthProviderConfig {
     private String title;
     private String scope;
     private String realmName;
+    private String openIdConfigUrl;
+
     private boolean trustAll;
     private OAuthProvider type;
     private Map<String, String> roleMapping;
@@ -45,7 +47,7 @@ public class OAuthProviderConfig {
     }
 
     public OAuthProviderConfig(String id, String url, String internalUrl, String clientId, String secret, String scope,
-            String title, String realmName, boolean trustAll) {
+            String title, String realmName, String openIdConfigUrl, boolean trustAll) {
         this.id = id;
         this.url = url;
         this.internalUrl = internalUrl;
@@ -55,6 +57,7 @@ public class OAuthProviderConfig {
         this.title = title;
         this.realmName = realmName;
         this.trustAll = trustAll;
+        this.openIdConfigUrl = openIdConfigUrl;
         this.roleMapping = new HashMap<>();
     }
 
@@ -70,7 +73,7 @@ public class OAuthProviderConfig {
     }
 
     public OAuthProviderConfig() {
-        this(null, null, null, null, null, null, null, null, false);
+        this(null, null, null, null, null, null, null, null, null, false);
     }
 
     public void setUrl(String url) {
@@ -153,6 +156,9 @@ public class OAuthProviderConfig {
         this.internalUrl = internalUrl;
     }
 
+    public void setOpenIdConfigUrl(String openIdConfigUrl){ this.openIdConfigUrl = openIdConfigUrl;}
+
+    public String getOpenIdConfigUrl() { return this.openIdConfigUrl;}
     @JsonIgnore
     public void handleEnvironmentVars() {
         if (Config.isEnvExpression(this.id)) {
@@ -179,6 +185,9 @@ public class OAuthProviderConfig {
         if (Config.isEnvExpression(this.realmName)) {
             this.realmName = Config.getProperty(this.realmName, null);
         }
+        if (Config.isEnvExpression(this.openIdConfigUrl)) {
+            this.openIdConfigUrl = Config.getProperty(this.openIdConfigUrl, null);
+        }
     }
 
     @JsonIgnore
@@ -186,4 +195,8 @@ public class OAuthProviderConfig {
         return this.internalUrl != null && this.internalUrl.length() > 0 ? this.internalUrl : this.url;
     }
 
+    @JsonIgnore
+    public boolean hasToBeConfigured(){
+        return this.openIdConfigUrl!=null && this.openIdConfigUrl.length()>0;
+    }
 }
diff --git a/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/data/OpenIdConfigResponseData.java b/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/data/OpenIdConfigResponseData.java
new file mode 100644 (file)
index 0000000..2af46b6
--- /dev/null
@@ -0,0 +1,54 @@
+package org.onap.ccsdk.features.sdnr.wt.oauthprovider.data;
+
+public class OpenIdConfigResponseData {
+
+    private String issuer;
+    private String authorization_endpoint;
+    private String token_endpoint;
+    private String userinfo_endpoint;
+    private String jwks_uri;
+
+    public OpenIdConfigResponseData(){
+
+    }
+
+    public String getIssuer() {
+        return issuer;
+    }
+
+    public void setIssuer(String issuer) {
+        this.issuer = issuer;
+    }
+
+    public String getAuthorization_endpoint() {
+        return authorization_endpoint;
+    }
+
+    public void setAuthorization_endpoint(String authorization_endpoint) {
+        this.authorization_endpoint = authorization_endpoint;
+    }
+
+    public String getToken_endpoint() {
+        return token_endpoint;
+    }
+
+    public void setToken_endpoint(String token_endpoint) {
+        this.token_endpoint = token_endpoint;
+    }
+
+    public String getUserinfo_endpoint() {
+        return userinfo_endpoint;
+    }
+
+    public void setUserinfo_endpoint(String userinfo_endpoint) {
+        this.userinfo_endpoint = userinfo_endpoint;
+    }
+
+    public String getJwks_uri() {
+        return jwks_uri;
+    }
+
+    public void setJwks_uri(String jwks_uri) {
+        this.jwks_uri = jwks_uri;
+    }
+}
diff --git a/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/data/UnableToConfigureOAuthService.java b/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/data/UnableToConfigureOAuthService.java
new file mode 100644 (file)
index 0000000..b791a40
--- /dev/null
@@ -0,0 +1,12 @@
+package org.onap.ccsdk.features.sdnr.wt.oauthprovider.data;
+
+public class UnableToConfigureOAuthService extends Exception {
+
+    public UnableToConfigureOAuthService(String configUrl){
+        super(String.format("Unable to configure OAuth service from url %s", configUrl));
+    }
+    public UnableToConfigureOAuthService(String configUrl, int responseCode){
+        super(String.format("Unable to configure OAuth service from url %s. bad response with code %d", configUrl, responseCode));
+    }
+
+}
diff --git a/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/filters/CustomizedMDSALDynamicAuthorizationFilter.java b/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/filters/CustomizedMDSALDynamicAuthorizationFilter.java
new file mode 100644 (file)
index 0000000..80d9d1b
--- /dev/null
@@ -0,0 +1,155 @@
+package org.onap.ccsdk.features.sdnr.wt.oauthprovider.filters;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
+import com.google.common.collect.Iterables;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.util.*;
+import java.util.concurrent.ExecutionException;
+import javax.servlet.Filter;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.web.filter.authz.AuthorizationFilter;
+import org.opendaylight.aaa.shiro.web.env.ThreadLocals;
+import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
+import org.opendaylight.mdsal.binding.api.DataTreeModification;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.aaa.rev161214.HttpAuthorization;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.aaa.rev161214.http.authorization.policies.Policies;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.aaa.rev161214.http.permission.Permissions;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
+public class CustomizedMDSALDynamicAuthorizationFilter extends AuthorizationFilter
+        implements ClusteredDataTreeChangeListener<HttpAuthorization> {
+
+    private static final Logger LOG = LoggerFactory.getLogger(CustomizedMDSALDynamicAuthorizationFilter.class);
+
+    private static final DataTreeIdentifier<HttpAuthorization> AUTHZ_CONTAINER = DataTreeIdentifier.create(
+            LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(HttpAuthorization.class));
+
+    private final DataBroker dataBroker;
+
+    private ListenerRegistration<?> reg;
+    private volatile ListenableFuture<Optional<HttpAuthorization>> authContainer;
+
+    public CustomizedMDSALDynamicAuthorizationFilter() {
+        dataBroker = requireNonNull(ThreadLocals.DATABROKER_TL.get());
+    }
+
+    @Override
+    public Filter processPathConfig(final String path, final String config) {
+        try (ReadTransaction tx = dataBroker.newReadOnlyTransaction()) {
+            authContainer = tx.read(AUTHZ_CONTAINER.getDatastoreType(), AUTHZ_CONTAINER.getRootIdentifier());
+        }
+        this.reg = dataBroker.registerDataTreeChangeListener(AUTHZ_CONTAINER, this);
+        return super.processPathConfig(path, config);
+    }
+
+    @Override
+    public void destroy() {
+        if (reg != null) {
+            reg.close();
+            reg = null;
+        }
+        super.destroy();
+    }
+
+    @Override
+    public void onDataTreeChanged(final Collection<DataTreeModification<HttpAuthorization>> changes) {
+        final HttpAuthorization newVal = Iterables.getLast(changes).getRootNode().getDataAfter();
+        LOG.debug("Updating authorization information to {}", newVal);
+        authContainer = Futures.immediateFuture(Optional.ofNullable(newVal));
+    }
+
+    @Override
+    public boolean isAccessAllowed(final ServletRequest request, final ServletResponse response,
+                                   final Object mappedValue) {
+        checkArgument(request instanceof HttpServletRequest, "Expected HttpServletRequest, received {}", request);
+
+        final Subject subject = getSubject(request, response);
+        final HttpServletRequest httpServletRequest = (HttpServletRequest)request;
+        final String requestURI = httpServletRequest.getRequestURI();
+        LOG.debug("isAccessAllowed for user={} to requestURI={}", subject, requestURI);
+
+        final Optional<HttpAuthorization> authorizationOptional;
+        try {
+            authorizationOptional = authContainer.get();
+        } catch (ExecutionException | InterruptedException e) {
+            // Something went completely wrong trying to read the authz container.  Deny access.
+            LOG.warn("MDSAL attempt to read Http Authz Container failed, disallowing access", e);
+            return false;
+        }
+
+        if (!authorizationOptional.isPresent()) {
+            // The authorization container does not exist-- hence no authz rules are present
+            // Allow access.
+            LOG.debug("Authorization Container does not exist");
+            return true;
+        }
+
+        final HttpAuthorization httpAuthorization = authorizationOptional.get();
+        final var policies = httpAuthorization.getPolicies();
+        List<Policies> policiesList = policies != null ? policies.getPolicies() : null;
+        if (policiesList == null || policiesList.isEmpty()) {
+            // The authorization container exists, but no rules are present.  Allow access.
+            LOG.debug("Exiting successfully early since no authorization rules exist");
+            return true;
+        }
+
+        // Sort the Policies list based on index
+        policiesList = new ArrayList<>(policiesList);
+        policiesList.sort(Comparator.comparing(Policies::getIndex));
+
+        for (Policies policy : policiesList) {
+            final String resource = policy.getResource();
+            final boolean pathsMatch = pathsMatch(resource, requestURI);
+            if (pathsMatch) {
+                LOG.debug("paths match for pattern={} and requestURI={}", resource, requestURI);
+                final String method = httpServletRequest.getMethod();
+                LOG.trace("method={}", method);
+                List<Permissions> permissions = policy.getPermissions();
+                if(permissions !=null) {
+                    for (Permissions permission : permissions) {
+                        final String role = permission.getRole();
+                        LOG.trace("role={}", role);
+                        Set<Permissions.Actions> actions = permission.getActions();
+                        if (actions != null) {
+                            for (Permissions.Actions action : actions) {
+                                LOG.trace("action={}", action.getName());
+                                if (action.getName().equalsIgnoreCase(method)) {
+                                    final boolean hasRole = subject.hasRole(role);
+                                    LOG.trace("hasRole({})={}", role, hasRole);
+                                    if (hasRole) {
+                                        return true;
+                                    }
+                                }
+                            }
+                        }
+                        else{
+                            LOG.trace("no actions found");
+                        }
+                    }
+                }
+                else {
+                    LOG.trace("no permissions found");
+                }
+                LOG.debug("couldn't authorize the user for access");
+                return false;
+            }
+        }
+        LOG.debug("successfully authorized the user for access");
+        return true;
+    }
+}
index 15ff9c4..7c88e50 100644 (file)
@@ -44,13 +44,7 @@ import org.apache.shiro.session.Session;
 import org.apache.shiro.subject.Subject;
 import org.jolokia.osgi.security.Authenticator;
 import org.onap.ccsdk.features.sdnr.wt.common.http.BaseHTTPClient;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.Config;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.InvalidConfigurationException;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.NoDefinitionFoundException;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthProviderConfig;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthToken;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OdlPolicy;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UserTokenPayload;
+import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.*;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers.AuthService;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers.AuthService.PublicOAuthProviderConfig;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers.MdSalAuthorizationStore;
@@ -102,7 +96,8 @@ public class AuthHttpServlet extends HttpServlet {
     private static ShiroConfiguration shiroConfiguration;
     private static MdSalAuthorizationStore mdsalAuthStore;
 
-    public AuthHttpServlet() throws IllegalArgumentException, IOException, InvalidConfigurationException {
+    public AuthHttpServlet() throws IllegalArgumentException, IOException, InvalidConfigurationException,
+            UnableToConfigureOAuthService {
         this.config = Config.getInstance();
         this.tokenCreator = TokenCreator.getInstance(this.config);
         this.mapper = new ObjectMapper();
index 835ea8c..192da63 100644 (file)
@@ -41,9 +41,8 @@ import java.util.stream.Collectors;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthProviderConfig;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthResponseData;
-import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UserTokenPayload;
+
+import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.*;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.http.AuthHttpServlet;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.http.client.MappedBaseHttpResponse;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.http.client.MappingBaseHttpClient;
@@ -60,6 +59,8 @@ public abstract class AuthService {
     protected final OAuthProviderConfig config;
     protected final TokenCreator tokenCreator;
     private final String redirectUri;
+    private final String tokenEndpoint;
+    private final String authEndpoint;
 
     protected abstract String getTokenVerifierUri();
 
@@ -78,13 +79,30 @@ public abstract class AuthService {
 
     protected abstract boolean verifyState(String state);
 
-    public AuthService(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) {
+    public AuthService(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) throws UnableToConfigureOAuthService {
         this.config = config;
         this.tokenCreator = tokenCreator;
         this.redirectUri = redirectUri;
         this.mapper = new ObjectMapper();
         this.mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
         this.httpClient = new MappingBaseHttpClient(this.config.getUrlOrInternal(), this.config.trustAll());
+        if (this.config.hasToBeConfigured()){
+            Optional<MappedBaseHttpResponse<OpenIdConfigResponseData>> oresponse = this.httpClient.sendMappedRequest(
+                    this.config.getOpenIdConfigUrl(), "GET", null, null, OpenIdConfigResponseData.class);
+            if(oresponse.isEmpty()){
+                throw new UnableToConfigureOAuthService(this.config.getOpenIdConfigUrl());
+            }
+            MappedBaseHttpResponse<OpenIdConfigResponseData> response = oresponse.get();
+            if(!response.isSuccess()){
+                throw new UnableToConfigureOAuthService(this.config.getOpenIdConfigUrl(), response.code);
+            }
+            this.tokenEndpoint = response.body.getToken_endpoint();
+            this.authEndpoint = response.body.getAuthorization_endpoint();
+        }
+        else{
+            this.tokenEndpoint = null;
+            this.authEndpoint = null;
+        }
     }
 
     public PublicOAuthProviderConfig getConfig() {
@@ -110,7 +128,11 @@ public abstract class AuthService {
 
     public void sendLoginRedirectResponse(HttpServletResponse resp, String callbackUrl) {
         resp.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
-        resp.setHeader("Location", this.getLoginUrl(callbackUrl));
+        String url = this.authEndpoint!=null?String.format(
+                "%s?client_id=%s&response_type=code&scope=%s&redirect_uri=%s",
+                this.authEndpoint, urlEncode(this.config.getClientId()), this.config.getScope(),
+                urlEncode(callbackUrl)):this.getLoginUrl(callbackUrl);
+        resp.setHeader("Location", url);
     }
 
     private static void sendErrorResponse(HttpServletResponse resp, String message) throws IOException {
@@ -204,8 +226,9 @@ public abstract class AuthService {
             body.append(String.format("%s=%s&", p.getKey(), urlEncode(p.getValue())));
         }
 
+        String url = this.tokenEndpoint!=null?this.tokenEndpoint:this.getTokenVerifierUri();
         Optional<MappedBaseHttpResponse<OAuthResponseData>> response =
-                this.httpClient.sendMappedRequest(this.getTokenVerifierUri(), "POST",
+                this.httpClient.sendMappedRequest(url, "POST",
                         body.substring(0, body.length() - 1), headers, OAuthResponseData.class);
         if (response.isPresent() && response.get().isSuccess()) {
             return response.get().body;
index 1111603..10f701e 100644 (file)
@@ -30,6 +30,7 @@ import java.util.Map;
 import java.util.Optional;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.Config;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthProviderConfig;
+import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UnableToConfigureOAuthService;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UserTokenPayload;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.http.client.MappedBaseHttpResponse;
 import org.slf4j.Logger;
@@ -43,7 +44,7 @@ public class GitlabProviderService extends AuthService {
     private static final String API_USER_URI = "/api/v4/user";
     private static final String API_GROUP_URI = "/api/v4/groups?min_access_level=10";
 
-    public GitlabProviderService(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) {
+    public GitlabProviderService(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) throws UnableToConfigureOAuthService {
         super(config, redirectUri, tokenCreator);
         this.additionalTokenVerifierParams = new HashMap<>();
         this.additionalTokenVerifierParams.put("grant_type", "authorization_code");
index dbc5776..0500019 100644 (file)
@@ -29,6 +29,7 @@ import java.util.Map;
 import java.util.stream.Collectors;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.KeycloakUserTokenPayload;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthProviderConfig;
+import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UnableToConfigureOAuthService;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UserTokenPayload;
 
 public class KeycloakProviderService extends AuthService {
@@ -36,7 +37,7 @@ public class KeycloakProviderService extends AuthService {
     public static final String ID = "keycloak";
     private Map<String, String> additionalTokenVerifierParams;
 
-    public KeycloakProviderService(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) {
+    public KeycloakProviderService(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) throws UnableToConfigureOAuthService {
         super(config, redirectUri, tokenCreator);
         this.additionalTokenVerifierParams = new HashMap<>();
         this.additionalTokenVerifierParams.put("grant_type", "authorization_code");
index ca7f471..4bf35e7 100644 (file)
@@ -23,6 +23,7 @@ package org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers;
 
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OdlPolicy;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OdlPolicy.PolicyMethods;
@@ -85,7 +86,7 @@ public class MdSalAuthorizationStore {
         return Optional.of(mapPolicy(path, rolePm.get().getActions()));
     }
 
-    private OdlPolicy mapPolicy(String path, List<Actions> actions) {
+    private OdlPolicy mapPolicy(String path, Set<Actions> actions) {
         PolicyMethods methods = new PolicyMethods();
         String action;
         for (Actions a : actions) {
index b6f045c..336de56 100644 (file)
@@ -25,11 +25,12 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonMappingException;
 import java.util.Map;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthProviderConfig;
+import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UnableToConfigureOAuthService;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UserTokenPayload;
 
 public class NextcloudProviderService extends AuthService {
 
-    public NextcloudProviderService(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) {
+    public NextcloudProviderService(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) throws UnableToConfigureOAuthService {
         super(config, redirectUri, tokenCreator);
         // TODO Auto-generated constructor stub
     }
index 193e7a7..1525699 100644 (file)
 package org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers;
 
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthProviderConfig;
+import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UnableToConfigureOAuthService;
 
 public class OAuthProviderFactory {
 
 
     public static AuthService create(OAuthProvider key, OAuthProviderConfig config, String redirectUri,
-            TokenCreator tokenCreator) {
+            TokenCreator tokenCreator) throws UnableToConfigureOAuthService {
         switch (key) {
             case KEYCLOAK:
                 return new KeycloakProviderService(config, redirectUri, tokenCreator);
index dda3ba1..6c2390e 100644 (file)
@@ -43,6 +43,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.Config;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthProviderConfig;
+import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UnableToConfigureOAuthService;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers.GitlabProviderService;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers.TokenCreator;
 
@@ -62,7 +63,7 @@ public class TestGitlabAuthService {
 
         TokenCreator tokenCreator = TokenCreator.getInstance(Config.TOKENALG_HS256, TOKENCREATOR_SECRET, "issuer", 30*60);
         OAuthProviderConfig config = new OAuthProviderConfig("git", GITURL, null, "odlux.app", OAUTH_SECRET, "openid",
-                "gitlab test", "", false);
+                "gitlab test", "", null, false);
         oauthService = new GitlabProviderServiceToTest(config, REDIRECT_URI, tokenCreator);
         try {
             initGitlabTestWebserver(PORT, "/");
@@ -102,7 +103,7 @@ public class TestGitlabAuthService {
 
     public static class GitlabProviderServiceToTest extends GitlabProviderService {
 
-        public GitlabProviderServiceToTest(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) {
+        public GitlabProviderServiceToTest(OAuthProviderConfig config, String redirectUri, TokenCreator tokenCreator) throws UnableToConfigureOAuthService {
             super(config, redirectUri, tokenCreator);
         }
 
index e4c5e4d..e5ec2fb 100644 (file)
@@ -43,6 +43,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.Config;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.OAuthProviderConfig;
+import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.UnableToConfigureOAuthService;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers.KeycloakProviderService;
 import org.onap.ccsdk.features.sdnr.wt.oauthprovider.providers.TokenCreator;
 
@@ -62,7 +63,7 @@ public class TestKeycloakAuthService {
 
         TokenCreator tokenCreator = TokenCreator.getInstance(Config.TOKENALG_HS256, TOKENCREATOR_SECRET, "issuer", 30*60);
         OAuthProviderConfig config = new OAuthProviderConfig("kc", KEYCLOAKURL, null, "odlux.app", OAUTH_SECRET,
-                "openid", "keycloak test", "onap", false);
+                "openid", "keycloak test", "onap",null, false);
         oauthService = new KeycloakProviderServiceToTest(config, REDIRECT_URI, tokenCreator);
         try {
             initKeycloakTestWebserver(PORT, "/");
@@ -102,7 +103,7 @@ public class TestKeycloakAuthService {
     public static class KeycloakProviderServiceToTest extends KeycloakProviderService {
 
         public KeycloakProviderServiceToTest(OAuthProviderConfig config, String redirectUri,
-                TokenCreator tokenCreator) {
+                TokenCreator tokenCreator) throws UnableToConfigureOAuthService {
             super(config, redirectUri, tokenCreator);
         }
     }
index 87805b0..2db8e6e 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
                             org.apache.shiro.authz,
                             org.apache.shiro.realm,
                             org.apache.shiro.subject,
+                            org.apache.shiro.web.filter.authz,
                             org.jolokia.osgi.security,
                             org.onap.ccsdk.features.sdnr.wt.common.http,
                             org.opendaylight.aaa.api,
                             com.fasterxml.jackson.annotation,
                             com.fasterxml.jackson.core.type,
                             com.fasterxml.jackson.core,
-                            org.apache.commons.codec.binary
+                            org.apache.commons.codec.binary,
+                            com.google.common.collect,
+                            com.google.common.util.concurrent
                         </Import-Package>
                         <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                         <Embed-Dependency>*;scope=compile|runtime;artifactId=!shiro-core;inline=false</Embed-Dependency>
index 65a590f..e27ae0c 100644 (file)
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -39,7 +39,6 @@
     <modules>
         <module>common</module>
         <module>common-yang</module>
-        <module>featureaggregator</module>
         <module>data-provider</module>
         <module>apigateway</module>
         <module>helpserver</module>
@@ -52,5 +51,6 @@
         <module>netconfnode-state-service</module>
         <module>mountpoint-state-provider</module>
         <module>oauth-provider</module>
+        <module>featureaggregator</module>
     </modules>
 </project>
index 6643042..c3625a5 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
     <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
     <artifactId>sdnr-wt-readthedocs-installer</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>ccsdk-features :: ${project.artifactId}</name>
index 65686b1..7e5386d 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index a2aa1f2..cc09155 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index e640bc5..c02d846 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -62,6 +63,7 @@
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-annotations</artifactId>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 </project>
index 56a63a4..be59c09 100755 (executable)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
index 7c34ca1..83005e3 100644 (file)
   ~ ============LICENSE_END=======================================================
   ~
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.4.0</version>
+        <version>2.4.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
             <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-yang-utils</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.eclipse.jetty.websocket</groupId>
             <artifactId>websocket-servlet</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>com.typesafe</groupId>
@@ -84,6 +88,7 @@
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-binding-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>