From e3c31cee916480b2d9d169c1f5afb1c42efaabe1 Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Fri, 29 Jul 2016 16:27:12 +0200 Subject: HONEYCOMB-130: Rename infra packages(remove vpp/v3po) Change-Id: Ic5b90e397e3743623d01b206bc60bc5c7df6b981 Signed-off-by: Maros Marsalek --- .../src/main/config/context-datatree-config.xml | 6 +- infra/impl/src/main/config/default-config.xml | 12 +- infra/impl/src/main/config/initializer-config.xml | 18 +- .../impl/src/main/config/netconf-north-config.xml | 80 ++++---- .../impl/src/main/config/restconf-north-config.xml | 2 +- .../impl/NorthboundFacadeHoneycombDOMBroker.java | 206 +++++++++++++++++++++ .../impl/NorthboundFacadeHoneycombDOMBroker.java | 206 --------------------- .../impl/rev141210/ContextDataBrokerModule.java | 26 +++ .../rev141210/ContextDataBrokerModuleFactory.java | 13 ++ .../honeycomb/impl/rev141210/DataBrokerModule.java | 34 ++++ .../impl/rev141210/DataBrokerModuleFactory.java | 13 ++ .../honeycomb/impl/rev141210/HoneycombModule.java | 59 ++++++ .../impl/rev141210/HoneycombModuleFactory.java | 28 +++ .../impl/rev141210/NetconfBindingBrokerModule.java | 117 ++++++++++++ .../NetconfBindingBrokerModuleFactory.java | 13 ++ .../rev141210/NetconfMonitoringReaderModule.java | 46 +++++ .../NetconfMonitoringReaderModuleFactory.java | 13 ++ .../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/honeycomb-impl.yang | 155 ++++++++++++++++ infra/impl/src/main/yang/v3po-impl.yang | 155 ---------------- .../v3po/impl/rev141210/V3poModuleFactoryTest.java | 26 --- .../yang/v3po/impl/rev141210/V3poModuleTest.java | 70 ------- 31 files changed, 782 insertions(+), 879 deletions(-) create mode 100644 infra/impl/src/main/java/io/fd/honeycomb/impl/NorthboundFacadeHoneycombDOMBroker.java delete 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/honeycomb/impl/rev141210/ContextDataBrokerModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/ContextDataBrokerModuleFactory.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/DataBrokerModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/DataBrokerModuleFactory.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/HoneycombModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/HoneycombModuleFactory.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfBindingBrokerModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfBindingBrokerModuleFactory.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfMonitoringReaderModule.java create mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfMonitoringReaderModuleFactory.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModule.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModuleFactory.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModule.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModuleFactory.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModule.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModuleFactory.java delete mode 100644 infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java delete 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/honeycomb-impl.yang delete mode 100644 infra/impl/src/main/yang/v3po-impl.yang delete mode 100644 infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactoryTest.java delete 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/src/main/config/context-datatree-config.xml b/infra/impl/src/main/config/context-datatree-config.xml index 313f0ebe6..4d43a40cf 100644 --- a/infra/impl/src/main/config/context-datatree-config.xml +++ b/infra/impl/src/main/config/context-datatree-config.xml @@ -19,9 +19,9 @@ - urn:opendaylight:params:xml:ns:yang:v3po:impl?module=v3po-impl&revision=2014-12-10 + urn:opendaylight:params:xml:ns:yang:honeycomb:impl?module=honeycomb-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:init?module=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 @@ -60,7 +60,7 @@ - prefix:honeycomb-context-dom-data-broker + prefix:honeycomb-context-dom-data-broker honeycomb-context-data-broker diff --git a/infra/impl/src/main/config/default-config.xml b/infra/impl/src/main/config/default-config.xml index c817a5db3..9e63917cd 100644 --- a/infra/impl/src/main/config/default-config.xml +++ b/infra/impl/src/main/config/default-config.xml @@ -16,7 +16,7 @@ --> - urn:opendaylight:params:xml:ns:yang:v3po:impl?module=v3po-impl&revision=2014-12-10 + urn:opendaylight:params:xml:ns:yang:honeycomb:impl?module=honeycomb-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 @@ -116,7 +116,7 @@ - prefix:honeycomb-dom-data-broker + prefix:honeycomb-dom-data-broker honeycomb-dom-data-broker prefix:honeycomb-modifiable-data-tree @@ -150,8 +150,8 @@ - prefix:v3po - v3po-default + prefix:honeycomb + honeycomb-default prefix:dom-broker-osgi-registry dom-broker @@ -242,8 +242,8 @@ dom:dom-broker-osgi-registry - vpp-dom-broker - /modules/module[type='v3po'][name='v3po-default'] + honeycomb-dom-broker + /modules/module[type='honeycomb'][name='honeycomb-default'] diff --git a/infra/impl/src/main/config/initializer-config.xml b/infra/impl/src/main/config/initializer-config.xml index f46069340..0b87e42dc 100644 --- a/infra/impl/src/main/config/initializer-config.xml +++ b/infra/impl/src/main/config/initializer-config.xml @@ -19,9 +19,9 @@ - urn:opendaylight:params:xml:ns:yang:v3po:impl?module=v3po-impl&revision=2014-12-10 + urn:opendaylight:params:xml:ns:yang:honeycomb:impl?module=honeycomb-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:init?module=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 @@ -60,7 +60,7 @@ - prefix:honeycomb-dom-data-broker + prefix:honeycomb-dom-data-broker cfg-init-dom-data-broker prefix:honeycomb-modifiable-data-tree @@ -92,7 +92,7 @@ - prefix:persisted-file-initializer + prefix:persisted-file-initializer persisted-context-initializer dom:dom-async-data-broker @@ -107,7 +107,7 @@ oper - prefix:persisted-file-initializer + prefix:persisted-file-initializer persisted-config-initializer prefix:dom-async-data-broker @@ -123,14 +123,14 @@ - prefix:cfg-initializer-registry + prefix:cfg-initializer-registry initializer-registry - prefix:cfg-initializer + prefix:cfg-initializer persisted-context-initializer - prefix:cfg-initializer + prefix:cfg-initializer persisted-config-initializer @@ -170,7 +170,7 @@ - prefix:cfg-initializer + prefix:cfg-initializer persisted-context-initializer /modules/module[type='persisted-file-initializer'][name='persisted-context-initializer'] diff --git a/infra/impl/src/main/config/netconf-north-config.xml b/infra/impl/src/main/config/netconf-north-config.xml index 35bd5ff04..8e6f17019 100644 --- a/infra/impl/src/main/config/netconf-north-config.xml +++ b/infra/impl/src/main/config/netconf-north-config.xml @@ -83,7 +83,7 @@ - prefix:binding-broker-netconf + prefix:binding-broker-netconf binding-broker-netconf binding:binding-async-data-broker @@ -96,7 +96,7 @@ prefix:netconf-mdsal-mapper - netconf-vpp-mapper + netconf-honeycomb-mapper dom:schema-service @@ -112,13 +112,13 @@ dom:dom-broker-osgi-registry - vpp-dom-broker + honeycomb-dom-broker prefix:netconf-mapper-registry - vpp-mapper-aggregator-registry + honeycomb-mapper-aggregator-registry @@ -126,19 +126,19 @@ prefix:netconf-server-dispatcher-impl - netconf-vpp-server-dispatcher + netconf-honeycomb-server-dispatcher dom:netconf-northbound-mapper - vpp-mapper-aggregator + honeycomb-mapper-aggregator prefix:netconf-server-monitoring - vpp-server-monitor + honeycomb-server-monitor @@ -165,12 +165,12 @@ prefix:netconf-mdsal-monitoring-mapper - netconf-vpp-monitoring-mapper + netconf-honeycomb-monitoring-mapper prefix:netconf-server-monitoring - vpp-server-monitor + honeycomb-server-monitor @@ -183,7 +183,7 @@ prefix:netconf-mapper-registry - vpp-mapper-aggregator-registry + honeycomb-mapper-aggregator-registry @@ -191,19 +191,19 @@ prefix:netconf-mapper-aggregator - vpp-mapper-aggregator + honeycomb-mapper-aggregator prefix:netconf-server-monitoring-impl - vpp-server-monitor + honeycomb-server-monitor dom:netconf-northbound-mapper - vpp-mapper-aggregator + honeycomb-mapper-aggregator @@ -218,7 +218,7 @@ prefix:netconf-northbound-ssh - netconf-vpp-ssh-server + netconf-honeycomb-ssh-server 2830 @@ -243,7 +243,7 @@ prefix:netconf-server-dispatcher - netconf-vpp-server-dispatcher + netconf-honeycomb-server-dispatcher @@ -257,14 +257,14 @@ prefix:netconf-notification-manager - vpp-netconf-notification-manager + honeycomb-netconf-notification-manager prefix:netconf-mdsal-notification-mapper - netconf-vpp-notification-mapper + netconf-honeycomb-notification-mapper @@ -284,20 +284,20 @@ prefix:netconf-mapper-registry - vpp-mapper-aggregator-registry + honeycomb-mapper-aggregator-registry prefix:netconf-notification-registry - vpp-netconf-notification-manager + honeycomb-netconf-notification-manager prefix:netconf-notification-collector - vpp-netconf-notification-manager + honeycomb-netconf-notification-manager @@ -307,12 +307,12 @@ prefix:netconf-northbound-tcp - netconf-vpp-tcp-server + netconf-honeycomb-tcp-server prefix:netconf-server-dispatcher - netconf-vpp-server-dispatcher + netconf-honeycomb-server-dispatcher 7777 @@ -321,7 +321,7 @@ However netconf is wired to our reader registry, so we need to delegate the reads of netconf-monitoring through our readers to the dedicated DS--> - prefix:netconf-monitoring-reader + prefix:netconf-monitoring-reader netconf-monitoring-reader binding:binding-async-data-broker @@ -394,8 +394,8 @@ prefix:netconf-server-monitoring - vpp-server-monitor - /modules/module[type='netconf-server-monitoring-impl'][name='vpp-server-monitor'] + honeycomb-server-monitor + /modules/module[type='netconf-server-monitoring-impl'][name='honeycomb-server-monitor'] @@ -404,8 +404,8 @@ prefix:netconf-northbound-mapper - netconf-vpp-mapper - /modules/module[type='netconf-mdsal-mapper'][name='netconf-vpp-mapper'] + netconf-honeycomb-mapper + /modules/module[type='netconf-mdsal-mapper'][name='netconf-honeycomb-mapper'] @@ -413,8 +413,8 @@ prefix:netconf-northbound-mapper - vpp-mapper-aggregator - /modules/module[type='netconf-mapper-aggregator'][name='vpp-mapper-aggregator'] + honeycomb-mapper-aggregator + /modules/module[type='netconf-mapper-aggregator'][name='honeycomb-mapper-aggregator'] @@ -422,8 +422,8 @@ prefix:netconf-mapper-registry - vpp-mapper-aggregator-registry - /modules/module[type='netconf-mapper-aggregator'][name='vpp-mapper-aggregator'] + honeycomb-mapper-aggregator-registry + /modules/module[type='netconf-mapper-aggregator'][name='honeycomb-mapper-aggregator'] @@ -431,9 +431,9 @@ prefix:netconf-server-dispatcher - netconf-vpp-server-dispatcher + netconf-honeycomb-server-dispatcher - /modules/module[type='netconf-server-dispatcher-impl'][name='netconf-vpp-server-dispatcher'] + /modules/module[type='netconf-server-dispatcher-impl'][name='netconf-honeycomb-server-dispatcher'] @@ -442,9 +442,9 @@ prefix:netconf-northbound-mapper - netconf-vpp-notification-mapper + netconf-honeycomb-notification-mapper - /modules/module[type='netconf-mdsal-notification-mapper'][name='netconf-vpp-notification-mapper'] + /modules/module[type='netconf-mdsal-notification-mapper'][name='netconf-honeycomb-notification-mapper'] @@ -453,9 +453,9 @@ prefix:netconf-notification-collector - vpp-netconf-notification-manager + honeycomb-netconf-notification-manager - /modules/module[type='netconf-notification-manager'][name='vpp-netconf-notification-manager'] + /modules/module[type='netconf-notification-manager'][name='honeycomb-netconf-notification-manager'] @@ -464,9 +464,9 @@ prefix:netconf-notification-registry - vpp-netconf-notification-manager + honeycomb-netconf-notification-manager - /modules/module[type='netconf-notification-manager'][name='vpp-netconf-notification-manager'] + /modules/module[type='netconf-notification-manager'][name='honeycomb-netconf-notification-manager'] @@ -475,7 +475,7 @@ - urn:opendaylight:params:xml:ns:yang:v3po:impl?module=v3po-impl&revision=2014-12-10 + urn:opendaylight:params:xml:ns:yang:honeycomb:impl?module=honeycomb-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 diff --git a/infra/impl/src/main/config/restconf-north-config.xml b/infra/impl/src/main/config/restconf-north-config.xml index ff2cdac18..00599b62c 100644 --- a/infra/impl/src/main/config/restconf-north-config.xml +++ b/infra/impl/src/main/config/restconf-north-config.xml @@ -24,7 +24,7 @@ dom:dom-broker-osgi-registry - vpp-dom-broker + honeycomb-dom-broker diff --git a/infra/impl/src/main/java/io/fd/honeycomb/impl/NorthboundFacadeHoneycombDOMBroker.java b/infra/impl/src/main/java/io/fd/honeycomb/impl/NorthboundFacadeHoneycombDOMBroker.java new file mode 100644 index 000000000..7e5dfd873 --- /dev/null +++ b/infra/impl/src/main/java/io/fd/honeycomb/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.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/io/fd/honeycomb/v3po/impl/NorthboundFacadeHoneycombDOMBroker.java b/infra/impl/src/main/java/io/fd/honeycomb/v3po/impl/NorthboundFacadeHoneycombDOMBroker.java deleted file mode 100644 index c2d70c38c..000000000 --- a/infra/impl/src/main/java/io/fd/honeycomb/v3po/impl/NorthboundFacadeHoneycombDOMBroker.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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/honeycomb/impl/rev141210/ContextDataBrokerModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/ContextDataBrokerModule.java new file mode 100644 index 000000000..c2f7d688a --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/ContextDataBrokerModule.java @@ -0,0 +1,26 @@ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210; + +import io.fd.honeycomb.data.impl.DataBroker; +import io.fd.honeycomb.data.impl.ModifiableDataTreeManager; + +public class ContextDataBrokerModule extends 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, 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/honeycomb/impl/rev141210/ContextDataBrokerModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/ContextDataBrokerModuleFactory.java new file mode 100644 index 000000000..e07214b2e --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/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.honeycomb.impl.rev141210; +public class ContextDataBrokerModuleFactory extends AbstractContextDataBrokerModuleFactory { + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/DataBrokerModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/DataBrokerModule.java new file mode 100644 index 000000000..d97573e12 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/DataBrokerModule.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210; + +import io.fd.honeycomb.data.impl.DataBroker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DataBrokerModule extends + 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, + 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/honeycomb/impl/rev141210/DataBrokerModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/DataBrokerModuleFactory.java new file mode 100644 index 000000000..388f26c67 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/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.honeycomb.impl.rev141210; +public class DataBrokerModuleFactory extends AbstractDataBrokerModuleFactory { + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/HoneycombModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/HoneycombModule.java new file mode 100644 index 000000000..333219518 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/HoneycombModule.java @@ -0,0 +1,59 @@ +/* + * 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.honeycomb.impl.rev141210; + +import io.fd.honeycomb.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 HoneycombModule extends AbstractHoneycombModule { + + public HoneycombModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public HoneycombModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, + HoneycombModule 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/honeycomb/impl/rev141210/HoneycombModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/HoneycombModuleFactory.java new file mode 100644 index 000000000..2e7b0956f --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/HoneycombModuleFactory.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.honeycomb.impl.rev141210; +public class HoneycombModuleFactory extends AbstractHoneycombModuleFactory { + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfBindingBrokerModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfBindingBrokerModule.java new file mode 100644 index 000000000..12fdcfe35 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfBindingBrokerModule.java @@ -0,0 +1,117 @@ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.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 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, 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/honeycomb/impl/rev141210/NetconfBindingBrokerModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfBindingBrokerModuleFactory.java new file mode 100644 index 000000000..fe9bdcf48 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/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.honeycomb.impl.rev141210; +public class NetconfBindingBrokerModuleFactory extends AbstractNetconfBindingBrokerModuleFactory { + +} diff --git a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfMonitoringReaderModule.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfMonitoringReaderModule.java new file mode 100644 index 000000000..5b9a8b819 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfMonitoringReaderModule.java @@ -0,0 +1,46 @@ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.honeycomb.impl.rev141210; + +import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; +import io.fd.honeycomb.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 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, 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.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/honeycomb/impl/rev141210/NetconfMonitoringReaderModuleFactory.java b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/impl/rev141210/NetconfMonitoringReaderModuleFactory.java new file mode 100644 index 000000000..d5130fd53 --- /dev/null +++ b/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/honeycomb/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.honeycomb.impl.rev141210; +public class NetconfMonitoringReaderModuleFactory extends AbstractNetconfMonitoringReaderModuleFactory { + +} 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 deleted file mode 100644 index 1d1fa5323..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModule.java +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 360f5f472..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/ContextDataBrokerModuleFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -/* -* 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 deleted file mode 100644 index 8aa3d64d9..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index cc30beacf..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -/* -* 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 deleted file mode 100644 index 48d227d01..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModule.java +++ /dev/null @@ -1,117 +0,0 @@ -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 deleted file mode 100644 index b64b0b1e1..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfBindingBrokerModuleFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -/* -* 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 deleted file mode 100644 index 8502fcbd2..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModule.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index b8b7bec63..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/NetconfMonitoringReaderModuleFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -/* -* 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 deleted file mode 100644 index caa792da4..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 deleted file mode 100644 index 5c942861d..000000000 --- a/infra/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactory.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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/honeycomb-impl.yang b/infra/impl/src/main/yang/honeycomb-impl.yang new file mode 100644 index 000000000..46f1af862 --- /dev/null +++ b/infra/impl/src/main/yang/honeycomb-impl.yang @@ -0,0 +1,155 @@ +module honeycomb-impl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:honeycomb:impl"; + prefix "hc-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 honeycomb project"; + + revision "2014-12-10" { + description + "Initial revision"; + } + + identity honeycomb { + base config:module-type; + config:provided-service dom:dom-broker-osgi-registry; + config:java-name-prefix Honeycomb; + } + + augment "/config:modules/config:module/config:configuration" { + case honeycomb { + when "/config:modules/config:module/config:type = 'honeycomb'"; + 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/main/yang/v3po-impl.yang b/infra/impl/src/main/yang/v3po-impl.yang deleted file mode 100644 index fa9670678..000000000 --- a/infra/impl/src/main/yang/v3po-impl.yang +++ /dev/null @@ -1,155 +0,0 @@ -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 deleted file mode 100644 index 5b9a67458..000000000 --- a/infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleFactoryTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 deleted file mode 100644 index 3d8e79641..000000000 --- a/infra/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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