<version>1.6.0-SNAPSHOT</version>
<packaging>pom</packaging>
+ <properties>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.install.skip>true</maven.install.skip>
+ </properties>
+
<modules>
<module>netconf</module>
<module>netconf-connector</module>
client.start();
acceptor.bind(bindAddress);
} catch (IOException e) {
- LOG.error("Unable to start NETCONF CallHome Service", e);
+ LOG.error("Unable to start NETCONF CallHome Service on {}", bindAddress, e);
throw e;
}
}
<packaging>pom</packaging>
<name>${project.artifactId}</name>
+ <properties>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.install.skip>true</maven.install.skip>
+ </properties>
+
<modules>
<module>ietf-netconf</module>
<module>ietf-netconf-monitoring</module>
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import java.net.InetSocketAddress;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class ProxyServer implements AutoCloseable {
+ private static final Logger LOG = LoggerFactory.getLogger(ProxyServer.class);
+
private final EventLoopGroup bossGroup = new NioEventLoopGroup();
private final EventLoopGroup workerGroup = new NioEventLoopGroup();
private final ChannelFuture channelFuture;
+ @SuppressWarnings("checkstyle:IllegalCatch")
public ProxyServer(InetSocketAddress address, final LocalAddress localAddress) {
// Configure the server.
final Bootstrap clientBootstrap = new Bootstrap();
});
// Start the server.
- channelFuture = serverBootstrap.bind(address).syncUninterruptibly();
+ try {
+ channelFuture = serverBootstrap.bind(address).syncUninterruptibly();
+ } catch (Throwable throwable) {
+ // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them
+ LOG.error("Error while binding to address {}", address, throwable);
+ throw throwable;
+ }
}
@Override
<packaging>pom</packaging>
<name>${project.artifactId}</name>
+ <properties>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.install.skip>true</maven.install.skip>
+ </properties>
+
<modules>
<module>netconf-api</module>
<module>netconf-config</module>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
+ <properties>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.install.skip>true</maven.install.skip>
+ </properties>
+
<modules>
<module>features</module>
<module>karaf</module>
<module>restconf</module>
</modules>
+ <profiles>
+ <profile>
+ <id>sonar-jacoco-aggregate</id>
+ <activation>
+ <property>
+ <name>odl.jacoco.aggregateFile</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>merge</id>
+ <goals>
+ <goal>merge</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <destFile>${odl.jacoco.aggregateFile}</destFile>
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}</directory>
+ <includes>
+ <include>**/target/code-coverage/*.exec</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
+ <properties>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.install.skip>true</maven.install.skip>
+ </properties>
+
<modules>
<module>restconf-parent</module>
<module>restconf-artifacts</module>
return listModuleBuilder.build();
}
- protected MapEntryNode toModuleEntryNode(final Module module, final DataSchemaNode moduleSchemaNode) {
+ private MapEntryNode toModuleEntryNode(final Module module, final DataSchemaNode moduleSchemaNode) {
Preconditions.checkArgument(moduleSchemaNode instanceof ListSchemaNode,
"moduleSchemaNode has to be of type ListSchemaNode");
final ListSchemaNode listModuleSchemaNode = (ListSchemaNode) moduleSchemaNode;
moduleNodeValues
.withChild(Builders.leafBuilder((LeafSchemaNode) nameSchemaNode).withValue(module.getName()).build());
+ final QNameModule qNameModule = module.getQNameModule();
+
instanceDataChildrenByName =
ControllerContext.findInstanceDataChildrenByName(listModuleSchemaNode, "revision");
final DataSchemaNode revisionSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
Preconditions.checkState(revisionSchemaNode instanceof LeafSchemaNode);
- final java.util.Optional<Revision> revision = module.getQNameModule().getRevision();
- if (revision.isPresent()) {
- moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) revisionSchemaNode)
- .withValue(revision.get().toString()).build());
- }
+ final java.util.Optional<Revision> revision = qNameModule.getRevision();
+ moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) revisionSchemaNode)
+ .withValue(revision.map(Revision::toString).orElse("")).build());
instanceDataChildrenByName =
ControllerContext.findInstanceDataChildrenByName(listModuleSchemaNode, "namespace");
final DataSchemaNode namespaceSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
Preconditions.checkState(namespaceSchemaNode instanceof LeafSchemaNode);
moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) namespaceSchemaNode)
- .withValue(module.getNamespace().toString()).build());
+ .withValue(qNameModule.getNamespace().toString()).build());
instanceDataChildrenByName =
ControllerContext.findInstanceDataChildrenByName(listModuleSchemaNode, "feature");
}
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void run() {
bossGroup = new NioEventLoopGroup();
workerGroup = new NioEventLoopGroup();
channel.closeFuture().sync();
} catch (final InterruptedException e) {
LOG.error("Web socket server encountered an error during startup attempt on port {}", port, e);
+ } catch (Throwable throwable) {
+ // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them
+ LOG.error("Error while binding to address {}, port {}", address, port, throwable);
+ throw throwable;
} finally {
stop();
}
}
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void run() {
bossGroup = new NioEventLoopGroup();
workerGroup = new NioEventLoopGroup();
channel.closeFuture().sync();
} catch (final InterruptedException e) {
LOG.error("Web socket server encountered an error during startup attempt on port {}", port, e);
+ } catch (Throwable throwable) {
+ // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them
+ LOG.error("Error while binding to port {}", port, throwable);
+ throw throwable;
} finally {
stop();
}