summaryrefslogtreecommitdiffstats
path: root/infra/minimal-distribution/src
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-09-05 12:10:26 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-09-07 06:50:30 +0000
commit1326e9fa5cffe326b82aeee9d82d008526aff947 (patch)
treef8ca808f3aa3a9338573d8892b83305210a664a1 /infra/minimal-distribution/src
parent6e77db8e850be8ad8a3d91bf43fb8986125ae60f (diff)
Cleanup TODOs and FIXMEs
- Fix minor ones - Report bigger and include issue number in comment - Pull common dependencies into dependency management of common/parents Change-Id: I06a6ac37c52b603fd73ed42023d6b2e7fa18010f Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'infra/minimal-distribution/src')
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java1
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java4
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java2
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.java4
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfModule.java3
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.java27
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfSshServerProvider.java2
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NettyTimerProvider.java35
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.java2
-rw-r--r--infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml2
10 files changed, 36 insertions, 46 deletions
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java
index d43e33096..c592fd3b3 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/Main.java
@@ -69,7 +69,6 @@ public final class Main {
private Main() {}
public static void main(String[] args) {
- // TODO add "clean" argument
init(BASE_MODULES);
}
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
index e25cb1569..f2e81a9f6 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
@@ -59,9 +59,9 @@ public final class HoneycombNotificationManagerProvider extends ProviderTrait<No
new NotificationProducerTracker(notificationProducerRegistry, honeycombNotificationCollector,
notificationRouter);
- // TODO wire with restconf
// DOMNotificationService is already provided by DOMBroker injected into RESTCONF, however RESTCONF
- // only supports data-change notification, nothing else. So currently its impossible.
+ // only supports data-change notification, nothing else. So currently (Beryllium-SR2) honeycomb notifications
+ // won't be available over RESTCONF.
return honeycombNotificationCollector;
}
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java
index 7db2f7856..f5f04d2a7 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java
@@ -49,7 +49,7 @@ public final class InmemoryDOMDataBrokerProvider extends ProviderTrait<DOMDataBr
ExecutorService listenableFutureExecutor =
SpecialExecutors.newBlockingBoundedCachedThreadPool(1, 100, "commits");
ExecutorService commitExecutor = SpecialExecutors.newBoundedSingleThreadExecutor(100, "WriteTxCommit");
- // TODO try to provide more lightweight implementation of DataBroker, maybe a single executor would be enough
+ // TODO HONEYCOMB-164 try to provide more lightweight implementation of DataBroker
Map<LogicalDatastoreType, DOMStore> map = new LinkedHashMap<>();
map.put(LogicalDatastoreType.CONFIGURATION, cfgDataStore);
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.java
index 3954af896..f60366c7e 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.java
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/HoneycombNotification2NetconfProvider.java
@@ -68,7 +68,7 @@ public final class HoneycombNotification2NetconfProvider
new TranslatingNotificationListener(netconfNotifReg, streamType, schemaService);
// NotificationManager is used to provide list of available notifications (which are all of the notifications registered)
- // TODO make available notifications configurable here so that any number of notification streams for HONEYCOMB_NETCONF
+ // TODO HONEYCOMB-165 make available notifications configurable here so that any number of notification streams for netconf
// can be configured on top of a single notification manager
LOG.debug("Current notifications to be exposed over HONEYCOMB_NETCONF: {}",
hcNotificationCollector.getNotificationTypes());
@@ -77,7 +77,7 @@ public final class HoneycombNotification2NetconfProvider
.collect(Collectors.toList());
// Register as listener to HC'OPERATIONAL DOM notification service
- // TODO This should only be triggered when HONEYCOMB_NETCONF notifications are activated
+ // TODO HONEYCOMB-166 This should only be triggered when HONEYCOMB_NETCONF notifications are activated
// Because this way we actually start all notification producers
// final Collection<QName> notificationQNames =
ListenerRegistration<DOMNotificationListener> domNotifListenerReg = notificationRouter
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfModule.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfModule.java
index 9beb10dbc..3466362cf 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfModule.java
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfModule.java
@@ -29,6 +29,7 @@ import io.fd.honeycomb.infra.distro.data.HoneycombNotificationManagerProvider;
import io.fd.honeycomb.infra.distro.data.InmemoryDOMDataBrokerProvider;
import io.fd.honeycomb.notification.NotificationCollector;
import io.netty.channel.nio.NioEventLoopGroup;
+import io.netty.util.HashedWheelTimer;
import io.netty.util.Timer;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -118,7 +119,7 @@ public class NetconfModule extends PrivateModule {
*/
private AnnotatedElementBuilder configureServer() {
bind(NioEventLoopGroup.class).toProvider(NettyThreadGroupProvider.class).in(Singleton.class);
- bind(Timer.class).toProvider(NettyTimerProvider.class).in(Singleton.class);
+ bind(Timer.class).toInstance(new HashedWheelTimer());
bind(NetconfServerDispatcher.class).toProvider(NetconfServerDispatcherProvider.class).in(Singleton.class);
bind(NetconfTcpServerProvider.NetconfTcpServer.class).toProvider(NetconfTcpServerProvider.class)
.in(Singleton.class);
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.java
index 583b15055..3a4c13697 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.java
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfMonitoringReaderFactoryProvider.java
@@ -18,10 +18,15 @@ package io.fd.honeycomb.infra.distro.netconf;
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import io.fd.honeycomb.impl.NetconfMonitoringReaderFactory;
import io.fd.honeycomb.infra.distro.ProviderTrait;
import io.fd.honeycomb.translate.read.ReaderFactory;
+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 final class NetconfMonitoringReaderFactoryProvider extends ProviderTrait<ReaderFactory> {
@@ -34,4 +39,24 @@ public final class NetconfMonitoringReaderFactoryProvider extends ProviderTrait<
protected NetconfMonitoringReaderFactory create() {
return new NetconfMonitoringReaderFactory(netconfDataBroker);
}
+
+ /**
+ * {@link io.fd.honeycomb.translate.read.ReaderFactory} initiating reader into NETCONF's dedicated data store.
+ * Making NETCONF operational data available over NETCONF/RESTCONF
+ */
+ private static final class NetconfMonitoringReaderFactory implements ReaderFactory {
+
+ private final DataBroker netconfMonitoringBindingBrokerDependency;
+
+ NetconfMonitoringReaderFactory(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/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfSshServerProvider.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfSshServerProvider.java
index 0b3be9f1f..2c1eceeaf 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfSshServerProvider.java
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NetconfSshServerProvider.java
@@ -75,7 +75,7 @@ public final class NetconfSshServerProvider extends ProviderTrait<NetconfSshServ
final SshProxyServerConfigurationBuilder sshConfigBuilder = new SshProxyServerConfigurationBuilder();
sshConfigBuilder.setBindingAddress(bindingAddress);
sshConfigBuilder.setLocalAddress(localAddress);
- // TODO only simple authProvider checking ConfigAttributes
+ // Only simple authProvider checking ConfigAttributes, checking the config file
sshConfigBuilder.setAuthenticator(new SimplelAuthProvider(cfgAttributes));
sshConfigBuilder.setIdleTimeout(Integer.MAX_VALUE);
sshConfigBuilder.setKeyPairProvider(new PEMGeneratorHostKeyProvider());
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NettyTimerProvider.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NettyTimerProvider.java
deleted file mode 100644
index 6ae960cea..000000000
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/netconf/NettyTimerProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2016 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.infra.distro.netconf;
-
-import com.google.inject.Inject;
-import io.fd.honeycomb.infra.distro.ProviderTrait;
-import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration;
-import io.netty.util.HashedWheelTimer;
-import io.netty.util.Timer;
-
-public final class NettyTimerProvider extends ProviderTrait<Timer> {
-
- @Inject
- private HoneycombConfiguration cfgAttributes;
-
- @Override
- protected HashedWheelTimer create() {
- // TODO expose configuration,
- return new HashedWheelTimer();
- }
-}
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.java b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.java
index 76fc72f3f..8dca157a6 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.java
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.java
@@ -53,7 +53,7 @@ public final class HttpsConnectorProvider extends ProviderTrait<ServerConnector>
URL truststoreURL = getClass().getResource(cfg.restconfTruststore.get());
sslContextFactory.setTrustStorePath(truststoreURL.getPath());
sslContextFactory.setTrustStorePassword((cfg.truststorePassword.get()));
- // TODO make this more configurable
+ // TODO HONEYCOMB-167 make this more configurable
sslContextFactory.setExcludeCipherSuites("SSL_RSA_WITH_DES_CBC_SHA", "SSL_DHE_RSA_WITH_DES_CBC_SHA",
"SSL_DHE_DSS_WITH_DES_CBC_SHA", "SSL_RSA_EXPORT_WITH_RC4_40_MD5", "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
"SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
diff --git a/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml b/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml
index 7e59a1a7d..45fcce741 100644
--- a/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml
+++ b/infra/minimal-distribution/src/main/resources/honeycomb-minimal-resources/config/WEB-INF/web.xml
@@ -42,7 +42,7 @@
<param-value>application/xml,application/yang.data+xml,xml,application/json,application/yang.data+json</param-value>
</init-param>
</filter>
- <!-- FIXME gzip filter is deprecated -->
+ <!-- TODO HONEYCOMB-168 gzip filter is deprecated -->
<filter-mapping>
<filter-name>GzipFilter</filter-name>
<url-pattern>/*</url-pattern>