From 0578156b721fa01c8c645b8f9625ecebdb6449e4 Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Wed, 27 Jul 2016 11:05:51 +0200 Subject: HONEYCOMB-130: Separate v3po plugin from HC infra Creating folders: - common/ - infra/ - v3po/ - vpp-common/ Change-Id: I2c39e1b17e39e7c0f0628f44aa5fe08563fa06e4 Signed-off-by: Maros Marsalek --- infra/impl/pom.xml | 130 ++++++ .../src/main/config/context-datatree-config.xml | 144 ++++++ infra/impl/src/main/config/default-config.xml | 253 +++++++++++ infra/impl/src/main/config/initializer-config.xml | 188 ++++++++ .../impl/src/main/config/netconf-north-config.xml | 496 +++++++++++++++++++++ .../impl/src/main/config/restconf-north-config.xml | 37 ++ .../impl/NorthboundFacadeHoneycombDOMBroker.java | 206 +++++++++ .../impl/rev141210/ContextDataBrokerModule.java | 26 ++ .../rev141210/ContextDataBrokerModuleFactory.java | 13 + .../yang/v3po/impl/rev141210/DataBrokerModule.java | 34 ++ .../impl/rev141210/DataBrokerModuleFactory.java | 13 + .../impl/rev141210/NetconfBindingBrokerModule.java | 117 +++++ .../NetconfBindingBrokerModuleFactory.java | 13 + .../rev141210/NetconfMonitoringReaderModule.java | 46 ++ .../NetconfMonitoringReaderModuleFactory.java | 13 + .../ns/yang/v3po/impl/rev141210/V3poModule.java | 60 +++ .../v3po/impl/rev141210/V3poModuleFactory.java | 28 ++ infra/impl/src/main/yang/v3po-impl.yang | 155 +++++++ .../v3po/impl/rev141210/V3poModuleFactoryTest.java | 26 ++ .../yang/v3po/impl/rev141210/V3poModuleTest.java | 70 +++ 20 files changed, 2068 insertions(+) create mode 100644 infra/impl/pom.xml create mode 100644 infra/impl/src/main/config/context-datatree-config.xml create mode 100644 infra/impl/src/main/config/default-config.xml create mode 100644 infra/impl/src/main/config/initializer-config.xml create mode 100644 infra/impl/src/main/config/netconf-north-config.xml create mode 100644 infra/impl/src/main/config/restconf-north-config.xml create mode 100644 infra/impl/src/main/java/io/fd/honeycomb/v3po/impl/NorthboundFacadeHoneycombDOMBroker.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModuleFactory.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModuleFactory.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModuleFactory.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactory.java create mode 100644 infra/impl/src/main/yang/v3po-impl.yang create mode 100644 infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactoryTest.java create mode 100644 infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java (limited to 'infra/impl') diff --git a/infra/impl/pom.xml b/infra/impl/pom.xml new file mode 100644 index 000000000..4a316ceaf --- /dev/null +++ b/infra/impl/pom.xml @@ -0,0 +1,130 @@ + + + + + + + io.fd.honeycomb.common + impl-parent + 1.0.0-SNAPSHOT + ../../common/impl-parent + + + 4.0.0 + io.fd.honeycomb + honeycomb-impl + 1.0.0-SNAPSHOT + bundle + + + ${project.groupId} + notification-api + ${project.version} + + + ${project.groupId} + translate-impl + ${project.version} + + + ${project.groupId} + data-impl + ${project.version} + + + ${project.groupId} + cfg-init + ${project.version} + + + + org.opendaylight.netconf + ietf-netconf-monitoring + 1.0.2-Beryllium-SR2 + + + org.opendaylight.netconf + ietf-netconf-monitoring-extension + 1.0.2-Beryllium-SR2 + + + + org.opendaylight.mdsal.model + ietf-topology + + + + + junit + junit + test + + + + org.mockito + mockito-all + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${config.file} + xml + config + + + src/main/config/netconf-north-config.xml + xml + netconf + + + src/main/config/initializer-config.xml + xml + init + + + src/main/config/context-datatree-config.xml + xml + context + + + src/main/config/restconf-north-config.xml + xml + restconf + + + + + + + + + diff --git a/infra/impl/src/main/config/context-datatree-config.xml b/infra/impl/src/main/config/context-datatree-config.xml new file mode 100644 index 000000000..313f0ebe6 --- /dev/null +++ b/infra/impl/src/main/config/context-datatree-config.xml @@ -0,0 +1,144 @@ + + + + + + + + urn:opendaylight:params:xml:ns:yang:v3po:impl?module=v3po-impl&revision=2014-12-10 + urn:honeycomb:params:xml:ns:yang:translate:utils?module=translate-utils&revision=2016-04-06 + urn:honeycomb:params:xml:ns:yang:vpp:data:init?module=vpp-cfg-init&revision=2016-04-07 + urn:honeycomb:params:xml:ns:yang:data:api?module=data-api&revision=2016-04-11 + urn:honeycomb:params:xml:ns:yang:data:impl?module=data-impl&revision=2016-04-11 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28 + + + + + + + + + + prefix:inmemory-data-tree + inmemory-context-data-tree + + dom:schema-service + yang-schema-service + + oper + + + + + prefix:persisting-data-tree-adapter + inmemory-persisted-context-data-tree + + prefix:data-tree + inmemory-context-data-tree + + + dom:schema-service + yang-schema-service + + etc/opendaylight/honeycomb/context.json + + + + + prefix:honeycomb-context-dom-data-broker + honeycomb-context-data-broker + + + prefix:data-tree + inmemory-persisted-context-data-tree + + + + + + prefix:binding-forwarded-data-broker + honeycomb-context-binding-data-broker + + + dom:dom-async-data-broker + honeycomb-context-data-broker + + + dom:schema-service + yang-schema-service + + + binding:binding-dom-mapping-service + runtime-mapping-singleton + + + + + + + prefix:realtime-mapping-context + realtime-mapping-context + + binding:binding-async-data-broker + honeycomb-context-binding-data-broker + + + + + + + prefix:data-tree + + inmemory-context-data-tree + /modules/module[type='inmemory-data-tree'][name='inmemory-context-data-tree'] + + + + inmemory-persisted-context-data-tree + /modules/module[type='persisting-data-tree-adapter'][name='inmemory-persisted-context-data-tree'] + + + + + + dom:dom-async-data-broker + + honeycomb-context-data-broker + /modules/module[type='honeycomb-context-dom-data-broker'][name='honeycomb-context-data-broker'] + + + + + binding:binding-async-data-broker + + honeycomb-context-binding-data-broker + /modules/module[type='binding-forwarded-data-broker'][name='honeycomb-context-binding-data-broker'] + + + + + prefix:honeycomb-mapping-context + + realtime-mapping-context + /modules/module[type='realtime-mapping-context'][name='realtime-mapping-context'] + + + + + + diff --git a/infra/impl/src/main/config/default-config.xml b/infra/impl/src/main/config/default-config.xml new file mode 100644 index 000000000..c817a5db3 --- /dev/null +++ b/infra/impl/src/main/config/default-config.xml @@ -0,0 +1,253 @@ + + + + + + urn:opendaylight:params:xml:ns:yang:v3po:impl?module=v3po-impl&revision=2014-12-10 + urn:honeycomb:params:xml:ns:yang:translate:utils?module=translate-utils&revision=2016-04-06 + urn:honeycomb:params:xml:ns:yang:data:api?module=data-api&revision=2016-04-11 + urn:honeycomb:params:xml:ns:yang:data:impl?module=data-impl&revision=2016-04-11 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28 + + + + + + + + prefix:delegating-reader-registry + read-registry + + + prefix:delegating-writer-registry + write-registry + + + + + prefix:inmemory-data-tree + inmemory-config-data-tree + + dom:schema-service + yang-schema-service + + config + + + + + prefix:persisting-data-tree-adapter + inmemory-persisted-config-data-tree + + prefix:data-tree + inmemory-config-data-tree + + + dom:schema-service + yang-schema-service + + etc/opendaylight/honeycomb/config.json + + + + + + prefix:honeycomb-config-data-tree + config-data-tree + + + + + + + + prefix:data-tree + inmemory-persisted-config-data-tree + + + + prefix:binding-dom-mapping-service + runtime-mapping-singleton + + + prefix:honeycomb-writer-registry-builder + write-registry-builder + + + binding:binding-async-data-broker + honeycomb-context-binding-data-broker + + + + + + prefix:honeycomb-operational-data-tree + operational-data-tree + + dom:schema-service + yang-schema-service + + + prefix:binding-dom-mapping-service + runtime-mapping-singleton + + + prefix:honeycomb-reader-registry + read-registry + + + binding:binding-async-data-broker + honeycomb-context-binding-data-broker + + + + + + prefix:honeycomb-dom-data-broker + honeycomb-dom-data-broker + + prefix:honeycomb-modifiable-data-tree + config-data-tree + + + prefix:honeycomb-readable-data-tree + operational-data-tree + + + + + + prefix:binding-forwarded-data-broker + honeycomb-binding-data-broker + + + + dom:dom-async-data-broker + honeycomb-dom-data-broker + + + dom:schema-service + yang-schema-service + + + binding:binding-dom-mapping-service + runtime-mapping-singleton + + + + + + prefix:v3po + v3po-default + + prefix:dom-broker-osgi-registry + dom-broker + + + prefix:dom-async-data-broker + honeycomb-dom-data-broker + + + prefix:dom-notification-service + honeycomb-dom-notification-service + + + + + + + + dom:dom-async-data-broker + + honeycomb-dom-data-broker + /modules/module[type='honeycomb-dom-data-broker'][name='honeycomb-dom-data-broker'] + + + + + binding:binding-async-data-broker + + honeycomb-binding-data-broker + /modules/module[type='binding-forwarded-data-broker'][name='honeycomb-binding-data-broker'] + + + + + prefix:honeycomb-reader-registry + + read-registry + /modules/module[type='delegating-reader-registry'][name='read-registry'] + + + + prefix:honeycomb-writer-registry + + write-registry + /modules/module[type='delegating-writer-registry'][name='write-registry'] + + + + prefix:honeycomb-writer-registry-builder + + write-registry-builder + /modules/module[type='delegating-writer-registry'][name='write-registry'] + + + + + prefix:data-tree + + inmemory-config-data-tree + /modules/module[type='inmemory-data-tree'][name='inmemory-config-data-tree'] + + + + inmemory-persisted-config-data-tree + /modules/module[type='persisting-data-tree-adapter'][name='inmemory-persisted-config-data-tree'] + + + + + + prefix:honeycomb-modifiable-data-tree + + config-data-tree + /modules/module[type='honeycomb-config-data-tree'][name='config-data-tree'] + + + + + prefix:honeycomb-readable-data-tree + + operational-data-tree + /modules/module[type='honeycomb-operational-data-tree'][name='operational-data-tree'] + + + + + + dom:dom-broker-osgi-registry + + + vpp-dom-broker + /modules/module[type='v3po'][name='v3po-default'] + + + + + + + diff --git a/infra/impl/src/main/config/initializer-config.xml b/infra/impl/src/main/config/initializer-config.xml new file mode 100644 index 000000000..f46069340 --- /dev/null +++ b/infra/impl/src/main/config/initializer-config.xml @@ -0,0 +1,188 @@ + + + + + + + + urn:opendaylight:params:xml:ns:yang:v3po:impl?module=v3po-impl&revision=2014-12-10 + urn:honeycomb:params:xml:ns:yang:translate:utils?module=translate-utils&revision=2016-04-06 + urn:honeycomb:params:xml:ns:yang:vpp:data:init?module=vpp-cfg-init&revision=2016-04-07 + urn:honeycomb:params:xml:ns:yang:data:api?module=data-api&revision=2016-04-11 + urn:honeycomb:params:xml:ns:yang:data:impl?module=data-impl&revision=2016-04-11 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28 + + + + + + + + + prefix:noop-writer-registry-builder + noop-writer-registry-builder + + + + prefix:honeycomb-config-data-tree + cfg-init-config-data-tree + + + prefix:data-tree + inmemory-config-data-tree + + + prefix:binding-dom-mapping-service + runtime-mapping-singleton + + + prefix:honeycomb-writer-registry-builder + noop-writer-registry-builder + + + binding:binding-async-data-broker + honeycomb-context-binding-data-broker + + + + + prefix:honeycomb-dom-data-broker + cfg-init-dom-data-broker + + prefix:honeycomb-modifiable-data-tree + cfg-init-config-data-tree + + + prefix:honeycomb-readable-data-tree + operational-data-tree + + + + + prefix:binding-forwarded-data-broker + cfg-init-binding-data-broker + + + dom:dom-async-data-broker + cfg-init-dom-data-broker + + + dom:schema-service + yang-schema-service + + + binding:binding-dom-mapping-service + runtime-mapping-singleton + + + + + + prefix:persisted-file-initializer + persisted-context-initializer + + dom:dom-async-data-broker + honeycomb-context-data-broker + + + dom:schema-service + yang-schema-service + + etc/opendaylight/honeycomb/context.json + merge + oper + + + prefix:persisted-file-initializer + persisted-config-initializer + + prefix:dom-async-data-broker + honeycomb-dom-data-broker + + + dom:schema-service + yang-schema-service + + etc/opendaylight/honeycomb/config.json + merge + config + + + + prefix:cfg-initializer-registry + initializer-registry + + prefix:cfg-initializer + persisted-context-initializer + + + prefix:cfg-initializer + persisted-config-initializer + + + + + + + + + prefix:honeycomb-writer-registry-builder + + noop-writer-registry-builder + /modules/module[type='noop-writer-registry-builder'][name='noop-writer-registry-builder'] + + + + prefix:honeycomb-modifiable-data-tree + + cfg-init-config-data-tree + /modules/module[type='honeycomb-config-data-tree'][name='cfg-init-config-data-tree'] + + + + + dom:dom-async-data-broker + + cfg-init-dom-data-broker + /modules/module[type='honeycomb-dom-data-broker'][name='cfg-init-dom-data-broker'] + + + + binding:binding-async-data-broker + + cfg-init-binding-data-broker + /modules/module[type='binding-forwarded-data-broker'][name='cfg-init-binding-data-broker'] + + + + + prefix:cfg-initializer + + persisted-context-initializer + /modules/module[type='persisted-file-initializer'][name='persisted-context-initializer'] + + + + persisted-config-initializer + /modules/module[type='persisted-file-initializer'][name='persisted-config-initializer'] + + + + + + + diff --git a/infra/impl/src/main/config/netconf-north-config.xml b/infra/impl/src/main/config/netconf-north-config.xml new file mode 100644 index 000000000..35bd5ff04 --- /dev/null +++ b/infra/impl/src/main/config/netconf-north-config.xml @@ -0,0 +1,496 @@ + + + + + + + + + + + + + prefix:inmemory-config-datastore-provider + netconf-config-store-service + + + dom:schema-service + yang-schema-service + + + + + prefix:inmemory-operational-datastore-provider + netconf-operational-store-service + + + dom:schema-service + yang-schema-service + + + + + prefix:dom-inmemory-data-broker + netconf-inmemory-data-broker + + + dom:schema-service + yang-schema-service + + + + config-dom-store-spi:config-dom-datastore + netconf-config-store-service + + + + operational-dom-store-spi:operational-dom-datastore + netconf-operational-store-service + + + + + prefix:binding-forwarded-data-broker + netconf-binding-data-broker + + + dom:dom-async-data-broker + netconf-inmemory-data-broker + + + dom:schema-service + yang-schema-service + + + binding:binding-dom-mapping-service + runtime-mapping-singleton + + + + + + prefix:binding-broker-netconf + binding-broker-netconf + + binding:binding-async-data-broker + netconf-binding-data-broker + + + + + + + prefix:netconf-mdsal-mapper + + netconf-vpp-mapper + + dom:schema-service + + yang-schema-service + + + + dom:yang-text-source-provider + + yang-text-source-provider + + + + dom:dom-broker-osgi-registry + + vpp-dom-broker + + + + prefix:netconf-mapper-registry + + vpp-mapper-aggregator-registry + + + + + + prefix:netconf-server-dispatcher-impl + + netconf-vpp-server-dispatcher + + + dom:netconf-northbound-mapper + + vpp-mapper-aggregator + + + + prefix:netconf-server-monitoring + + vpp-server-monitor + + + + prefix:netty-threadgroup + + global-boss-group + + + + prefix:netty-threadgroup + + global-worker-group + + + prefix:netty-timer + + global-timer + + + + + + prefix:netconf-mdsal-monitoring-mapper + + netconf-vpp-monitoring-mapper + + + prefix:netconf-server-monitoring + + vpp-server-monitor + + + + prefix:binding-broker-osgi-registry + + binding-broker-netconf + + + + prefix:netconf-mapper-registry + + vpp-mapper-aggregator-registry + + + + + + prefix:netconf-mapper-aggregator + + vpp-mapper-aggregator + + + + + prefix:netconf-server-monitoring-impl + + vpp-server-monitor + + + dom:netconf-northbound-mapper + + vpp-mapper-aggregator + + + + + + prefix:netconf-northbound-ssh + netconf-mdsal-ssh-server + 2831 + + + + + prefix:netconf-northbound-ssh + + netconf-vpp-ssh-server + + 2830 + + + prefix:netty-event-executor + + global-event-executor + + + + prefix:netty-threadgroup + + global-worker-group + + + + prefix:threadpool + + global-netconf-ssh-scheduled-executor + + + + prefix:netconf-server-dispatcher + + netconf-vpp-server-dispatcher + + + + prefix:netconf-auth-provider + + default-auth-provider + + + + + + prefix:netconf-notification-manager + + vpp-netconf-notification-manager + + + + + prefix:netconf-mdsal-notification-mapper + + netconf-vpp-notification-mapper + + + + binding:binding-async-data-broker + + netconf-binding-data-broker + + + + + prefix:binding-broker-osgi-registry + + binding-broker-netconf + + + + prefix:netconf-mapper-registry + + vpp-mapper-aggregator-registry + + + + prefix:netconf-notification-registry + + vpp-netconf-notification-manager + + + + prefix:netconf-notification-collector + + vpp-netconf-notification-manager + + + + + + + + prefix:netconf-northbound-tcp + + netconf-vpp-tcp-server + + + prefix:netconf-server-dispatcher + + netconf-vpp-server-dispatcher + + 7777 + + + + + prefix:netconf-monitoring-reader + netconf-monitoring-reader + + binding:binding-async-data-broker + netconf-binding-data-broker + + + + prefix:delegating-reader-registry + read-registry + + prefix:honeycomb-reader-factory + netconf-monitoring-reader + + + + + + + + + config-dom-store-spi:config-dom-datastore + + netconf-config-store-service + /modules/module[type='inmemory-config-datastore-provider'][name='netconf-config-store-service'] + + + + operational-dom-store-spi:operational-dom-datastore + + netconf-operational-store-service + /modules/module[type='inmemory-operational-datastore-provider'][name='netconf-operational-store-service'] + + + + dom:dom-async-data-broker + + netconf-inmemory-data-broker + /modules/module[type='dom-inmemory-data-broker'][name='netconf-inmemory-data-broker'] + + + + + prefix:honeycomb-reader-factory + + netconf-monitoring-reader + /modules/module[type='netconf-monitoring-reader'][name='netconf-monitoring-reader'] + + + + + + + binding:binding-async-data-broker + + netconf-binding-data-broker + /modules/module[type='binding-forwarded-data-broker'][name='netconf-binding-data-broker'] + + + + binding:binding-broker-osgi-registry + + binding-broker-netconf + /modules/module[type='binding-broker-netconf'][name='binding-broker-netconf'] + + + + + + + prefix:netconf-server-monitoring + + + vpp-server-monitor + /modules/module[type='netconf-server-monitoring-impl'][name='vpp-server-monitor'] + + + + + + prefix:netconf-northbound-mapper + + + netconf-vpp-mapper + /modules/module[type='netconf-mdsal-mapper'][name='netconf-vpp-mapper'] + + + + + prefix:netconf-northbound-mapper + + + vpp-mapper-aggregator + /modules/module[type='netconf-mapper-aggregator'][name='vpp-mapper-aggregator'] + + + + + prefix:netconf-mapper-registry + + + vpp-mapper-aggregator-registry + /modules/module[type='netconf-mapper-aggregator'][name='vpp-mapper-aggregator'] + + + + + prefix:netconf-server-dispatcher + + + netconf-vpp-server-dispatcher + + /modules/module[type='netconf-server-dispatcher-impl'][name='netconf-vpp-server-dispatcher'] + + + + + + prefix:netconf-northbound-mapper + + + netconf-vpp-notification-mapper + + /modules/module[type='netconf-mdsal-notification-mapper'][name='netconf-vpp-notification-mapper'] + + + + + + prefix:netconf-notification-collector + + + vpp-netconf-notification-manager + + /modules/module[type='netconf-notification-manager'][name='vpp-netconf-notification-manager'] + + + + + + prefix:netconf-notification-registry + + + vpp-netconf-notification-manager + + /modules/module[type='netconf-notification-manager'][name='vpp-netconf-notification-manager'] + + + + + + + + + urn:opendaylight:params:xml:ns:yang:v3po:impl?module=v3po-impl&revision=2014-12-10 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28 + urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:mapper?module=netconf-mdsal-mapper&revision=2015-01-14 + + urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:monitoring?module=netconf-mdsal-monitoring&revision=2015-02-18 + + urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:ssh?module=netconf-northbound-ssh&revision=2015-01-14 + urn:opendaylight:params:xml:ns:yang:controller:netconf:northbound:tcp?module=netconf-northbound-tcp&revision=2015-04-23 + + urn:opendaylight:params:xml:ns:yang:controller:config:netconf:northbound:impl?module=netconf-northbound-impl&revision=2015-01-12 + + + urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:scheduled?module=threadpool-impl-scheduled&revision=2013-12-01 + + + urn:opendaylight:params:xml:ns:yang:controller:netconf:mdsal:notification?module=netconf-mdsal-notification&revision=2015-08-03 + + + diff --git a/infra/impl/src/main/config/restconf-north-config.xml b/infra/impl/src/main/config/restconf-north-config.xml new file mode 100644 index 000000000..ff2cdac18 --- /dev/null +++ b/infra/impl/src/main/config/restconf-north-config.xml @@ -0,0 +1,37 @@ + + + + + + + + rest:rest-connector-impl + rest-connector-default-impl + + + dom:dom-broker-osgi-registry + vpp-dom-broker + + + + + + + urn:opendaylight:params:xml:ns:yang:controller:sal:restconf:service?module=sal-restconf-service&revision=2015-07-08 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:rest:connector?module=opendaylight-rest-connector&revision=2014-07-24 + + diff --git a/infra/impl/src/main/java/io/fd/honeycomb/v3po/impl/NorthboundFacadeHoneycombDOMBroker.java b/infra/impl/src/main/java/io/fd/honeycomb/v3po/impl/NorthboundFacadeHoneycombDOMBroker.java new file mode 100644 index 000000000..c2d70c38c --- /dev/null +++ b/infra/impl/src/main/java/io/fd/honeycomb/v3po/impl/NorthboundFacadeHoneycombDOMBroker.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2015 Cisco and/or its affiliates. + * + * 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. + */ + +package io.fd.honeycomb.v3po.impl; + +import com.google.common.base.Optional; +import com.google.common.collect.Maps; +import com.google.common.util.concurrent.CheckedFuture; +import com.google.common.util.concurrent.Futures; +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.annotation.concurrent.NotThreadSafe; +import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; +import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint; +import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService; +import org.opendaylight.controller.md.sal.dom.api.DOMNotificationPublishService; +import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService; +import org.opendaylight.controller.md.sal.dom.api.DOMRpcAvailabilityListener; +import org.opendaylight.controller.md.sal.dom.api.DOMRpcException; +import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationNotAvailableException; +import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult; +import org.opendaylight.controller.md.sal.dom.api.DOMRpcService; +import org.opendaylight.controller.sal.core.api.Broker; +import org.opendaylight.controller.sal.core.api.BrokerService; +import org.opendaylight.controller.sal.core.api.Consumer; +import org.opendaylight.controller.sal.core.api.Provider; +import org.opendaylight.controller.sal.core.api.model.SchemaService; +import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener; +import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.model.api.SchemaPath; +import org.osgi.framework.BundleContext; + +/** + * Implementation of dom broker to facade VPP pipeline for northbound APIs + */ +public class NorthboundFacadeHoneycombDOMBroker implements AutoCloseable, Broker { + + private static final BrokerService EMPTY_DOM_RPC_SERVICE = new EmptyDomRpcService(); + private static final BrokerService EMPTY_DOM_MOUNT_SERVICE = new EmptyDomMountService(); + + private Map, BrokerService> services; + + public NorthboundFacadeHoneycombDOMBroker(@Nonnull final DOMDataBroker domDataBrokerDependency, + @Nonnull final SchemaService schemaBiService, + @Nonnull final DOMNotificationService domNotificatioNService) { + services = Maps.newHashMap(); + services.put(DOMDataBroker.class, domDataBrokerDependency); + // All services below are required to be present by Restconf northbound + services.put(SchemaService.class, schemaBiService); + services.put(DOMRpcService.class, EMPTY_DOM_RPC_SERVICE); + services.put(DOMMountPointService.class, EMPTY_DOM_MOUNT_SERVICE); + services.put(DOMNotificationService.class, domNotificatioNService); + // TODO do both notification service types have to be registered ? + services.put(DOMNotificationPublishService.class, domNotificatioNService); + } + + @Override + public void close() throws Exception { + // NOOP + } + + @Override + public ConsumerSession registerConsumer(final Consumer consumer) { + final SimpleConsumerSession session = new SimpleConsumerSession(services); + consumer.onSessionInitiated(session); + return session; + } + + @Deprecated + @Override + public ConsumerSession registerConsumer(final Consumer consumer, final BundleContext bundleContext) { + throw new UnsupportedOperationException(); + } + + @Override + public ProviderSession registerProvider(final Provider provider) { + final SimpleProviderSession session = new SimpleProviderSession(services); + provider.onSessionInitiated(session); + return session; + } + + @Override + public ProviderSession registerProvider(final Provider provider, final BundleContext bundleContext) { + throw new UnsupportedOperationException(); + } + + @NotThreadSafe + private static class SimpleConsumerSession implements ConsumerSession { + private boolean closed; + private final Map, BrokerService> services; + + private SimpleConsumerSession(final Map, BrokerService> services) { + this.services = services; + } + + @Override + public boolean isClosed() { + return closed; + } + + @Override + public T getService(final Class aClass) { + return (T)services.get(aClass); + } + + @Override + public void close() { + closed = true; + } + } + + @NotThreadSafe + private static class SimpleProviderSession implements ProviderSession { + private boolean closed; + private final Map, BrokerService> services; + + private SimpleProviderSession(final Map, BrokerService> services) { + this.services = services; + } + + @Override + public boolean isClosed() { + return closed; + } + + @Override + public T getService(final Class aClass) { + return (T)services.get(aClass); + } + + @Override + public void close() { + closed = true; + } + } + + private static class EmptyDomRpcService implements DOMRpcService { + @Nonnull + @Override + public CheckedFuture invokeRpc(@Nonnull final SchemaPath schemaPath, + @Nullable final NormalizedNode normalizedNode) { + return Futures.immediateFailedCheckedFuture( + new DOMRpcImplementationNotAvailableException("RPCs not supported")); + } + + @Nonnull + @Override + public ListenerRegistration registerRpcListener(@Nonnull final T t) { + return new ListenerRegistration() { + @Override + public void close() { + // Noop + } + + @Override + public T getInstance() { + return t; + } + }; + } + } + + private static class EmptyDomMountService implements DOMMountPointService { + @Override + public Optional getMountPoint(final YangInstanceIdentifier yangInstanceIdentifier) { + return Optional.absent(); + } + + @Override + public DOMMountPointBuilder createMountPoint(final YangInstanceIdentifier yangInstanceIdentifier) { + throw new UnsupportedOperationException("No mountpoint support"); + } + + @Override + public ListenerRegistration registerProvisionListener( + final MountProvisionListener mountProvisionListener) { + return new ListenerRegistration() { + @Override + public void close() { + // Noop + } + + @Override + public MountProvisionListener getInstance() { + return mountProvisionListener; + } + }; + } + } +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModule.java new file mode 100644 index 000000000..1d1fa5323 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModule.java @@ -0,0 +1,26 @@ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; + +import io.fd.honeycomb.v3po.data.impl.DataBroker; +import io.fd.honeycomb.v3po.data.impl.ModifiableDataTreeManager; + +public class ContextDataBrokerModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractContextDataBrokerModule { + + public ContextDataBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public ContextDataBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.ContextDataBrokerModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + return DataBroker.create(new ModifiableDataTreeManager(getContextDataTreeDependency())); + } + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModuleFactory.java new file mode 100644 index 000000000..360f5f472 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModuleFactory.java @@ -0,0 +1,13 @@ +/* +* Generated file +* +* Generated from: yang module name: v3po-impl yang module local name: honeycomb-context-dom-data-broker +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Mon May 16 15:27:12 CEST 2016 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; +public class ContextDataBrokerModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractContextDataBrokerModuleFactory { + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java new file mode 100644 index 000000000..8aa3d64d9 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; + +import io.fd.honeycomb.v3po.data.impl.DataBroker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DataBrokerModule extends + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractDataBrokerModule { + + private static final Logger LOG = LoggerFactory.getLogger(DataBrokerModule.class); + + public DataBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public DataBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.DataBrokerModule oldModule, + java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + LOG.debug("DataBrokerModule.createInstance()"); + return DataBroker.create(getConfigDataTreeDependency(), getOperationalDataTreeDependency()); + } +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java new file mode 100644 index 000000000..cc30beacf --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java @@ -0,0 +1,13 @@ +/* +* Generated file +* +* Generated from: yang module name: v3po-impl yang module local name: honeycomb-dom-data-broker +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Mon Apr 11 07:53:38 CEST 2016 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; +public class DataBrokerModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractDataBrokerModuleFactory { + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModule.java new file mode 100644 index 000000000..48d227d01 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModule.java @@ -0,0 +1,117 @@ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; + +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer; +import org.opendaylight.controller.sal.binding.api.BindingAwareProvider; +import org.opendaylight.controller.sal.binding.api.BindingAwareService; +import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier; +import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.RpcService; +import org.osgi.framework.BundleContext; + +public class NetconfBindingBrokerModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractNetconfBindingBrokerModule { + public NetconfBindingBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public NetconfBindingBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.NetconfBindingBrokerModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + return new FakeBindingAwareBroker(getNetconfBindingBrokerDependency()); + } + + private static class FakeBindingAwareBroker implements BindingAwareBroker, AutoCloseable { + + private DataBroker netconfBindingBrokerDependency; + + public FakeBindingAwareBroker(final DataBroker netconfBindingBrokerDependency) { + + this.netconfBindingBrokerDependency = netconfBindingBrokerDependency; + } + + @Deprecated + @Override + public ConsumerContext registerConsumer(final BindingAwareConsumer bindingAwareConsumer, + final BundleContext bundleContext) { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public ConsumerContext registerConsumer(final BindingAwareConsumer bindingAwareConsumer) { + final ConsumerContext consumerContext = new ConsumerContext() { + @Override + public T getSALService(final Class aClass) { + return aClass.equals(DataBroker.class) + ? (T) netconfBindingBrokerDependency + : null; + } + + @Override + public T getRpcService(final Class aClass) { + return null; + } + }; + bindingAwareConsumer.onSessionInitialized(consumerContext); + return consumerContext; + } + + @Override + public ProviderContext registerProvider(final BindingAwareProvider bindingAwareProvider, + final BundleContext bundleContext) { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public ProviderContext registerProvider(final BindingAwareProvider bindingAwareProvider) { + final ProviderContext context = new ProviderContext() { + @Override + public >> ListenerRegistration registerRouteChangeListener( + final L l) { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public T getRpcService(final Class aClass) { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public RpcRegistration addRpcImplementation(final Class aClass, final T t) + throws IllegalStateException { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public RoutedRpcRegistration addRoutedRpcImplementation( + final Class aClass, final T t) throws IllegalStateException { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public T getSALService(final Class aClass) { + return aClass.equals(DataBroker.class) + ? (T) netconfBindingBrokerDependency + : null; } + }; + bindingAwareProvider.onSessionInitiated(context); + return context; + } + + @Override + public void close() throws Exception { + netconfBindingBrokerDependency = null; + } + } +} + diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModuleFactory.java new file mode 100644 index 000000000..b64b0b1e1 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModuleFactory.java @@ -0,0 +1,13 @@ +/* +* Generated file +* +* Generated from: yang module name: v3po-impl yang module local name: binding-broker-netconf +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Wed Mar 23 10:45:48 CET 2016 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; +public class NetconfBindingBrokerModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractNetconfBindingBrokerModuleFactory { + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModule.java new file mode 100644 index 000000000..8502fcbd2 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModule.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; + +import io.fd.honeycomb.v3po.translate.read.registry.ModifiableReaderRegistryBuilder; +import io.fd.honeycomb.v3po.translate.util.read.BindingBrokerReader; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfStateBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class NetconfMonitoringReaderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractNetconfMonitoringReaderModule { + public NetconfMonitoringReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public NetconfMonitoringReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.NetconfMonitoringReaderModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + return new ReaderFactory(getNetconfMonitoringBindingBrokerDependency()); + } + + + private static final class ReaderFactory implements AutoCloseable, io.fd.honeycomb.v3po.translate.read.ReaderFactory { + + private final DataBroker netconfMonitoringBindingBrokerDependency; + + public ReaderFactory(final DataBroker netconfMonitoringBindingBrokerDependency) { + this.netconfMonitoringBindingBrokerDependency = netconfMonitoringBindingBrokerDependency; + } + + @Override + public void init(final ModifiableReaderRegistryBuilder registry) { + registry.add(new BindingBrokerReader<>(InstanceIdentifier.create(NetconfState.class), + netconfMonitoringBindingBrokerDependency, + LogicalDatastoreType.OPERATIONAL, NetconfStateBuilder.class)); + } + } +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModuleFactory.java new file mode 100644 index 000000000..b8b7bec63 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModuleFactory.java @@ -0,0 +1,13 @@ +/* +* Generated file +* +* Generated from: yang module name: v3po-impl yang module local name: netconf-monitoring-reader +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Tue Apr 12 13:03:40 CEST 2016 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; +public class NetconfMonitoringReaderModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractNetconfMonitoringReaderModuleFactory { + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java new file mode 100644 index 000000000..caa792da4 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2015 Cisco and/or its affiliates. + * + * 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. + */ + +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; + +import io.fd.honeycomb.v3po.impl.NorthboundFacadeHoneycombDOMBroker; +import org.opendaylight.controller.sal.core.api.AbstractProvider; +import org.opendaylight.controller.sal.core.api.Broker; +import org.opendaylight.controller.sal.core.api.model.SchemaService; + +public class V3poModule extends + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractV3poModule { + + public V3poModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public V3poModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.V3poModule oldModule, + java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here + } + + @Override + public java.lang.AutoCloseable createInstance() { + + final Broker.ProviderSession providerSession = + getDomBrokerDependency().registerProvider(new AbstractProvider() { + @Override + public void onSessionInitiated(final Broker.ProviderSession providerSession) { + // NOOP + } + }); + final SchemaService schemaBiService = providerSession.getService(SchemaService.class); + + return new NorthboundFacadeHoneycombDOMBroker(getHoneycombDomDataBrokerDependency(), schemaBiService, + getHoneycombDomNotificationServiceDependency()); + } + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactory.java new file mode 100644 index 000000000..5c942861d --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactory.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2015 Cisco and/or its affiliates. + * + * 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. + */ +/* +* Generated file +* +* Generated from: yang module name: v3po yang module local name: v3po +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Fri Jan 02 13:49:24 CST 2015 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; +public class V3poModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractV3poModuleFactory { + +} diff --git a/infra/impl/src/main/yang/v3po-impl.yang b/infra/impl/src/main/yang/v3po-impl.yang new file mode 100644 index 000000000..fa9670678 --- /dev/null +++ b/infra/impl/src/main/yang/v3po-impl.yang @@ -0,0 +1,155 @@ +module v3po-impl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:v3po:impl"; + prefix "v3po-impl"; + + import config { prefix config; revision-date 2013-04-05; } + import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;} + import opendaylight-md-sal-dom {prefix dom;} + import translate-api { prefix tapi; revision-date 2016-04-06; } + import data-api { prefix dapi; revision-date 2016-04-11; } + import notification-api { prefix hc-notif-a; revision-date 2016-06-01; } + + description + "Service definition for v3po project"; + + revision "2014-12-10" { + description + "Initial revision"; + } + + identity v3po { + base config:module-type; + config:provided-service dom:dom-broker-osgi-registry; + config:java-name-prefix V3po; + } + + augment "/config:modules/config:module/config:configuration" { + case v3po { + when "/config:modules/config:module/config:type = 'v3po'"; + container dom-broker { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity dom:dom-broker-osgi-registry; + } + } + } + + container honeycomb-dom-data-broker { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity dom:dom-async-data-broker; + } + } + } + + container honeycomb-dom-notification-service { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity hc-notif-a:dom-notification-service; + } + } + } + + } + } + + identity binding-broker-netconf { + base config:module-type; + config:provided-service md-sal-binding:binding-broker-osgi-registry; + config:java-name-prefix NetconfBindingBroker; + } + + augment "/config:modules/config:module/config:configuration" { + case binding-broker-netconf { + when "/config:modules/config:module/config:type = 'binding-broker-netconf'"; + + container netconf-binding-broker { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity md-sal-binding:binding-async-data-broker; + } + } + } + + } + } + + identity honeycomb-dom-data-broker { + base config:module-type; + config:provided-service dom:dom-async-data-broker; + config:java-name-prefix DataBroker; + } + + augment "/config:modules/config:module/config:configuration" { + case honeycomb-dom-data-broker { + when "/config:modules/config:module/config:type = 'honeycomb-dom-data-broker'"; + + container config-data-tree { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity dapi:honeycomb-modifiable-data-tree; + } + } + } + + container operational-data-tree { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity dapi:honeycomb-readable-data-tree; + } + } + } + + } + } + + identity honeycomb-context-dom-data-broker { + base config:module-type; + config:provided-service dom:dom-async-data-broker; + config:java-name-prefix ContextDataBroker; + description "DomBroker on top of context data-tree"; + } + + augment "/config:modules/config:module/config:configuration" { + case honeycomb-context-dom-data-broker { + when "/config:modules/config:module/config:type = 'honeycomb-context-dom-data-broker'"; + + container context-data-tree { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity dapi:data-tree; + } + } + } + } + } + + identity netconf-monitoring-reader { + base config:module-type; + config:provided-service tapi:honeycomb-reader-factory; + } + + augment "/config:modules/config:module/config:configuration" { + case netconf-monitoring-reader { + when "/config:modules/config:module/config:type = 'netconf-monitoring-reader'"; + + container netconf-monitoring-binding-broker { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity md-sal-binding:binding-async-data-broker; + } + } + } + + } + } +} diff --git a/infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactoryTest.java b/infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactoryTest.java new file mode 100644 index 000000000..5b9a67458 --- /dev/null +++ b/infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactoryTest.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015 Cisco and/or its affiliates. + * + * 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. + */ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; + +import org.junit.Test; + +public class V3poModuleFactoryTest { + @Test + public void testFactoryConstructor() { + // ensure no exceptions on construction + new V3poModuleFactory(); + } +} diff --git a/infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java b/infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java new file mode 100644 index 000000000..3d8e79641 --- /dev/null +++ b/infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2015 Cisco and/or its affiliates. + * + * 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. + */ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import javax.management.ObjectName; +import org.junit.Test; +import org.opendaylight.controller.config.api.DependencyResolver; +import org.opendaylight.controller.config.api.JmxAttribute; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.core.api.Broker; +import org.opendaylight.controller.sal.core.api.Provider; +import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer; + +public class V3poModuleTest { + @Test + public void testCustomValidation() { + V3poModule module = new V3poModule(mock(ModuleIdentifier.class), mock(DependencyResolver.class)); + + // ensure no exceptions on validation + // currently this method is empty + module.customValidation(); + } + + @Test + public void testCreateInstance() throws Exception { + // configure mocks + DependencyResolver dependencyResolver = mock(DependencyResolver.class); + BindingAwareBroker broker = mock(BindingAwareBroker.class); + when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))) + .thenReturn(broker); + final org.opendaylight.controller.sal.core.api.Broker domBroker = mock(org.opendaylight.controller.sal.core.api.Broker.class); + when(dependencyResolver.resolveInstance(eq(org.opendaylight.controller.sal.core.api.Broker.class), any(ObjectName.class), any(JmxAttribute.class))) + .thenReturn(domBroker); + doReturn(mock(Broker.ProviderSession.class)).when(domBroker).registerProvider(any(Provider.class)); + when(dependencyResolver.resolveInstance(eq(BindingNormalizedNodeSerializer.class), any(ObjectName.class), any(JmxAttribute.class))) + .thenReturn(mock(BindingNormalizedNodeSerializer.class)); + when(dependencyResolver.resolveInstance(eq(DOMDataBroker.class), any(ObjectName.class), any(JmxAttribute.class))) + .thenReturn(mock(DOMDataBroker.class)); + + // create instance of module with injected mocks + V3poModule module = new V3poModule(mock(ModuleIdentifier.class), dependencyResolver); + + // getInstance calls resolveInstance to get the broker dependency and then calls createInstance + AutoCloseable closeable = module.getInstance(); + + // ensure no exceptions on close + closeable.close(); + } +} -- cgit 1.2.3-korg