Merge "NECONF-524 : Setting the netconf keepalive logic to be more proactive."
authorJakub Morvay <jakub.morvay@gmail.com>
Mon, 6 Aug 2018 14:50:23 +0000 (14:50 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 6 Aug 2018 14:50:23 +0000 (14:50 +0000)
261 files changed:
features/netconf-connector/features-netconf-connector/pom.xml
features/netconf-connector/odl-message-bus/pom.xml
features/netconf-connector/odl-netconf-callhome-ssh/pom.xml
features/netconf-connector/odl-netconf-clustered-topology/pom.xml
features/netconf-connector/odl-netconf-connector-all/pom.xml
features/netconf-connector/odl-netconf-connector-ssh/pom.xml
features/netconf-connector/odl-netconf-connector/pom.xml
features/netconf-connector/odl-netconf-console/pom.xml
features/netconf-connector/odl-netconf-topology/pom.xml
features/netconf-connector/pom.xml
features/netconf/features-netconf/pom.xml
features/netconf/odl-aaa-netconf-plugin-no-cluster/pom.xml
features/netconf/odl-aaa-netconf-plugin/pom.xml
features/netconf/odl-netconf-all/pom.xml
features/netconf/odl-netconf-api/pom.xml
features/netconf/odl-netconf-api/src/main/feature/feature.xml
features/netconf/odl-netconf-client/pom.xml
features/netconf/odl-netconf-impl/pom.xml
features/netconf/odl-netconf-mapping-api/pom.xml
features/netconf/odl-netconf-mdsal/pom.xml
features/netconf/odl-netconf-monitoring/pom.xml
features/netconf/odl-netconf-netty-util/pom.xml
features/netconf/odl-netconf-notifications-api/pom.xml
features/netconf/odl-netconf-notifications-impl/pom.xml
features/netconf/odl-netconf-ssh/pom.xml
features/netconf/odl-netconf-tcp/pom.xml
features/netconf/odl-netconf-util/pom.xml
features/netconf/odl-netconf-util/src/main/feature/feature.xml
features/netconf/pom.xml
features/pom.xml
features/protocol-framework/features-protocol-framework/pom.xml
features/protocol-framework/odl-protocol-framework/pom.xml
features/protocol-framework/pom.xml
features/restconf/features-restconf/pom.xml
features/restconf/odl-mdsal-apidocs/pom.xml
features/restconf/odl-restconf-all/pom.xml
features/restconf/odl-restconf-base/pom.xml
features/restconf/odl-restconf-common/pom.xml
features/restconf/odl-restconf-common/src/main/feature/feature.xml
features/restconf/odl-restconf-nb-rfc8040-all/pom.xml
features/restconf/odl-restconf-nb-rfc8040/pom.xml
features/restconf/odl-restconf-noauth/pom.xml
features/restconf/odl-restconf/pom.xml
features/restconf/pom.xml
features/yanglib/features-yanglib/pom.xml
features/yanglib/odl-yanglib/pom.xml
features/yanglib/pom.xml
karaf/pom.xml
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/CallHomeAuthorization.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannel.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallHomeAuthProviderImpl.java
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/CurrentSchemaContext.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/MdsalNetconfOperationServiceFactory.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/TransactionProvider.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/Lock.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/Unlock.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/get/AbstractGet.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/get/Get.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/get/GetConfig.java
netconf/mdsal-netconf-connector/src/test/java/org/opendaylight/netconf/mdsal/connector/ops/SchemaServiceStub.java
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducer.java
netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducerTest.java
netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/SessionNotificationProducerTest.java
netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java
netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/StreamNotificationTopicRegistration.java
netconf/models/pom.xml
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/DocumentedException.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/messages/NetconfHelloMessage.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/MissingNameSpaceException.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/UnexpectedElementException.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/UnexpectedNamespaceException.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlElement.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlUtil.java
netconf/netconf-artifacts/pom.xml
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactory.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SimpleNetconfClientSessionListener.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SshClientChannelInitializer.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/TcpClientChannelInitializer.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/TlsClientChannelInitializer.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactoryTest.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/TlsClientChannelInitializerTest.java
netconf/netconf-config/pom.xml
netconf/netconf-console/pom.xml
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfConnectDeviceCommand.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/utils/NetconfConsoleUtils.java
netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/commands/NetconfCommandsImplCallsTest.java
netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerDispatcherImpl.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSessionNegotiatorFactory.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultCloseSession.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStartExi.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStopExi.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfMonitoringServiceImpl.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfOperationRouterImpl.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfSessionMonitoringService.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/util/DeserializerExceptionHandler.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/ConcurrentClientsTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/MessageParserTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/NetconfServerSessionListenerTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/NetconfServerSessionTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringServiceTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfSessionMonitoringServiceTest.java
netconf/netconf-it/pom.xml [deleted file]
netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/AbstractNetconfConfigTest.java [deleted file]
netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfConfigPersisterITTest.java [deleted file]
netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITMonitoringTest.java [deleted file]
netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITSecureTest.java [deleted file]
netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITSecureTestTool.java [deleted file]
netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITTest.java [deleted file]
netconf/netconf-it/src/test/resources/logback-test.xml [deleted file]
netconf/netconf-it/src/test/resources/netconfMessages/editConfig_identities.xml [deleted file]
netconf/netconf-mapping-api/src/main/java/org/opendaylight/netconf/mapping/api/NetconfOperationChainedExecution.java
netconf/netconf-monitoring/src/main/java/org/opendaylight/netconf/monitoring/Get.java
netconf/netconf-monitoring/src/main/java/org/opendaylight/netconf/monitoring/osgi/NetconfMonitoringOperationService.java
netconf/netconf-monitoring/src/test/java/org/opendaylight/netconf/monitoring/GetTest.java
netconf/netconf-netty-util/pom.xml
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSession.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfEXICodec.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfEXIToMessageDecoder.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfMessageToEXIEncoder.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfMessageToXMLEncoder.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/exi/EXIParameters.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/NetconfEXIHandlersTest.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/exi/EXIParametersTest.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/exi/NetconfStartExiMessageTest.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/CreateSubscription.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/Get.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/NotificationsTransformUtil.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/osgi/Activator.java
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfSSHProvider.java
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfNorthboundTcpServer.java
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfTCPProvider.java
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServer.java
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServerHandler.java
netconf/netconf-topology-config/pom.xml
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/ProxyYangTextSourceProvider.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadAdapter.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadTransactionActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadWriteTransactionActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/WriteTransactionActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/ActorProxyTransactionFacade.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/ProxyReadWriteTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfConnectorDTO.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManagerTest.java
netconf/netconf-topology/pom.xml
netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImpl.java
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java
netconf/pom.xml
netconf/sal-netconf-connector/pom.xml
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemas.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfStateSchemas.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfDeviceCommunicator.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalProvider.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/AbstractWriteTx.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/ReadOnlyTx.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfBaseOps.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NodeContainerProxy.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/util/RemoteDeviceId.java
netconf/sal-netconf-connector/src/main/yang/netconf-node-inventory.yang [deleted file]
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDeviceTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalFacadeTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapterTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProviderTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformerTest.java
netconf/sal-netconf-connector/src/test/resources/yang-library-fail-completely.xml
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/Execution.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/MdsalOperationProvider.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/NetconfDeviceSimulator.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/ScaleUtil.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/SimulatedOperationProvider.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/AsyncExecutionStrategy.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/PerfClientCallable.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClientCallable.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/config/Configuration.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/customrpc/SettableRpc.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/operations/OperationsProvider.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCommit.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedDiscardChanges.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedEditConfig.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConfig.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedLock.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedUnLock.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpchandler/SettableRpc.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/schemacache/SchemaSourceCache.java
netconf/tools/pom.xml
netconf/yanglib/pom.xml
netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibRestApp.java
pom.xml
protocol-framework/pom.xml
protocol-framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java
protocol-framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java
restconf/pom.xml
restconf/restconf-artifacts/pom.xml
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/MultivaluedHashMap.java
restconf/restconf-models/pom.xml
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPatchBodyReader.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/PatchXmlBodyWriter.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPatchBodyReader.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/BrokerFacade.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/ControllerContext.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfProviderImpl.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractCommonSubscriber.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/EventType.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerHandler.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerInitializer.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/md/sal/rest/common/TestRestconfUtils.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/nn/test/JsonToNnTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/InvokeRpcMethodTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/JSONRestconfServiceImplTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutConfigTest.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/JsonNormalizedNodeBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlNormalizedNodeBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonToPatchBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/PatchXmlBodyWriter.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlToPatchBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/schema/SchemaExportContentYinBodyWriter.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/spi/AbstractIdentifierAwareJaxRsProvider.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040Impl.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/PutDataTransactionUtil.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/ReadDataTransactionUtil.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/wrapper/ServicesWrapper.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/EventType.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerHandler.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerInitializer.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040ImplTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/utils/mapping/RestconfMappingNodeUtilTest.java
restconf/sal-rest-connector-config/pom.xml
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/BaseYangSwaggerGenerator.java
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/mountpoints/MountPointSwagger.java
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/util/RestDocgenUtil.java
restconf/sal-rest-docgen/src/main/resources/18/explorer/index.html
restconf/sal-rest-docgen/src/main/resources/explorer/index.html
restconf/sal-restconf-broker/src/main/java/org/opendaylight/netconf/sal/restconf/broker/client/SalRemoteClientImpl.java

index 6e5eca1b67ee2d956fd0a80a627c42697f447e75..31f87b39c76287b533e5b26c61fbebef480ae174 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index e88eaafbd4538d2fecdfeba8efbce76ca29fd6c9..441900a7b60cd63a94bea33056c8fac6eb408ffb 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 6aa128681dced518f6d30aeb1d38de4ee8c16c76..3a3faaa0ca0545d0c81fa17385a5d39661cc8bc5 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 18e563c7414cbe77a8afff9e0a703c6333d250b1..69d11ba2e8a629eb297382315e4ddcb19fc681a4 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 583fe1f19f2d247a453958f83d37b1f15c9c5e8a..1baff0e1e2b7804e95403635f2537e95717ce327 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index c37f7b4a8d6dbe887e22edba279766b2b853ee9b..742cfc4be228246c1ee6962a312cdbbd20a912bb 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index cfa1193f7dd5e4341359c0433a1bb616611ce3cb..53c4f2c51cbce64323ae84718280eb0f469084af 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
 
     <dependencyManagement>
         <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.mdsal.model</groupId>
+                <artifactId>mdsal-model-artifacts</artifactId>
+                <version>0.13.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.opendaylight.controller</groupId>
+                <artifactId>mdsal-artifacts</artifactId>
+                <version>1.8.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
             <dependency>
                 <groupId>org.opendaylight.netconf</groupId>
                 <artifactId>netconf-artifacts</artifactId>
@@ -39,7 +53,6 @@
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>odl-mdsal-broker</artifactId>
-            <version>1.8.0-SNAPSHOT</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>odl-mdsal-models</artifactId>
-            <version>0.13.0-SNAPSHOT</version>
-            <type>xml</type>
-            <classifier>features</classifier>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>odl-mdsal-model-inventory</artifactId>
-            <version>1.8.0-SNAPSHOT</version>
+            <artifactId>odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index 60e106027eee13233534308d80d214523b86deba..42abcae85171de157bcd479bcfa022998c2a1d89 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 9252d0addc7cd4acc4756dbf908d513852efcaaf..454c38b77af588a812a00c13727beede5c23c940 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index ba6f8390889a453b905c7957e1e8fb77798610be..4edd6f5fee6e0876daf9bbce7a121280390d4797 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
     <groupId>org.opendaylight.netconf</groupId>
@@ -53,7 +53,7 @@
       <dependency>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-artifacts</artifactId>
-        <version>2.0.7</version>
+        <version>2.0.9</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
index a246f978656bdb55cca4a22f6c9744b34486bd12..de668e822f3f575be9fd70a543680d1c6992a59d 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index 3b53ccd8b80e8ef49d7bb35d5928ae7db6366268..a28bf0de454f3bcb466cca925ecb4385fd007936 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 9287b232bee09ed26666073615c6d7ecf2f6dedd..e2aa46d9cc2471f5e959ed668a25375258c5a33d 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 833241fbef3a8d36cae6c827058b7881903cdc9b..a10480cf0ef5f61249d09464fd20af896ecfd93a 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 0e4bb4d931cb89a0a272b6b7e31a9303d36a247a..8206666e2d35c234ad7c29042ad0773df442a2e5 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
@@ -28,7 +28,7 @@
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>2.0.7</version>
+                <version>2.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <classifier>features</classifier>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>odl-mdsal-models</artifactId>
+            <groupId>org.opendaylight.netconf</groupId>
+            <artifactId>odl-protocol-framework</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>odl-protocol-framework</artifactId>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>odl-mdsal-model-rfc7895</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
+
+
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>netconf-api</artifactId>
@@ -92,9 +94,5 @@
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>ietf-netconf-monitoring-extension</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>rfc7895</artifactId>
-        </dependency>
     </dependencies>
 </project>
index 3c32e1897b47f198735b201b24ed02364b1a3352..ea1187e057f751391632f8c769d7e0f3dd68e6e6 100644 (file)
@@ -8,6 +8,6 @@
   -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-netconf-${project.version}">
     <feature name="odl-netconf-api" version="${project.version}">
-        <feature version="[2.0.7,3)">odl-yangtools-parser-api</feature>
+        <feature version="[2.0.9,3)">odl-yangtools-parser-api</feature>
     </feature>
 </features>
index 9a04a21d6cb93357ee4d3eeb8004c76354aafe32..f89d35121f3993b45e31b8c5880c4b75d15d9b1c 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 6878e32e079291ba088fb3e2b35af3c329665082..de17fc7bca4838d0937e2b3d110871532e806599 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 3cd7ab3a29cdfa3bef936d696c67a5d565aeddb2..27315e40cc77f8001c47b7af9e092d1ded0c2b2a 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 449d90a55b5e6bfea2e146b4745a8e8ac93d166b..1e23cb3665dc56e900567d128ca850d2dfcdbfff 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 4cbf86c9e438a5f9e78972bc3646b9ff85fbb90a..352f67f395c607dbba7d2a5feb1d2139bf4d081d 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index f8f2cd5839b66c66084611031c51e52258c6e4a0..1e88d806ec07d55233c2150f37f7169f3c3e077f 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
@@ -91,7 +91,7 @@
         <dependency>
             <groupId>com.siemens.ct.exi</groupId>
             <artifactId>exificient</artifactId>
-            <version>0.9.7</version>
+            <version>1.0.1</version>
         </dependency>
     </dependencies>
 </project>
index db0a354fbddce275030c6bb1436aa9ef2d227e2a..9e244395a9d9ab781dae2a2e182bf67c099db6a2 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 329ec243925c15cc55071690ffa0e1fe98a0500c..a38b368bd1e67e62daa4835f3268664571980554 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index f83378443f1eeac9c93ae49280c9c29642a24609..b7ecd597bb45dd1d81c743806ed88fc304f83b42 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index ed22788f5936f565ae9312835b6a96a540e62493..4b739bbae94383349215588c8d68d27dd781cf00 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 914a4cdc385bd62c3fe394ee74a921b40f878c8b..d79b142b44040e0ba3e78e4b4047283057a8e2d9 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
@@ -32,7 +32,7 @@
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>odl-yangtools-codec</artifactId>
-            <version>2.0.7</version>
+            <version>2.0.9</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index e7d18d88f6104cc8a9e52c15dd706341c7a6c332..d51dce95eb44243c57f91856935957058f7a2acd 100644 (file)
@@ -11,6 +11,6 @@
         <configfile finalname="etc/netconf.cfg">
             mvn:org.opendaylight.netconf/netconf-util/${project.version}/cfg/config
         </configfile>
-        <feature version="[2.0.7,3)">odl-yangtools-codec</feature>
+        <feature version="[2.0.9,3)">odl-yangtools-codec</feature>
     </feature>
 </features>
index 6b72da290cb29a43ebc3aad43174a883cb6edcb6..8e067f171cad90e988d2a88bd1ac58f4b6d3c70f 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index 3fefe7b101956c1d537379b5cb15c790caa94822..fd4cceb267ce85863c0cbbebc0167da5cf4314d6 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index 63ed617e21b040d6fe1bd9ff4594de855ae2171a..9f399be81d67e773f103b7013156fc5bef5f7c4b 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index e62a13bffb20fd723cddbc4e4a28b4fc59e047b2..1656c6f047c1b5a1745fe8e8c00ab877b5a79936 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 88fa05af2963be125f31874c362c7dc569e7759e..b38418686568ee0eac48a42a7630984e4564700c 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 80cb728acce981698b35628845f2ffe56bd7540f..cb7586f82cae539ba4c2ed49963fc6955d0e8667 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index 9de39ef1da88ac48117dcbcf054de6f1270aec89..f58c63ec31a65c5c2c9dcc41c1a3520815cb74eb 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
@@ -27,7 +27,7 @@
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
             <artifactId>odl-jackson-2.8</artifactId>
-            <version>3.1.2</version>
+            <version>3.1.3</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index b501d63f34ff4ac24bcb2f0bbc4a2147db9809ae..9a59adb7a691378b89736474d828ea1ba3aacdee 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index f8e9f060eed9fcca215c32b33702b1f058b05695..a0b6acc41cdd297cc3838be861dc4c05b73d0812 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
 
     <dependencyManagement>
         <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.mdsal.model</groupId>
+                <artifactId>mdsal-model-artifacts</artifactId>
+                <version>0.13.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
             <dependency>
                 <groupId>org.opendaylight.netconf</groupId>
                 <artifactId>restconf-artifacts</artifactId>
     </dependencyManagement>
 
     <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>odl-mdsal-model-draft-bierman-netconf-restconf-02</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>odl-restconf-common</artifactId>
index 3d79610b1bbc0532c3bec34af1b3276e38d03d0d..9fd173c92f5979e9934c3c123ba1e454eac111e1 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
@@ -28,7 +28,7 @@
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>2.0.7</version>
+                <version>2.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
@@ -85,7 +85,7 @@
         </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>odl-mdsal-models</artifactId>
+            <artifactId>odl-mdsal-model-rfc7895</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
             <artifactId>odl-jackson-2.8</artifactId>
-            <version>3.1.2</version>
+            <version>3.1.3</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index d64323230f6ed3a3db0499fe919fcc077c31c956..3695c1014dae25d7889982b8e0a9380d34fb185e 100644 (file)
@@ -10,6 +10,6 @@
     <feature name="odl-restconf-common" version="${project.version}">
         <feature version="[3.1.0,4)">odl-karaf-feat-jetty</feature>
         <feature version="[3.1.0,4)">odl-jackson-2.8</feature>
-        <feature version="[2.0.7,3)">odl-yangtools-export</feature>
+        <feature version="[2.0.9,3)">odl-yangtools-export</feature>
     </feature>
 </features>
index caf1055f85c7bcada94b7dfe9f9fc4de37ce140e..af24283c6826c48bce9bcf0d8d42638d5a3123e4 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 6ab5c901526ccff083c63872c52368ce48fef293..771f6b0ac4423c5a04f11b197b5956cebb521d46 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.netconf</groupId>
+                <artifactId>netconf-artifacts</artifactId>
+                <version>1.5.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.netconf</groupId>
+            <artifactId>odl-netconf-api</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>restconf-nb-rfc8040</artifactId>
index 7b08360eb995d77d945393a67345031c8e9ac758..94f833c93cdb205f642e51a7920a47bb3dd9f7cf 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 15306dc1f5f69a6164131f215cb98b05b304d040..0dfd0badb2745905d6fc401e511faaa510bebf90 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 6d9f1892e3dc520367e1792858a4571cd03f0383..2082ec21ef616fc8d8677277e0030fd0c95ff218 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
     <artifactId>features-restconf-aggregator</artifactId>
index 6293b4f0f7ecb3d2f03d751e121309d69d0e179f..7303770c6560d9ce8b46323334a5bcadb285be28 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 4d6ae449bdf79d94fd6ef2d39b2a50d414b08567..4ef20bae845db5ab2223b09777bf9961e1052885 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
 
     <name>OpenDaylight :: Yanglib</name>
 
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.netconf</groupId>
+                <artifactId>netconf-artifacts</artifactId>
+                <version>1.5.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.opendaylight.netconf</groupId>
+                <artifactId>restconf-artifacts</artifactId>
+                <version>1.8.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
     <dependencies>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>yanglib</artifactId>
-            <version>1.5.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>odl-restconf</artifactId>
-            <version>1.8.0-SNAPSHOT</version>
-            <type>xml</type>
-            <classifier>features</classifier>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>odl-mdsal-models</artifactId>
-            <version>0.13.0-SNAPSHOT</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index eaced2535aecc1d50e9359b1db351f078508269d..43eebb31ac823f40774714c9a838ac918b03da21 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 41a24102c083f4249270202859d3ff86f9021b93..24fb12b73ed24b7b71febf38ad2acaa11a69313c 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>karaf4-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
   <groupId>org.opendaylight.netconf</groupId>
index 886021ed3c600d8da303fcd40201b91b42c64ef0..81d6c6fa75bedd843df58a5098bd166942295fa0 100644 (file)
@@ -165,7 +165,7 @@ public abstract class CallHomeAuthorization {
         @Override
         protected void applyTo(final ClientSession session) {
             Preconditions.checkArgument(session instanceof ClientSessionImpl);
-            ((ClientSessionImpl) session).setUsername(username);
+            session.setUsername(username);
 
             // First try authentication using server host keys, else try password.
             for (KeyPair keyPair : clientKeyPair) {
index 02b9d3d0dac2311f357b1e450ec0438fd9361c05..e18facf652d77b834f5bf674f142575b4cd0a139 100644 (file)
@@ -55,8 +55,7 @@ class MinaSshNettyChannel extends AbstractServerChannel {
     private ChannelOutboundHandlerAdapter createChannelAdapter() {
         return new ChannelOutboundHandlerAdapter() {
             @Override
-            public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise)
-                throws Exception {
+            public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise) {
                 sshWriteAsyncHandler.write(ctx, msg, promise);
             }
         };
@@ -107,7 +106,7 @@ class MinaSshNettyChannel extends AbstractServerChannel {
     }
 
     @Override
-    protected void doBind(final SocketAddress localAddress) throws Exception {
+    protected void doBind(final SocketAddress localAddress) {
         throw new UnsupportedOperationException("Bind not supported.");
     }
 
@@ -128,14 +127,14 @@ class MinaSshNettyChannel extends AbstractServerChannel {
     }
 
     @Override
-    protected void doDisconnect() throws Exception {
+    protected void doDisconnect() {
         LOG.info("Disconnect invoked");
         doNettyDisconnect();
         doMinaDisconnect(false);
     }
 
     @Override
-    protected void doClose() throws Exception {
+    protected void doClose() {
         context.removeSelf();
         if (notClosing(session)) {
             session.close(true);
@@ -144,12 +143,12 @@ class MinaSshNettyChannel extends AbstractServerChannel {
     }
 
     @Override
-    protected void doBeginRead() throws Exception {
+    protected void doBeginRead() {
         // Intentional NOOP - read is started by AsyncSshHandlerReader
     }
 
     @Override
-    protected void doWrite(final ChannelOutboundBuffer in) throws Exception {
+    protected void doWrite(final ChannelOutboundBuffer in) {
         throw new IllegalStateException("Outbound writes to SSH should be done by SSH Write handler");
     }
 
@@ -166,7 +165,7 @@ class MinaSshNettyChannel extends AbstractServerChannel {
          * Invoked when SSH session dropped during read using {@link AsyncSshHandlerReader}.
          */
         @Override
-        public void close() throws Exception {
+        public void close() {
             doNettyDisconnect();
         }
     }
index 6b88df398755205c4e82c16ef3e41b2798f3602b..a3e2db5054fdc11d84096e20cc71ed7a58004a85 100644 (file)
@@ -184,7 +184,7 @@ public class NetconfCallHomeServer implements AutoCloseable, ServerKeyVerifier {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         acceptor.close(true);
     }
 }
index 15445eb7460a39943163d5c5c1cae1b776acf607..c00bcec83b29dc2d59c65875ebeb17a69449c25d 100644 (file)
@@ -112,7 +112,7 @@ public class CallHomeAuthProviderImpl implements CallHomeAuthorizationProvider,
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         configReg.close();
         deviceReg.close();
         deviceOpReg.close();
index db43d0d39377e6cfc34a214422a52188ba3d2980..8a4979502b29b1521144d07e71fa3895c254190d 100644 (file)
@@ -314,7 +314,7 @@ class CallhomeStatusReporter implements DataTreeChangeListener<Node>, StatusReco
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         reg.close();
     }
 }
index 2d752489a14f83b34f0355acd430bd1ddb46badd..30a10cd5fa5e62b5a4bdc28ceccd426bd0dfb63c 100644 (file)
@@ -121,7 +121,7 @@ public class IetfZeroTouchCallHomeServerProvider implements AutoCloseable, DataT
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         authProvider.close();
         statusReporter.close();
 
index 165f6310c7753184fa1f34cde2675ff039199199..2c5adb41b3a31b8f0f0819497b897da6d77e70b4 100644 (file)
@@ -51,7 +51,7 @@ public class CurrentSchemaContext implements SchemaContextListener, AutoCloseabl
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         listeners1.clear();
         schemaContextListenerListenerRegistration.close();
         currentContext.set(null);
index fa1b80368cae76cfa324aa60bcc7efa251761861..b4b03355b127fe0963336b312585f0109cc641fd 100644 (file)
@@ -59,8 +59,8 @@ public class MdsalNetconfOperationServiceFactory implements NetconfOperationServ
         this.dataBroker = dataBroker;
         this.rpcService = rpcService;
 
-        this.rootSchemaSourceProviderDependency = (DOMYangTextSourceProvider) schemaService.getSupportedExtensions()
-                .get(DOMYangTextSourceProvider.class);
+        this.rootSchemaSourceProviderDependency = schemaService.getExtensions()
+                .getInstance(DOMYangTextSourceProvider.class);
         this.currentSchemaContext = new CurrentSchemaContext(Preconditions.checkNotNull(schemaService),
                 rootSchemaSourceProviderDependency);
         this.netconfOperationServiceFactoryListener = netconfOperationServiceFactoryListener;
index 768c7f2c2372b75f5e569cda775848680cbc55c4..7e2ecc8d9d9062417101aab1a94ddf07705a7f2a 100644 (file)
@@ -48,7 +48,7 @@ public class TransactionProvider implements AutoCloseable {
     }
 
     @Override
-    public synchronized void close() throws Exception {
+    public synchronized void close() {
         for (final DOMDataReadWriteTransaction rwt : allOpenReadWriteTransactions) {
             rwt.cancel();
         }
@@ -94,10 +94,10 @@ public class TransactionProvider implements AutoCloseable {
                 netconfSessionIdForReporting, e);
             final String cause = e.getCause() != null ? (" Cause: " + e.getCause().getMessage()) : "";
             throw new DocumentedException(
-                "Candidate transaction validate failed on " + e.getMessage() + " " + netconfSessionIdForReporting
-                    +  cause, e, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED, ErrorSeverity.ERROR);
+                "Candidate transaction validate failed [sessionId=" + netconfSessionIdForReporting + "]: "
+                    + e.getMessage() + cause,
+                e, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED, ErrorSeverity.ERROR);
         }
-        return;
     }
 
     public synchronized boolean commitTransaction() throws DocumentedException {
index c39c61891eb26b7265678861f73423403019b571..e1a6ff10c0fa947e7e319aaf9bb7ed03474e12d6 100644 (file)
@@ -40,7 +40,7 @@ public class Lock extends AbstractSingletonNetconfOperation {
         final Datastore targetDatastore = extractTargetParameter(operationElement);
         if (targetDatastore == Datastore.candidate) {
             LOG.debug("Locking candidate datastore on session: {}", getNetconfSessionIdForReporting());
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
         }
 
         throw new DocumentedException("Unable to lock " + targetDatastore + " datastore",
index 3b5eb3c7d55fad7122ac6edd73ae5ed59c6f4809..ed3e0b1ebc77888ec97f4174da33b84863f8b6b3 100644 (file)
@@ -39,7 +39,7 @@ public class Unlock extends AbstractSingletonNetconfOperation {
         final Datastore targetDatastore = Lock.extractTargetParameter(operationElement);
         if (targetDatastore == Datastore.candidate) {
             LOG.debug("Unlocking candidate datastore on session: {}", getNetconfSessionIdForReporting());
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
         }
 
         throw new DocumentedException("Unable to unlock " + targetDatastore + " datastore",
index 7624d1423657a4c1f9c6e65d7f161f59b8db690a..6ce25640eacac864ad1762c3de5e9420fc3a7419 100644 (file)
@@ -180,7 +180,7 @@ public abstract class AbstractGet extends AbstractSingletonNetconfOperation {
 
             return sourceElement.isPresent()
                     ? Optional.of(Datastore.valueOf(sourceElement.get().getOnlyChildElement().getName()))
-                    : Optional.<Datastore>absent();
+                    : Optional.absent();
         }
 
         private static void validateInputRpc(final XmlElement xml, final String operationName) throws
index 603e6d4d031f3dd50857373cf40a39efc8759816..2bdfcb0694dc24930563b33dfad155e1d54b69c1 100644 (file)
@@ -48,7 +48,7 @@ public class Get extends AbstractGet {
 
         final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
         if (!dataRootOptional.isPresent()) {
-            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
         }
 
         final YangInstanceIdentifier dataRoot = dataRootOptional.get();
@@ -60,7 +60,7 @@ public class Get extends AbstractGet {
             transactionProvider.abortRunningTransaction(rwTx);
 
             if (!normalizedNodeOptional.isPresent()) {
-                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.<String>absent());
+                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
             }
 
             return serializeNodeWithParentStructure(document, dataRoot, normalizedNodeOptional.get());
index 30b5079925e9eb768775a2ebd1045805e120a68d..ec3da5934a5dbe36be0341a3469146e225ab34f5 100644 (file)
@@ -57,7 +57,7 @@ public class GetConfig extends AbstractGet {
 
         final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
         if (!dataRootOptional.isPresent()) {
-            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
         }
 
         final YangInstanceIdentifier dataRoot = dataRootOptional.get();
@@ -74,7 +74,7 @@ public class GetConfig extends AbstractGet {
             }
 
             if (!normalizedNodeOptional.isPresent()) {
-                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.<String>absent());
+                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
             }
 
             return serializeNodeWithParentStructure(document, dataRoot, normalizedNodeOptional.get());
index e1780478f18313a1a7d93e402f4f9bbd627ee555..b7bee9978423ca2835177cb8b6d772208462f85d 100644 (file)
@@ -7,7 +7,10 @@
  */
 package org.opendaylight.netconf.mdsal.connector.ops;
 
+import com.google.common.collect.ClassToInstanceMap;
+import com.google.common.collect.ImmutableClassToInstanceMap;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaServiceExtension;
 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@ -41,4 +44,9 @@ final class SchemaServiceStub implements DOMSchemaService {
             }
         };
     }
+
+    @Override
+    public ClassToInstanceMap<DOMSchemaServiceExtension> getExtensions() {
+        return ImmutableClassToInstanceMap.of();
+    }
 }
index 8fab4c84fe102f73eb39112c806e330939e7cb9e..b3c6c97ea78c7fe30460c86a8705a2a040399dbc 100644 (file)
@@ -93,7 +93,7 @@ public final class CapabilityChangeNotificationProducer extends OperationalDatas
         netconfCapabilityChangeBuilder.setAddedCapability(ImmutableList.copyOf(added));
         netconfCapabilityChangeBuilder.setDeletedCapability(ImmutableList.copyOf(removed));
         // TODO modified should be computed ... but why ?
-        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.<Uri>emptyList());
+        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.emptyList());
         baseNotificationPublisherRegistration.onCapabilityChanged(netconfCapabilityChangeBuilder.build());
     }
 
index 5652af80ce7945a6114d5f25fe389903724a5ef0..b387c89e2e9b4976329af16712d8843c6b7a7b6c 100644 (file)
@@ -82,7 +82,7 @@ public class CapabilityChangeNotificationProducerTest {
         Map<InstanceIdentifier<?>, DataObject> createdData = Maps.newHashMap();
         createdData.put(capabilitiesIdentifier, newCapabilities);
         verifyDataTreeChange(DataObjectModification.ModificationType.WRITE, null, newCapabilities,
-                changedCapabilitesFrom(newCapabilitiesList, Collections.<Uri>emptyList()));
+                changedCapabilitesFrom(newCapabilitiesList, Collections.emptyList()));
     }
 
     @Test
@@ -128,7 +128,7 @@ public class CapabilityChangeNotificationProducerTest {
         netconfCapabilityChangeBuilder.setChangedBy(new ChangedByBuilder().setServerOrUser(
                 new ServerBuilder().setServer(true).build()).build());
 
-        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.<Uri>emptyList());
+        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.emptyList());
         netconfCapabilityChangeBuilder.setAddedCapability(added);
         netconfCapabilityChangeBuilder.setDeletedCapability(deleted);
 
index aa83c680ff8f4ebdc63af1b89961e0ae6d2296e3..5a647b4a6f4916e1acfb96e605e69567e0093134 100644 (file)
@@ -23,12 +23,13 @@ import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
+import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
 import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.HostBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.SessionBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfCapabilityChange;
@@ -74,8 +75,7 @@ public class SessionNotificationProducerTest {
     @Test
     public void testOnDataChangedSessionCreated() throws Exception {
         final Session session = createSession(1);
-        final DataTreeModification<Session> treeChange = getTreeModification(session, DataObjectModification
-                .ModificationType.WRITE);
+        final DataTreeModification<Session> treeChange = getTreeModification(session, ModificationType.WRITE);
         publisher.onDataTreeChanged(Collections.singleton(treeChange));
         ArgumentCaptor<NetconfSessionStart> captor = ArgumentCaptor.forClass(NetconfSessionStart.class);
         verify(registration).onSessionStarted(captor.capture());
@@ -93,7 +93,7 @@ public class SessionNotificationProducerTest {
         final Session sessionAfter = createSessionWithInRpcCount(1, 1);
         doReturn(sessionBefore).when(changeObject).getDataBefore();
         doReturn(sessionAfter).when(changeObject).getDataAfter();
-        doReturn(DataObjectModification.ModificationType.WRITE).when(changeObject).getModificationType();
+        doReturn(ModificationType.WRITE).when(changeObject).getModificationType();
         doReturn(changeObject).when(treeChange).getRootNode();
         publisher.onDataTreeChanged(Collections.singleton(treeChange));
         //session didn't start, only stats changed. No notification should be produced
@@ -104,8 +104,7 @@ public class SessionNotificationProducerTest {
     @Test
     public void testOnDataChangedSessionDeleted() throws Exception {
         final Session session = createSession(1);
-        final DataTreeModification<Session> data = getTreeModification(session, DataObjectModification
-                .ModificationType.DELETE);
+        final DataTreeModification<Session> data = getTreeModification(session, ModificationType.DELETE);
         publisher.onDataTreeChanged(Collections.singleton(data));
         ArgumentCaptor<NetconfSessionEnd> captor = ArgumentCaptor.forClass(NetconfSessionEnd.class);
         verify(registration).onSessionEnded(captor.capture());
@@ -115,22 +114,21 @@ public class SessionNotificationProducerTest {
         Assert.assertEquals(session.getUsername(), value.getUsername());
     }
 
-    private Session createSession(long id) {
+    private static Session createSession(long id) {
         return createSessionWithInRpcCount(id, 0);
     }
 
-    private Session createSessionWithInRpcCount(long id, long inRpc) {
+    private static Session createSessionWithInRpcCount(long id, long inRpc) {
         return new SessionBuilder()
                 .setSessionId(id)
-                .setSourceHost(new Host("0.0.0.0".toCharArray()))
+                .setSourceHost(HostBuilder.getDefaultInstance("0.0.0.0"))
                 .setUsername("user")
                 .setInRpcs(new ZeroBasedCounter32(inRpc))
                 .build();
     }
 
     @SuppressWarnings("unchecked")
-    private DataTreeModification<Session> getTreeModification(Session session, DataObjectModification
-            .ModificationType type) {
+    private static DataTreeModification<Session> getTreeModification(Session session, ModificationType type) {
         final DataTreeModification<Session> treeChange = mock(DataTreeModification.class);
         final DataObjectModification<Session> changeObject = mock(DataObjectModification.class);
         switch (type) {
index 69296ffe1c661986cd099272c477179a08c98b43..5fe60f91ff9c3d2201dea3d21dd68884fe5d60ed 100644 (file)
@@ -58,7 +58,7 @@ public class SchemaServiceToMdsalWriter implements SchemaContextListener, AutoCl
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         // TODO Delete modules-state from operational data store
     }
 
index a77dbdc2e13b9a2fafe45b8d31a90b510209ec1e..01966c207262489f2ad7761586685ea73b522e58 100644 (file)
@@ -160,7 +160,7 @@ class StreamNotificationTopicRegistration extends NotificationTopicRegistration
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         closeStream();
     }
 
index 513399998c95d2fb2338a588298d13744cd2b195..d3bd805f41a15d0a1e3bbf7bce20e5b2a4c5dd14 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index ec6b0606e932225aba41be86763b411a7bcf5a2f..15d4dfe443882b280f9a6f83db4d4db93b3ea9d5 100644 (file)
@@ -169,7 +169,7 @@ public class DocumentedException extends Exception {
 
     public DocumentedException(final String message, final ErrorType errorType, final ErrorTag errorTag,
             final ErrorSeverity errorSeverity) {
-        this(message, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public DocumentedException(final String message, final ErrorType errorType, final ErrorTag errorTag,
@@ -183,7 +183,7 @@ public class DocumentedException extends Exception {
 
     public DocumentedException(final String message, final Exception cause, final ErrorType errorType,
             final ErrorTag errorTag, final ErrorSeverity errorSeverity) {
-        this(message, cause, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, cause, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public DocumentedException(final String message, final Exception cause, final ErrorType errorType,
index 52ec7e1078ea74c84023100cf9e17688f74aa30c..349a57a64d2aa90badc498de134ec9705cb9f229 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.api.messages;
 import com.google.common.base.Optional;
 import com.google.common.collect.Sets;
 import java.util.Set;
-import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
@@ -31,14 +30,13 @@ public final class NetconfHelloMessage extends NetconfMessage {
 
     private final NetconfHelloMessageAdditionalHeader additionalHeader;
 
-    public NetconfHelloMessage(final Document doc, final NetconfHelloMessageAdditionalHeader additionalHeader)
-            throws NetconfDocumentedException {
+    public NetconfHelloMessage(final Document doc, final NetconfHelloMessageAdditionalHeader additionalHeader) {
         super(doc);
         checkHelloMessage(doc);
         this.additionalHeader = additionalHeader;
     }
 
-    public NetconfHelloMessage(final Document doc) throws NetconfDocumentedException {
+    public NetconfHelloMessage(final Document doc) {
         this(doc, null);
     }
 
@@ -55,8 +53,7 @@ public final class NetconfHelloMessage extends NetconfMessage {
     }
 
     public static NetconfHelloMessage createClientHello(final Iterable<String> capabilities,
-            final Optional<NetconfHelloMessageAdditionalHeader> additionalHeaderOptional)
-                    throws NetconfDocumentedException {
+            final Optional<NetconfHelloMessageAdditionalHeader> additionalHeaderOptional) {
         return new NetconfHelloMessage(createHelloMessageDoc(capabilities), additionalHeaderOptional.orNull());
     }
 
@@ -80,8 +77,7 @@ public final class NetconfHelloMessage extends NetconfMessage {
         return doc;
     }
 
-    public static NetconfHelloMessage createServerHello(final Set<String> capabilities, final long sessionId)
-            throws NetconfDocumentedException {
+    public static NetconfHelloMessage createServerHello(final Set<String> capabilities, final long sessionId) {
         Document doc = createHelloMessageDoc(capabilities);
         Element sessionIdElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0,
                 XmlNetconfConstants.SESSION_ID);
index d5ab5d0648b89af1ac8f96a1cb3b633b15f21daa..2f30154b93a3ffe1523a0e69a6f8e1785eecb307 100644 (file)
@@ -16,7 +16,7 @@ public class MissingNameSpaceException extends DocumentedException {
 
     public MissingNameSpaceException(final String message, final DocumentedException.ErrorType errorType,
             final DocumentedException.ErrorTag errorTag, final DocumentedException.ErrorSeverity errorSeverity) {
-        this(message, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public MissingNameSpaceException(final String message, final DocumentedException.ErrorType errorType,
index ec31b9e6150516de6ed9f2d0fbbab3038af779bd..f6eda4930a7db9977428e7c982c70f5e65cd66b1 100644 (file)
@@ -16,7 +16,7 @@ public class UnexpectedElementException extends DocumentedException {
 
     public UnexpectedElementException(final String message, final DocumentedException.ErrorType errorType,
             final DocumentedException.ErrorTag errorTag, final DocumentedException.ErrorSeverity errorSeverity) {
-        this(message, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public UnexpectedElementException(final String message, final DocumentedException.ErrorType errorType,
index 4152e261b3bd9e3d0a875bbb946069d0cca282ea..95e09a768a384b130f8135273c1cd00220eb40c7 100644 (file)
@@ -16,7 +16,7 @@ public class UnexpectedNamespaceException extends DocumentedException {
 
     public UnexpectedNamespaceException(final String message, final DocumentedException.ErrorType errorType,
             final DocumentedException.ErrorTag errorTag, final DocumentedException.ErrorSeverity errorSeverity) {
-        this(message, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public UnexpectedNamespaceException(final String message, final DocumentedException.ErrorType errorType,
index ad90fb3cb2d9ff20a21bbd614de82949b1863da5..9b0f5e3af7293d03fe752197e112be0a3155bfab 100644 (file)
@@ -470,7 +470,7 @@ public final class XmlElement {
     }
 
     public void checkUnrecognisedElements(final XmlElement... additionalRecognisedElements) throws DocumentedException {
-        checkUnrecognisedElements(Collections.<XmlElement>emptyList(), additionalRecognisedElements);
+        checkUnrecognisedElements(Collections.emptyList(), additionalRecognisedElements);
     }
 
     @Override
index a080889aee4352a7297fa0f17ee2a57d3e585dfb..d6d9f82f8a0f911ab1e0a6e4ce22f88474ee3391 100644 (file)
@@ -145,7 +145,7 @@ public final class XmlUtil {
             final String prefix, final String namespace, final String contentWithoutPrefix) {
 
         return createTextElementWithNamespacedContent(document, qname, prefix, namespace, contentWithoutPrefix,
-                Optional.<String>absent());
+                Optional.absent());
     }
 
     public static Element createTextElementWithNamespacedContent(final Document document, final String qname,
index 94338ba903cb2f9de8a4b07e7d60c7f3850bc532..f8fdbdab7fa2623a205c41e9a7faf5a76ff00a5b 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
       <groupId>org.opendaylight.odlparent</groupId>
       <artifactId>odlparent-lite</artifactId>
-      <version>3.1.2</version>
+      <version>3.1.3</version>
       <relativePath/>
     </parent>
 
index 69dc1059b5535f8914c95c966b69e9ccaa451b68..1816fee0e041f119c0b545e37e4bf21055b2c585 100644 (file)
@@ -154,7 +154,7 @@ public class NetconfClientSessionNegotiator extends
 
     @Override
     protected NetconfClientSession getSession(final NetconfClientSessionListener sessionListener, final Channel channel,
-                                              final NetconfHelloMessage message) throws NetconfDocumentedException {
+                                              final NetconfHelloMessage message) {
         final long sessionId = extractSessionId(message.getDocument());
 
         // Copy here is important: it disconnects the strings from the document
index 8123e5999e04e424c92418b3291e240483100889..d6cc5b18c75518eb152aa77a578987f337b2d199 100644 (file)
@@ -5,21 +5,20 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.client;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
-import com.siemens.ct.exi.CodingMode;
-import com.siemens.ct.exi.FidelityOptions;
-import com.siemens.ct.exi.exceptions.UnsupportedOption;
+import com.siemens.ct.exi.core.CodingMode;
+import com.siemens.ct.exi.core.FidelityOptions;
+import com.siemens.ct.exi.core.exceptions.UnsupportedOption;
 import io.netty.channel.Channel;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
 import java.util.Set;
 import org.opendaylight.netconf.api.NetconfClientSessionPreferences;
-import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
@@ -55,11 +54,6 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
     private static final String START_EXI_MESSAGE_ID = "default-start-exi";
     private static final EXIParameters DEFAULT_OPTIONS;
 
-    private final Optional<NetconfHelloMessageAdditionalHeader> additionalHeader;
-    private final long connectionTimeoutMillis;
-    private final Timer timer;
-    private final EXIParameters options;
-
     static {
         final FidelityOptions fidelity = FidelityOptions.createDefault();
         try {
@@ -73,7 +67,11 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
         DEFAULT_OPTIONS = new EXIParameters(CodingMode.BYTE_PACKED, fidelity);
     }
 
+    private final Optional<NetconfHelloMessageAdditionalHeader> additionalHeader;
     private final Set<String> clientCapabilities;
+    private final long connectionTimeoutMillis;
+    private final Timer timer;
+    private final EXIParameters options;
 
     public NetconfClientSessionNegotiatorFactory(final Timer timer,
                                                  final Optional<NetconfHelloMessageAdditionalHeader> additionalHeader,
@@ -98,7 +96,7 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
                                                  final Optional<NetconfHelloMessageAdditionalHeader> additionalHeader,
                                                  final long connectionTimeoutMillis, final EXIParameters exiOptions,
                                                  final Set<String> capabilities) {
-        this.timer = Preconditions.checkNotNull(timer);
+        this.timer = requireNonNull(timer);
         this.additionalHeader = additionalHeader;
         this.connectionTimeoutMillis = connectionTimeoutMillis;
         this.options = exiOptions;
@@ -111,14 +109,7 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
             final Channel channel, final Promise<NetconfClientSession> promise) {
 
         NetconfMessage startExiMessage = NetconfStartExiMessage.create(options, START_EXI_MESSAGE_ID);
-        NetconfHelloMessage helloMessage = null;
-        try {
-            helloMessage = NetconfHelloMessage.createClientHello(clientCapabilities, additionalHeader);
-        } catch (NetconfDocumentedException e) {
-            LOG.error("Unable to create client hello message with capabilities {} and additional handler {}",
-                    clientCapabilities, additionalHeader);
-            throw new IllegalStateException(e);
-        }
+        NetconfHelloMessage helloMessage = NetconfHelloMessage.createClientHello(clientCapabilities, additionalHeader);
 
         NetconfClientSessionPreferences proposal = new NetconfClientSessionPreferences(helloMessage, startExiMessage);
         return new NetconfClientSessionNegotiator(proposal, promise, channel, timer,
index 26f33152dac04473d3c065f1dcab9694ffae8ca2..ce1e5ef0a0541af78a131324987fc36f76a91cc4 100644 (file)
@@ -103,7 +103,7 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
     }
 
     public final synchronized Future<NetconfMessage> sendRequest(NetconfMessage message) {
-        final RequestEntry req = new RequestEntry(GlobalEventExecutor.INSTANCE.<NetconfMessage>newPromise(), message);
+        final RequestEntry req = new RequestEntry(GlobalEventExecutor.INSTANCE.newPromise(), message);
 
         requests.add(req);
         if (clientSession != null) {
index 9adf79cef1d404860ce8bc5cbfd2f5c00b67f3aa..37211c9a791e7fec105335e2a55f3b115f01e9cb 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.netconf.client;
 
 import io.netty.channel.Channel;
 import io.netty.util.concurrent.Promise;
-import java.io.IOException;
 import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
 import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandler;
@@ -30,13 +29,9 @@ final class SshClientChannelInitializer extends AbstractChannelInitializer<Netco
 
     @Override
     public void initialize(final Channel ch, final Promise<NetconfClientSession> promise) {
-        try {
-            // ssh handler has to be the first handler in pipeline
-            ch.pipeline().addFirst(AsyncSshHandler.createForNetconfSubsystem(authenticationHandler, promise));
-            super.initialize(ch, promise);
-        } catch (final IOException e) {
-            throw new RuntimeException(e);
-        }
+        // ssh handler has to be the first handler in pipeline
+        ch.pipeline().addFirst(AsyncSshHandler.createForNetconfSubsystem(authenticationHandler, promise));
+        super.initialize(ch, promise);
     }
 
     @Override
index 5f25800b4b0c595137485c78fc0bc095c1114e82..c241e17656736052b4cbe3bf48012c8891e02ea4 100644 (file)
@@ -43,7 +43,7 @@ class TcpClientChannelInitializer extends AbstractChannelInitializer<NetconfClie
             @Override
             public void connect(final ChannelHandlerContext ctx, final SocketAddress remoteAddress,
                                 final SocketAddress localAddress,
-                                final ChannelPromise channelPromise) throws Exception {
+                                final ChannelPromise channelPromise) {
                 connectPromise = channelPromise;
                 ChannelPromise tcpConnectFuture = new DefaultChannelPromise(ch);
 
index 27e751fc3d66573f1c1c06a6a21ac3ed98e4285f..5441bdcd268a455ae38290df53b2d2d9ed2ee116 100644 (file)
@@ -52,7 +52,7 @@ final class TlsClientChannelInitializer extends AbstractChannelInitializer<Netco
         }
 
         @Override
-        public void channelActive(ChannelHandlerContext ctx) throws Exception {
+        public void channelActive(ChannelHandlerContext ctx) {
             ctx.pipeline().replace(this, "sslHandler", sslHandlerFactory.createSslHandler())
                           .fireChannelActive();
         }
index 718c67b7989106cd2fe2220a5c836812d243ac08..ca9eb2cefe38558209839386acc7e8058adf073c 100644 (file)
@@ -18,7 +18,6 @@ import io.netty.util.HashedWheelTimer;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
 import org.junit.Test;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 
@@ -33,7 +32,7 @@ public class NetconfClientSessionNegotiatorFactoryTest {
         Channel channel = mock(Channel.class);
         Promise<NetconfClientSession> promise = mock(Promise.class);
         NetconfClientSessionNegotiatorFactory negotiatorFactory = new NetconfClientSessionNegotiatorFactory(timer,
-                Optional.<NetconfHelloMessageAdditionalHeader>absent(), 200L);
+                Optional.absent(), 200L);
 
         SessionNegotiator<?> sessionNegotiator = negotiatorFactory.getSessionNegotiator(listenerFactory, channel,
                 promise);
index 0edc9550aa27c6e0bba0059460ad2e4f75b820a5..03ef147e7b8a92d4f23fd4ee7cda63baeee3d211 100644 (file)
@@ -18,7 +18,6 @@ import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
 import io.netty.util.concurrent.Promise;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
index dfe93f575eca31d37672d386d91b5f88818d2729..c9b1c5a173cd0d612f93e80fb0655c3f3e8e2131 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index b1b77b1da01213a884d4e41c90c9c9438e85e368..bd430b18e7c3284e5bb2323416ecb5fe44b99364 100644 (file)
@@ -40,27 +40,24 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
           <scope>test</scope>
       </dependency>
       <dependency>
-          <groupId>org.powermock</groupId>
-          <artifactId>powermock-module-junit4</artifactId>
-          <scope>test</scope>
+          <groupId>org.opendaylight.yangtools</groupId>
+          <artifactId>yang-test-util</artifactId>
       </dependency>
       <dependency>
-          <groupId>org.powermock</groupId>
-          <artifactId>powermock-api-mockito</artifactId>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-binding-broker-impl</artifactId>
           <scope>test</scope>
       </dependency>
-      <dependency>
-          <groupId>org.powermock</groupId>
-          <artifactId>powermock-core</artifactId>
-      </dependency>
-      <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-test-util</artifactId>
-      </dependency>
       <dependency>
           <groupId>org.opendaylight.controller</groupId>
           <artifactId>sal-binding-broker-impl</artifactId>
           <scope>test</scope>
-    </dependency>
+          <type>test-jar</type>
+      </dependency>
+      <dependency>
+          <groupId>org.awaitility</groupId>
+          <artifactId>awaitility</artifactId>
+          <scope>test</scope>
+      </dependency>
   </dependencies>
 </project>
index 88186de9cc62cb0961a3c5b3fee4ed5d97931605..cedb5db57652cea52398c41ce62acef831caed53 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.netconf.console.commands;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Strings;
 import java.util.Arrays;
@@ -44,6 +46,16 @@ public class NetconfConnectDeviceCommand implements Action {
         this.devicePort = devicePort;
     }
 
+    @VisibleForTesting
+    NetconfConnectDeviceCommand(final NetconfCommands service, final String deviceIp, final String devicePort,
+            final String username, final String password) {
+        this.service = requireNonNull(service);
+        this.deviceIp = requireNonNull(deviceIp);
+        this.devicePort = requireNonNull(devicePort);
+        this.username = requireNonNull(username);
+        this.password = requireNonNull(password);
+    }
+
     @Option(name = "-i",
             aliases = { "--ipaddress" },
             description = "IP address of the netconf device",
index c967413884f45552c25f23c8ee2f11220742117c..38a2aa266402d7efc8b8ced90f5e374d0abea58c 100644 (file)
@@ -99,18 +99,6 @@ public final class NetconfConsoleUtils {
         return topology != null && topology.getNode() != null && !topology.getNode().isEmpty();
     }
 
-    /**
-     * Wait for datastore to populate NETCONF data.
-     * @param deviceIp :IP address of NETCONF device
-     */
-    public static void waitForUpdate(final String deviceIp) {
-        try {
-            Thread.sleep(NetconfConsoleConstants.DEFAULT_TIMEOUT_MILLIS);
-        } catch (final InterruptedException e) {
-            LOG.warn("Interrupted while waiting after Netconf node {}", deviceIp, e);
-        }
-    }
-
     /**
      * Blocking read transaction.
      * @param store :DatastoreType
index f0e0af565d4935c45c077279e25396bfe33d2fab..2ceb0668080de191c7555eb26341f4698dcb16c5 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netconf.console.commands;
 
 import static junit.framework.TestCase.assertEquals;
 import static junit.framework.TestCase.assertTrue;
-import static org.mockito.BDDMockito.given;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.doNothing;
@@ -19,24 +18,17 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.MockitoAnnotations.initMocks;
 
-import com.google.common.base.Strings;
-import com.google.common.collect.Lists;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.opendaylight.netconf.console.api.NetconfCommands;
 import org.opendaylight.netconf.console.utils.NetconfConsoleConstants;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
 
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(Strings.class)
 public class NetconfCommandsImplCallsTest {
 
     @Mock
@@ -54,10 +46,9 @@ public class NetconfCommandsImplCallsTest {
         netconfConnectDeviceCommand.execute();
         verify(netconfCommands, times(0)).connectDevice(any(), any());
 
-        netconfConnectDeviceCommand = new NetconfConnectDeviceCommand(netconfCommands, "192.168.1.1", "7777");
+        netconfConnectDeviceCommand = new NetconfConnectDeviceCommand(netconfCommands, "192.168.1.1", "7777", "user",
+            "pass");
 
-        PowerMockito.mockStatic(Strings.class);
-        given(Strings.isNullOrEmpty(any())).willReturn(false);
         netconfConnectDeviceCommand.execute();
         doNothing().when(netconfCommands).connectDevice(any(), any());
         verify(netconfCommands, times(1)).connectDevice(any(), any());
@@ -141,10 +132,10 @@ public class NetconfCommandsImplCallsTest {
     private static HashMap<String, Map<String, List<String>>> getDeviceHashMap() {
         final HashMap<String, Map<String, List<String>>> devices = new HashMap<>();
         final HashMap<String, List<String>> deviceMap = new HashMap<>();
-        deviceMap.put(NetconfConsoleConstants.NETCONF_IP, Lists.newArrayList("192.168.1.1"));
-        deviceMap.put(NetconfConsoleConstants.NETCONF_PORT, Lists.newArrayList("7777"));
-        deviceMap.put(NetconfConsoleConstants.STATUS, Lists.newArrayList("connecting"));
-        deviceMap.put(NetconfConsoleConstants.AVAILABLE_CAPABILITIES, Lists.newArrayList("cap1", "cap2", "cap3"));
+        deviceMap.put(NetconfConsoleConstants.NETCONF_IP, Arrays.asList("192.168.1.1"));
+        deviceMap.put(NetconfConsoleConstants.NETCONF_PORT, Arrays.asList("7777"));
+        deviceMap.put(NetconfConsoleConstants.STATUS, Arrays.asList("connecting"));
+        deviceMap.put(NetconfConsoleConstants.AVAILABLE_CAPABILITIES, Arrays.asList("cap1", "cap2", "cap3"));
         devices.put("device", deviceMap);
         return devices;
     }
index 89ce7718b52f9db6b21fce792702080774eacaab..d98900560499f9236aa0a58e635595da2b8775a5 100644 (file)
@@ -15,9 +15,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
 import com.google.common.collect.ImmutableList;
-import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
-import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -25,26 +23,13 @@ import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import javassist.ClassPool;
+import org.awaitility.Awaitility;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.controller.md.sal.binding.test.ConcurrentDataBrokerTestCustomizer;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
-import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
-import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
-import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.netconf.console.utils.NetconfConsoleConstants;
 import org.opendaylight.netconf.console.utils.NetconfConsoleUtils;
 import org.opendaylight.netconf.console.utils.NetconfIidFactory;
@@ -67,10 +52,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
-import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 public class NetconfCommandsImplTest {
@@ -92,30 +74,10 @@ public class NetconfCommandsImplTest {
             "/schemas/network-topology@2013-10-21.yang", "/schemas/ietf-inet-types@2013-07-15.yang",
             "/schemas/yang-ext.yang", "/schemas/netconf-node-topology.yang");
         schemaContext.getModules();
-        final DOMSchemaService schemaService = createSchemaService();
 
-        final DOMStore operStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", schemaService);
-        final DOMStore configStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", schemaService);
-
-        final EnumMap<LogicalDatastoreType, DOMStore> datastores = new EnumMap<>(LogicalDatastoreType.class);
-        datastores.put(LogicalDatastoreType.CONFIGURATION, configStore);
-        datastores.put(LogicalDatastoreType.OPERATIONAL, operStore);
-
-        final DOMDataBroker domDataBroker =
-                new SerializedDOMDataBroker(datastores, MoreExecutors.newDirectExecutorService());
-
-        final ClassPool pool = ClassPool.getDefault();
-        final DataObjectSerializerGenerator generator = StreamWriterGenerator.create(JavassistUtils.forClassPool(pool));
-        final BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(generator);
-        final ModuleInfoBackedContext moduleInfoBackedContext = ModuleInfoBackedContext.create();
-        codecRegistry
-                .onBindingRuntimeContextUpdated(BindingRuntimeContext.create(moduleInfoBackedContext, schemaContext));
-
-        final GeneratedClassLoadingStrategy loading = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
-        final BindingToNormalizedNodeCodec bindingToNormalized =
-                new BindingToNormalizedNodeCodec(loading, codecRegistry);
-        bindingToNormalized.onGlobalContextUpdated(schemaContext);
-        dataBroker = new BindingDOMDataBrokerAdapter(domDataBroker, bindingToNormalized);
+        ConcurrentDataBrokerTestCustomizer customizer = new ConcurrentDataBrokerTestCustomizer(true);
+        dataBroker = customizer.createDataBroker();
+        customizer.updateSchema(schemaContext);
 
         netconfCommands = new NetconfCommandsImpl(dataBroker);
     }
@@ -160,33 +122,42 @@ public class NetconfCommandsImplTest {
 
         createTopology(LogicalDatastoreType.CONFIGURATION);
         netconfCommands.connectDevice(netconfNode, "netconf-ID");
-        NetconfConsoleUtils.waitForUpdate("10.10.1.1");
 
-        final Topology topology = NetconfConsoleUtils.read(LogicalDatastoreType.CONFIGURATION,
-                NetconfIidFactory.NETCONF_TOPOLOGY_IID, dataBroker);
-        final List<Node> nodes = topology.getNode();
-        assertEquals(2, nodes.size());
+        Awaitility.await().atMost(5, TimeUnit.SECONDS).until(() -> {
+            final Topology topology = NetconfConsoleUtils.read(LogicalDatastoreType.CONFIGURATION,
+                    NetconfIidFactory.NETCONF_TOPOLOGY_IID, dataBroker);
+            final List<Node> nodes = topology.getNode();
+            if (nodes.size() != 2) {
+                return false;
+            }
 
-        final Optional<Node> storedNode = nodes.stream().filter(node ->
-                node.key().getNodeId().getValue().equals("netconf-ID")).findFirst();
+            final Optional<Node> storedNode = nodes.stream().filter(node ->
+                    node.key().getNodeId().getValue().equals("netconf-ID")).findFirst();
 
-        assertTrue(storedNode.isPresent());
+            assertTrue(storedNode.isPresent());
 
-        NetconfNode storedNetconfNode = storedNode.get().augmentation(NetconfNode.class);
-        assertEquals(7777, storedNetconfNode.getPort().getValue().longValue());
-        assertEquals("10.10.1.1", storedNetconfNode.getHost().getIpAddress().getIpv4Address().getValue());
+            NetconfNode storedNetconfNode = storedNode.get().augmentation(NetconfNode.class);
+            assertEquals(7777, storedNetconfNode.getPort().getValue().longValue());
+            assertEquals("10.10.1.1", storedNetconfNode.getHost().getIpAddress().getIpv4Address().getValue());
+            return true;
+        });
 
         netconfCommands.disconnectDevice("netconf-ID");
 
-        final Topology topologyDeleted = NetconfConsoleUtils.read(LogicalDatastoreType.CONFIGURATION,
-                NetconfIidFactory.NETCONF_TOPOLOGY_IID, dataBroker);
-        final List<Node> nodesDeleted = topologyDeleted.getNode();
-        assertEquals(1, nodesDeleted.size());
+        Awaitility.await().atMost(5, TimeUnit.SECONDS).until(() -> {
+            final Topology topologyDeleted = NetconfConsoleUtils.read(LogicalDatastoreType.CONFIGURATION,
+                    NetconfIidFactory.NETCONF_TOPOLOGY_IID, dataBroker);
+            final List<Node> nodesDeleted = topologyDeleted.getNode();
+            if (nodesDeleted.size() != 1) {
+                return false;
+            }
 
-        final Optional<Node> storedNodeDeleted = nodesDeleted.stream().filter(node ->
-                node.key().getNodeId().getValue().equals("netconf-ID")).findFirst();
+            final Optional<Node> storedNodeDeleted = nodesDeleted.stream().filter(node ->
+                    node.key().getNodeId().getValue().equals("netconf-ID")).findFirst();
 
-        assertFalse(storedNodeDeleted.isPresent());
+            assertFalse(storedNodeDeleted.isPresent());
+            return true;
+        });
     }
 
     @Test
@@ -201,19 +172,23 @@ public class NetconfCommandsImplTest {
         update.put(NetconfConsoleConstants.SCHEMALESS, "true");
 
         netconfCommands.updateDevice(NODE_ID, "admin", "admin", update);
-        NetconfConsoleUtils.waitForUpdate("7.7.7.7");
 
-        final Topology topology = NetconfConsoleUtils.read(LogicalDatastoreType.CONFIGURATION,
-                NetconfIidFactory.NETCONF_TOPOLOGY_IID, dataBroker);
-        final List<Node> nodes = topology.getNode();
-        assertEquals(1, nodes.size());
+        Awaitility.await().atMost(5, TimeUnit.SECONDS).until(() -> {
+            final Topology topology = NetconfConsoleUtils.read(LogicalDatastoreType.CONFIGURATION,
+                    NetconfIidFactory.NETCONF_TOPOLOGY_IID, dataBroker);
+            final List<Node> nodes = topology.getNode();
+            if (nodes.size() != 1) {
+                return false;
+            }
 
-        final Optional<Node> storedNode = nodes.stream().filter(node ->
-                node.key().getNodeId().getValue().equals(NODE_ID)).findFirst();
-        assertTrue(storedNode.isPresent());
+            final Optional<Node> storedNode = nodes.stream().filter(node ->
+                    node.key().getNodeId().getValue().equals(NODE_ID)).findFirst();
+            assertTrue(storedNode.isPresent());
 
-        NetconfNode storedNetconfNode = storedNode.get().augmentation(NetconfNode.class);
-        assertEquals("7.7.7.7", storedNetconfNode.getHost().getIpAddress().getIpv4Address().getValue());
+            NetconfNode storedNetconfNode = storedNode.get().augmentation(NetconfNode.class);
+            assertEquals("7.7.7.7", storedNetconfNode.getHost().getIpAddress().getIpv4Address().getValue());
+            return true;
+        });
     }
 
     @Test
@@ -288,32 +263,4 @@ public class NetconfCommandsImplTest {
         assertEquals(ImmutableList.of(String.valueOf(PORT)), mapNode.get(NetconfConsoleConstants.NETCONF_PORT));
         assertEquals(ImmutableList.of(CONN_STATUS.name()), mapNode.get(NetconfConsoleConstants.STATUS));
     }
-
-    private DOMSchemaService createSchemaService() {
-        return new DOMSchemaService() {
-
-            @Override
-            public SchemaContext getSessionContext() {
-                return schemaContext;
-            }
-
-            @Override
-            public SchemaContext getGlobalContext() {
-                return schemaContext;
-            }
-
-            @Override
-            public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
-                    final SchemaContextListener listener) {
-                listener.onGlobalContextUpdated(getGlobalContext());
-                return new AbstractListenerRegistration<SchemaContextListener>(listener) {
-
-                    @Override
-                    protected void removeRegistration() {
-                        // No-op
-                    }
-                };
-            }
-        };
-    }
 }
index 7db8db4f09abcae7d37f6f96d3c887c039d18103..394771b122691f54f1d93648074bc3cf57820709 100644 (file)
@@ -12,9 +12,7 @@ import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.local.LocalAddress;
-import io.netty.channel.local.LocalChannel;
 import io.netty.channel.local.LocalServerChannel;
-import io.netty.channel.socket.SocketChannel;
 import io.netty.util.concurrent.Promise;
 import java.net.InetSocketAddress;
 import org.opendaylight.netconf.api.NetconfServerDispatcher;
@@ -35,23 +33,12 @@ public class NetconfServerDispatcherImpl extends AbstractDispatcher<NetconfServe
 
     @Override
     public ChannelFuture createServer(InetSocketAddress address) {
-        return super.createServer(address, new PipelineInitializer<NetconfServerSession>() {
-            @Override
-            public void initializeChannel(final SocketChannel ch, final Promise<NetconfServerSession> promise) {
-                initializer.initialize(ch, promise);
-            }
-        });
+        return super.createServer(address, initializer::initialize);
     }
 
     @Override
     public ChannelFuture createLocalServer(LocalAddress address) {
-        return super.createServer(address, LocalServerChannel.class, new ChannelPipelineInitializer<LocalChannel,
-                NetconfServerSession>() {
-            @Override
-            public void initializeChannel(final LocalChannel ch, final Promise<NetconfServerSession> promise) {
-                initializer.initialize(ch, promise);
-            }
-        });
+        return super.createServer(address, LocalServerChannel.class, initializer::initialize);
     }
 
     public static class ServerChannelInitializer extends AbstractChannelInitializer<NetconfServerSession> {
index b4a5b955e1d0bebf561af699be55701cea7b85ec..3dfd48b656dbd2123eb2611e9edad66429dc0dc5 100644 (file)
@@ -17,7 +17,6 @@ import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
 import java.net.SocketAddress;
 import java.util.Set;
-import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
@@ -98,13 +97,8 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
             final Channel channel, final Promise<NetconfServerSession> promise) {
         final long sessionId = idProvider.getNextSessionId();
 
-        NetconfServerSessionPreferences proposal;
-        try {
-            proposal = new NetconfServerSessionPreferences(createHelloMessage(sessionId, monitoringService), sessionId);
-        } catch (final NetconfDocumentedException e) {
-            LOG.error("Unable to create hello message for session {} with {}", sessionId, monitoringService);
-            throw new IllegalStateException(e);
-        }
+        NetconfServerSessionPreferences proposal =
+            new NetconfServerSessionPreferences(createHelloMessage(sessionId, monitoringService), sessionId);
 
         return new NetconfServerSessionNegotiator(proposal, promise, channel, timer,
                 getListener(Long.toString(sessionId), channel.parent().localAddress()), connectionTimeoutMillis);
@@ -130,7 +124,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
     }
 
     private NetconfHelloMessage createHelloMessage(
-            final long sessionId, final NetconfMonitoringService capabilityProvider) throws NetconfDocumentedException {
+            final long sessionId, final NetconfMonitoringService capabilityProvider) {
         return NetconfHelloMessage.createServerHello(Sets.union(transformCapabilities(capabilityProvider
                 .getCapabilities()), baseCapabilities), sessionId);
     }
index 1a018363e513e8889a6facda9ed7dc6ce7bf2b63..194411f2d6b2d47c313c89d954ce823fd59e5327 100644 (file)
@@ -60,7 +60,7 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation imple
                     DocumentedException.ErrorSeverity.ERROR, Collections.singletonMap(
                     DocumentedException.ErrorSeverity.ERROR.toString(), e.getMessage()));
         }
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     @Override
index f1f57c204a43274a0485e7f6df68453f84864a04..3b4a5604649b329f4cf46ed7a9e7615991956f35 100644 (file)
@@ -52,7 +52,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
 
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document,
-                                                       final XmlElement operationElement) throws DocumentedException {
+                                                       final XmlElement operationElement) {
         final Element getSchemaResult = document.createElementNS(
                 XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
         LOG.trace("{} operation successful", START_EXI);
index a60ffb756aa7595ef012b583263bba9f0eadc6da..cd2d0f1e93c32cb96e53ef8d4918b979cfed969a 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.netconf.impl.mapping.operations;
 
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -32,7 +31,7 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements
 
     @Override
     protected Element handleWithNoSubsequentOperations(Document document,
-                                                       XmlElement operationElement) throws DocumentedException {
+                                                       XmlElement operationElement) {
         LOG.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
 
         netconfSession.stopExiCommunication();
index c8dc4c3003fe092b603b858af8347bf037ba8ae6..f627f15a7e81902889567ab61fc09a7ae7800dd7 100644 (file)
@@ -106,11 +106,8 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos
             }
 
             final String currentModuleName = cap.getModuleName().get();
-            Map<String, String> revisionMap = mappedModulesToRevisionToSchema.get(currentModuleName);
-            if (revisionMap == null) {
-                revisionMap = Maps.newHashMap();
-                mappedModulesToRevisionToSchema.put(currentModuleName, revisionMap);
-            }
+            Map<String, String> revisionMap =
+                mappedModulesToRevisionToSchema.computeIfAbsent(currentModuleName, k -> Maps.newHashMap());
 
             final String currentRevision = cap.getRevision().get();
             revisionMap.put(currentRevision, cap.getCapabilitySchema().get());
@@ -205,7 +202,7 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos
     }
 
     @Override
-    public synchronized void close() throws Exception {
+    public synchronized void close() {
         listeners.clear();
         capabilities.clear();
     }
@@ -241,7 +238,7 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos
         netconfCapabilityChangeBuilder.setAddedCapability(Lists.newArrayList(Collections2
                 .transform(added, CAPABILITY_TO_URI)));
         // TODO modified should be computed ... but why ?
-        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.<Uri>emptyList());
+        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.emptyList());
         return netconfCapabilityChangeBuilder.build();
     }
 
index 5c4c508f31b6d4e422af4b0954191f80ccd5622d..ff0bc5ce392c235a11023b4e9df2a15152ff02f9 100644 (file)
@@ -80,7 +80,7 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, A
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         capabilityMonitoring.close();
         sessionMonitoring.close();
     }
index ee712b78c3a8d1bf421f2f2dab784105713f74a2..449b0db530585cf752744f92c6bbb3ba387b6435 100644 (file)
@@ -90,12 +90,11 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         netconfOperationServiceSnapshot.close();
     }
 
-    private static DocumentedException handleUnexpectedEx(final String message, final Exception exception) throws
-            DocumentedException {
+    private static DocumentedException handleUnexpectedEx(final String message, final Exception exception) {
         LOG.error("{}", message, exception);
         return new DocumentedException("Unexpected error",
                 DocumentedException.ErrorType.APPLICATION,
index 72697ffebf1b69fc076b8ac6ca732afe61d5939b..639daa803d35a2627f18acb120133e868484d01a 100644 (file)
@@ -99,16 +99,11 @@ class NetconfSessionMonitoringService implements SessionListener, AutoCloseable
         if (!running) {
             startUpdateSessionStats();
         }
-        return new AutoCloseable() {
-            @Override
-            public void close() throws Exception {
-                listeners.remove(listener);
-            }
-        };
+        return () -> listeners.remove(listener);
     }
 
     @Override
-    public synchronized void close() throws Exception {
+    public synchronized void close() {
         stopUpdateSessionStats();
         listeners.clear();
         sessions.clear();
index 18b490ab13b258bb7038483be3abe2b33ada35e0..effccf3701113cae251ba4563f29d00a5f5b86c8 100644 (file)
@@ -22,17 +22,17 @@ public final class DeserializerExceptionHandler implements ChannelHandler {
     private static final Logger LOG = LoggerFactory.getLogger(DeserializerExceptionHandler.class);
 
     @Override
-    public void handlerAdded(final ChannelHandlerContext ctx) throws Exception {
+    public void handlerAdded(final ChannelHandlerContext ctx) {
         // NOOP
     }
 
     @Override
-    public void handlerRemoved(final ChannelHandlerContext ctx) throws Exception {
+    public void handlerRemoved(final ChannelHandlerContext ctx) {
         // NOOP
     }
 
     @Override
-    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
+    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
         LOG.warn("An exception occurred during message handling", cause);
         handleDeserializerException(ctx, cause);
     }
index cfa1915e3e8303b6b69f34d6cb48663a852f6e08..4b8f8591dfd7c6a6b3e674fa41b995cd5f8dc6c6 100644 (file)
@@ -73,7 +73,6 @@ import org.opendaylight.netconf.nettyutil.handler.exi.NetconfStartExiMessage;
 import org.opendaylight.netconf.util.messages.NetconfMessageUtil;
 import org.opendaylight.netconf.util.test.XmlFileLoader;
 import org.opendaylight.protocol.framework.NeverReconnectStrategy;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.CapabilitiesBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -128,7 +127,7 @@ public class ConcurrentClientsTest {
 
         }).when(monitoring).registerCapabilitiesListener(any(NetconfMonitoringService.CapabilitiesListener.class));
         doReturn(sessionListener).when(monitoring).getSessionListener();
-        doReturn(new CapabilitiesBuilder().setCapability(Collections.<Uri>emptyList()).build()).when(monitoring)
+        doReturn(new CapabilitiesBuilder().setCapability(Collections.emptyList()).build()).when(monitoring)
                 .getCapabilities();
         return monitoring;
     }
index 0b07c774f250ef1db726c2a15b20ad016956f28b..a8e05a900a63554e409b95d0a2b5ae8ef082da3f 100644 (file)
@@ -86,7 +86,7 @@ public class MessageParserTest {
         }
         assertTrue(messages.isEmpty());
 
-        NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound();
+        NetconfMessage receivedMessage = testChunkChannel.readInbound();
         assertNotNull(receivedMessage);
         assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
     }
@@ -98,7 +98,7 @@ public class MessageParserTest {
                 new NetconfMessageToXMLEncoder(), new NetconfEOMAggregator(), new NetconfXMLToMessageDecoder());
 
         testChunkChannel.writeOutbound(this.msg);
-        ByteBuf recievedOutbound = (ByteBuf) testChunkChannel.readOutbound();
+        ByteBuf recievedOutbound = testChunkChannel.readOutbound();
 
         byte[] endOfMsgBytes = NetconfMessageConstants.END_OF_MESSAGE.getBytes(StandardCharsets.UTF_8);
         byte[] eom = new byte[endOfMsgBytes.length];
@@ -106,7 +106,7 @@ public class MessageParserTest {
         assertArrayEquals(endOfMsgBytes, eom);
 
         testChunkChannel.writeInbound(recievedOutbound);
-        NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound();
+        NetconfMessage receivedMessage = testChunkChannel.readInbound();
         assertNotNull(receivedMessage);
         assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
     }
index 493326281f08c9a91cf8c2f53192436c0dee5325..e7d5bb3e2daa4f3f6f5142bfae31401872c0f738 100644 (file)
@@ -99,7 +99,7 @@ public class NetconfServerSessionListenerTest {
         listener.onMessage(session, msg);
         verify(monitoringListener).onSessionEvent(argThat(sessionEventIs(SessionEvent.Type.IN_RPC_SUCCESS)));
         channel.runPendingTasks();
-        final NetconfMessage sentMsg = (NetconfMessage) channel.readOutbound();
+        final NetconfMessage sentMsg = channel.readOutbound();
         final Diff diff = XMLUnit.compareXML(reply, sentMsg.getDocument());
         Assert.assertTrue(diff.toString(), diff.similar());
     }
@@ -141,7 +141,7 @@ public class NetconfServerSessionListenerTest {
         verify(monitoringListener).onSessionEvent(argThat(sessionEventIs(SessionEvent.Type.IN_RPC_FAIL)));
         verify(monitoringListener).onSessionEvent(argThat(sessionEventIs(SessionEvent.Type.OUT_RPC_ERROR)));
         channel.runPendingTasks();
-        final NetconfMessage sentMsg = (NetconfMessage) channel.readOutbound();
+        final NetconfMessage sentMsg = channel.readOutbound();
         System.out.println(XmlUtil.toString(sentMsg.getDocument()));
         System.out.println(XmlUtil.toString(reply));
         final Diff diff = XMLUnit.compareXML(reply, sentMsg.getDocument());
index 6e4408643680c39c21ef1a3c224aaa19ae8ba856..6e3dc9e153d64c7079ab336aa4c6d2911223a766 100644 (file)
@@ -138,7 +138,7 @@ public class NetconfServerSessionTest {
         final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
         tcpSession.sessionUp();
         final Session managementSession = tcpSession.toManagementSession();
-        Assert.assertEquals(new String(managementSession.getSourceHost().getValue()), HOST);
+        Assert.assertEquals(HOST, managementSession.getSourceHost().getIpAddress().getIpv4Address().getValue());
         Assert.assertEquals(managementSession.getUsername(), USER);
         Assert.assertEquals(managementSession.getSessionId().toString(), SESSION_ID);
         Assert.assertEquals(managementSession.getTransport(), NetconfTcp.class);
@@ -152,6 +152,7 @@ public class NetconfServerSessionTest {
         final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
         tcpSession.sessionUp();
         tcpSession.toManagementSession();
+        tcpSession.close();
     }
 
     @Test
@@ -162,7 +163,7 @@ public class NetconfServerSessionTest {
         final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
         tcpSession.sessionUp();
         final Session managementSession = tcpSession.toManagementSession();
-        Assert.assertEquals(new String(managementSession.getSourceHost().getValue()), "::1");
+        Assert.assertEquals("::1", managementSession.getSourceHost().getIpAddress().getIpv6Address().getValue());
         Assert.assertEquals(managementSession.getUsername(), USER);
         Assert.assertEquals(managementSession.getSessionId().toString(), SESSION_ID);
         Assert.assertEquals(managementSession.getTransport(), NetconfSsh.class);
index 54d3cb3b7c7246f75dae6baef7194779d78d457b..73ef36ef15128e0c8a4fc7c2162442c171004430 100644 (file)
@@ -33,7 +33,7 @@ import org.opendaylight.netconf.api.monitoring.NetconfManagementSession;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
 import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.HostBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.CapabilitiesBuilder;
@@ -60,7 +60,7 @@ public class NetconfCapabilityMonitoringServiceTest {
     private YangModuleCapability moduleCapability2;
     private static final Session SESSION = new SessionBuilder()
             .setSessionId(1L)
-            .setSourceHost(new Host("0.0.0.0".toCharArray()))
+            .setSourceHost(HostBuilder.getDefaultInstance("0.0.0.0"))
             .setUsername("admin")
             .build();
     private int capabilitiesSize;
index 860aa36e8b85a4bb06ea16bf17742bacbb70dd53..ae8ee0e6280ef90db9a4d048e84106fb20dac9d3 100644 (file)
@@ -32,7 +32,7 @@ import org.opendaylight.netconf.api.monitoring.NetconfManagementSession;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.netconf.api.monitoring.SessionEvent;
 import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.HostBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.SessionBuilder;
 
@@ -40,12 +40,12 @@ public class NetconfSessionMonitoringServiceTest {
 
     private static final Session SESSION_1 = new SessionBuilder()
             .setSessionId(1L)
-            .setSourceHost(new Host("0.0.0.0".toCharArray()))
+            .setSourceHost(HostBuilder.getDefaultInstance("0.0.0.0"))
             .setUsername("admin")
             .build();
     private static final Session SESSION_2 = new SessionBuilder()
             .setSessionId(2L)
-            .setSourceHost(new Host("0.0.0.0".toCharArray()))
+            .setSourceHost(HostBuilder.getDefaultInstance("0.0.0.0"))
             .setUsername("admin")
             .build();
 
diff --git a/netconf/netconf-it/pom.xml b/netconf/netconf-it/pom.xml
deleted file mode 100644 (file)
index beeede4..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.opendaylight.netconf</groupId>
-    <artifactId>netconf-subsystem</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>netconf-it</artifactId>
-  <name>${project.artifactId}</name>
-  <packaging>jar</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-netty-util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>mockito-configuration</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
-    </dependency>
-    <!-- compile dependencies -->
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>sal-netconf-connector</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-api</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-client</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-client</artifactId>
-      <version>${project.version}</version>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-impl</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-impl</artifactId>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-mapping-api</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-monitoring</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-netty-util</artifactId>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-ssh</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-       <groupId>${project.groupId}</groupId>
-       <artifactId>netconf-testtool</artifactId>
-       <version>${project.version}</version>
-       <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-ssh</artifactId>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-util</artifactId>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>netty-config-api</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>yang-test</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/AbstractNetconfConfigTest.java b/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/AbstractNetconfConfigTest.java
deleted file mode 100644 (file)
index cd1b9ce..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.netconf.it;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import com.google.common.base.Throwables;
-import com.google.common.io.ByteStreams;
-import com.google.common.util.concurrent.CheckedFuture;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.EventLoopGroup;
-import io.netty.channel.local.LocalAddress;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.util.HashedWheelTimer;
-import io.netty.util.concurrent.GlobalEventExecutor;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import org.junit.After;
-import org.junit.Before;
-import org.opendaylight.controller.config.facade.xml.ConfigSubsystemFacadeFactory;
-import org.opendaylight.controller.config.facade.xml.osgi.EnumResolver;
-import org.opendaylight.controller.config.facade.xml.osgi.YangStoreService;
-import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
-import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
-import org.opendaylight.controller.config.spi.ModuleFactory;
-import org.opendaylight.controller.config.yang.test.impl.DepTestImplModuleFactory;
-import org.opendaylight.controller.config.yang.test.impl.IdentityTestModuleFactory;
-import org.opendaylight.controller.config.yang.test.impl.MultipleDependenciesModuleFactory;
-import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleFactory;
-import org.opendaylight.controller.config.yang.test.impl.TestImplModuleFactory;
-import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
-import org.opendaylight.netconf.client.NetconfClientDispatcherImpl;
-import org.opendaylight.netconf.client.SimpleNetconfClientSessionListener;
-import org.opendaylight.netconf.client.conf.NetconfClientConfiguration;
-import org.opendaylight.netconf.client.conf.NetconfClientConfigurationBuilder;
-import org.opendaylight.netconf.confignetconfconnector.osgi.NetconfOperationServiceFactoryImpl;
-import org.opendaylight.netconf.impl.NetconfServerDispatcherImpl;
-import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory;
-import org.opendaylight.netconf.impl.SessionIdProvider;
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
-import org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl;
-import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
-import org.opendaylight.netconf.monitoring.osgi.NetconfMonitoringActivator;
-import org.opendaylight.netconf.monitoring.osgi.NetconfMonitoringOperationService;
-import org.opendaylight.netconf.util.test.XmlFileLoader;
-import org.opendaylight.protocol.framework.NeverReconnectStrategy;
-import org.opendaylight.yangtools.sal.binding.generator.util.BindingRuntimeContext;
-import org.opendaylight.yangtools.yang.binding.BindingMapping;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
-import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
-import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
-import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
-
-public abstract class AbstractNetconfConfigTest extends AbstractConfigTest {
-
-    public static final String LOOPBACK_ADDRESS = "127.0.0.1";
-    public static final int SERVER_CONNECTION_TIMEOUT_MILLIS = 5000;
-    private static final int RESOURCE_TIMEOUT_MINUTES = 2;
-
-    static ModuleFactory[] FACTORIES =
-            {new TestImplModuleFactory(), new DepTestImplModuleFactory(), new NetconfTestImplModuleFactory(),
-                    new IdentityTestModuleFactory(), new MultipleDependenciesModuleFactory()};
-
-    protected ConfigSubsystemFacadeFactory configSubsystemFacadeFactory;
-    private EventLoopGroup nettyThreadgroup;
-    private HashedWheelTimer hashedWheelTimer;
-
-    private NetconfClientDispatcherImpl clientDispatcher;
-    private Channel serverTcpChannel;
-
-    private NetconfMessage getConfig;
-    private NetconfMessage get;
-
-    /**
-     * @Before in subclasses is called after this method.
-     */
-    @Before
-    public void setUpAbstractNetconfConfigTest() throws Exception {
-        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(mockedContext, FACTORIES));
-
-        nettyThreadgroup = new NioEventLoopGroup();
-        hashedWheelTimer = new HashedWheelTimer();
-
-        loadMessages();
-
-        setUpTestInitial();
-
-        final AggregatedNetconfOperationServiceFactory factoriesListener =
-                new AggregatedNetconfOperationServiceFactory();
-        final NetconfMonitoringService netconfMonitoringService = getNetconfMonitoringService(factoriesListener);
-        configSubsystemFacadeFactory =
-                new ConfigSubsystemFacadeFactory(configRegistryClient, configRegistryClient, getYangStore());
-        factoriesListener.onAddNetconfOperationServiceFactory(
-                new NetconfOperationServiceFactoryImpl(configSubsystemFacadeFactory));
-        factoriesListener.onAddNetconfOperationServiceFactory(
-                new NetconfMonitoringActivator.NetconfMonitoringOperationServiceFactory(
-                        new NetconfMonitoringOperationService(netconfMonitoringService)));
-
-        for (final NetconfOperationServiceFactory netconfOperationServiceFactory : getAdditionalServiceFactories(
-                factoriesListener)) {
-            factoriesListener.onAddNetconfOperationServiceFactory(netconfOperationServiceFactory);
-        }
-
-        serverTcpChannel = startNetconfTcpServer(factoriesListener, netconfMonitoringService);
-        clientDispatcher =
-                new NetconfClientDispatcherImpl(getNettyThreadgroup(), getNettyThreadgroup(), getHashedWheelTimer());
-    }
-
-    /**
-     * Called before setUp method is executed, so test classes can set up resources before
-     * setUpAbstractNetconfConfigTest method is called.
-     */
-    protected void setUpTestInitial() throws Exception {}
-
-    private void loadMessages() throws Exception {
-        this.getConfig = XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/getConfig.xml");
-        this.get = XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/get.xml");
-    }
-
-    public NetconfMessage getGetConfig() {
-        return getConfig;
-    }
-
-    public NetconfMessage getGet() {
-        return get;
-    }
-
-    private Channel startNetconfTcpServer(final AggregatedNetconfOperationServiceFactory listener,
-            final NetconfMonitoringService monitoring) throws Exception {
-        final NetconfServerDispatcherImpl dispatch = createDispatcher(listener, monitoring);
-
-        final ChannelFuture s;
-        if (getTcpServerAddress() instanceof LocalAddress) {
-            s = dispatch.createLocalServer(((LocalAddress) getTcpServerAddress()));
-        } else {
-            s = dispatch.createServer(((InetSocketAddress) getTcpServerAddress()));
-        }
-        s.await(RESOURCE_TIMEOUT_MINUTES, TimeUnit.MINUTES);
-        return s.channel();
-    }
-
-    protected Iterable<NetconfOperationServiceFactory> getAdditionalServiceFactories(
-            final AggregatedNetconfOperationServiceFactory factoriesListener) throws Exception {
-        return Collections.emptySet();
-    }
-
-    protected NetconfMonitoringService getNetconfMonitoringService(
-            final AggregatedNetconfOperationServiceFactory factoriesListener) throws Exception {
-        return new NetconfMonitoringServiceImpl(factoriesListener);
-    }
-
-    protected abstract SocketAddress getTcpServerAddress();
-
-    public NetconfClientDispatcherImpl getClientDispatcher() {
-        return clientDispatcher;
-    }
-
-    private HardcodedYangStoreService getYangStore() throws IOException {
-        final Collection<InputStream> yangDependencies = getBasicYangs();
-        return new HardcodedYangStoreService(yangDependencies, getBindingRuntimeContext());
-    }
-
-    static Collection<InputStream> getBasicYangs() throws IOException {
-
-        final List<String> paths = Arrays.asList("/META-INF/yang/config@2013-04-05.yang",
-                "/META-INF/yang/rpc-context@2013-06-17.yang",
-                "/META-INF/yang/config-test.yang", "/META-INF/yang/config-test-impl.yang",
-                "/META-INF/yang/test-types.yang", "/META-INF/yang/test-groups.yang",
-                "/META-INF/yang/ietf-inet-types@2013-07-15.yang");
-
-        final Collection<InputStream> yangDependencies = new ArrayList<>();
-        final List<String> failedToFind = new ArrayList<>();
-        for (final String path : paths) {
-            final InputStream resourceAsStream = NetconfITTest.class.getResourceAsStream(path);
-            if (resourceAsStream == null) {
-                failedToFind.add(path);
-            } else {
-                yangDependencies.add(resourceAsStream);
-            }
-        }
-        assertEquals("Some yang files were not found", Collections.<String>emptyList(), failedToFind);
-        return yangDependencies;
-    }
-
-    protected NetconfServerDispatcherImpl createDispatcher(
-            final AggregatedNetconfOperationServiceFactory factoriesListener,
-            final NetconfMonitoringService sessionMonitoringService) {
-        final SessionIdProvider idProvider = new SessionIdProvider();
-
-        final NetconfServerSessionNegotiatorFactory serverNegotiatorFactory =
-                new NetconfServerSessionNegotiatorFactory(hashedWheelTimer, factoriesListener, idProvider,
-                        SERVER_CONNECTION_TIMEOUT_MILLIS, sessionMonitoringService);
-
-        final NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer =
-                new NetconfServerDispatcherImpl.ServerChannelInitializer(serverNegotiatorFactory);
-        return new NetconfServerDispatcherImpl(serverChannelInitializer, nettyThreadgroup, nettyThreadgroup);
-    }
-
-    protected HashedWheelTimer getHashedWheelTimer() {
-        return hashedWheelTimer;
-    }
-
-    protected EventLoopGroup getNettyThreadgroup() {
-        return nettyThreadgroup;
-    }
-
-    /**
-     * @After in subclasses is be called before this.
-     */
-    @After
-    public void cleanUpNetconf() throws Exception {
-        serverTcpChannel.close().await(RESOURCE_TIMEOUT_MINUTES, TimeUnit.MINUTES);
-        hashedWheelTimer.stop();
-        nettyThreadgroup.shutdownGracefully().await(RESOURCE_TIMEOUT_MINUTES, TimeUnit.MINUTES);
-    }
-
-    public NetconfClientConfiguration getClientConfiguration(final InetSocketAddress tcpAddress, final int timeout) {
-        final NetconfClientConfigurationBuilder b = NetconfClientConfigurationBuilder.create();
-        b.withAddress(tcpAddress);
-        b.withSessionListener(new SimpleNetconfClientSessionListener());
-        b.withReconnectStrategy(new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, timeout));
-        b.withConnectionTimeoutMillis(timeout);
-        return b.build();
-    }
-
-    public static final class HardcodedYangStoreService extends YangStoreService {
-        public HardcodedYangStoreService(final Collection<? extends InputStream> inputStreams,
-                final BindingRuntimeContext bindingRuntimeContext) throws IOException {
-            super(new SchemaContextProvider() {
-                @Override
-                public SchemaContext getSchemaContext() {
-                    return getSchema(inputStreams);
-                }
-            }, new SchemaSourceProvider<YangTextSchemaSource>() {
-                @Override
-                public CheckedFuture<? extends YangTextSchemaSource, SchemaSourceException> getSource(
-                        SourceIdentifier sourceIdentifier) {
-
-                    return null;
-                }
-            });
-
-            refresh(bindingRuntimeContext);
-        }
-
-        private static SchemaContext getSchema(final Collection<? extends InputStream> inputStreams) {
-            final ArrayList<InputStream> byteArrayInputStreams = new ArrayList<>();
-            for (final InputStream inputStream : inputStreams) {
-                assertNotNull(inputStream);
-                final byte[] content;
-                try {
-                    content = ByteStreams.toByteArray(inputStream);
-                } catch (IOException e) {
-                    throw new IllegalStateException("Cannot read " + inputStream, e);
-                }
-                final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(content);
-                byteArrayInputStreams.add(byteArrayInputStream);
-            }
-
-            for (final InputStream inputStream : byteArrayInputStreams) {
-                try {
-                    inputStream.reset();
-                } catch (final IOException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-
-            try {
-                return YangInferencePipeline.RFC6020_REACTOR.newBuild().buildEffective(byteArrayInputStreams);
-            } catch (SourceException | ReactorException e) {
-                throw Throwables.propagate(e);
-            }
-        }
-
-        @Override
-        public EnumResolver getEnumResolver() {
-            return new EnumResolver() {
-                @Override
-                public String fromYang(final String enumType, final String enumYangValue) {
-                    return BindingMapping.getClassName(enumYangValue);
-                }
-
-                @Override
-                public String toYang(final String enumType, final String enumJavaValue) {
-                    return enumJavaValue.toLowerCase();
-                }
-            };
-        }
-    }
-}
diff --git a/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfConfigPersisterITTest.java b/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfConfigPersisterITTest.java
deleted file mode 100644 (file)
index 91fc867..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.netconf.it;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.opendaylight.controller.config.util.xml.XmlUtil.readXmlToDocument;
-import static org.opendaylight.netconf.util.test.XmlUnitUtil.assertContainsElementWithName;
-import static org.opendaylight.netconf.util.test.XmlUnitUtil.assertElementsCount;
-
-import com.google.common.collect.HashBiMap;
-import com.google.common.collect.Lists;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.util.List;
-import javax.management.InstanceNotFoundException;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import org.junit.Test;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-import org.opendaylight.controller.config.api.jmx.notifications.CommitJMXNotification;
-import org.opendaylight.controller.config.api.jmx.notifications.ConfigJMXNotification;
-import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
-import org.opendaylight.controller.config.persist.api.Persister;
-import org.opendaylight.controller.config.persist.impl.ConfigPersisterNotificationHandler;
-import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.client.TestingNetconfClient;
-import org.opendaylight.netconf.util.test.XmlFileLoader;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.test.types.rev131127.TestIdentity1;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.test.types.rev131127.TestIdentity2;
-import org.opendaylight.yangtools.sal.binding.generator.util.BindingRuntimeContext;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-public class NetconfConfigPersisterITTest extends AbstractNetconfConfigTest {
-
-    public static final int PORT = 12026;
-    private static final InetSocketAddress TCP_ADDRESS = new InetSocketAddress(LOOPBACK_ADDRESS, PORT);
-
-    @Override
-    protected SocketAddress getTcpServerAddress() {
-        return TCP_ADDRESS;
-    }
-
-    @Test
-    public void testNetconfCommitNotifications() throws Exception {
-        final VerifyingNotificationListener notificationVerifier = createCommitNotificationListener();
-        final VerifyingPersister mockedAggregator = mockAggregator();
-
-        try (TestingNetconfClient persisterClient = new TestingNetconfClient("persister", getClientDispatcher(), getClientConfiguration(TCP_ADDRESS, 4000))) {
-            try (ConfigPersisterNotificationHandler configPersisterNotificationHandler = new ConfigPersisterNotificationHandler(
-                    platformMBeanServer, mockedAggregator, configSubsystemFacadeFactory)) {
-
-                try (TestingNetconfClient netconfClient = new TestingNetconfClient("client", getClientDispatcher(), getClientConfiguration(TCP_ADDRESS, 4000))) {
-                    NetconfMessage response = netconfClient.sendMessage(loadEditConfigMessage());
-                    assertContainsElementWithName(response.getDocument(), "ok");
-                    response = netconfClient.sendMessage(loadCommitMessage());
-                    assertContainsElementWithName(response.getDocument(), "ok");
-
-                    response = netconfClient.sendMessage(loadGetConfigMessage());
-                    assertContainsElementWithName(response.getDocument(), "modules");
-                    assertContainsElementWithName(response.getDocument(), "services");
-                }
-            }
-        }
-
-        notificationVerifier.assertNotificationCount(1);
-
-        mockedAggregator.assertSnapshotCount(1);
-        // Capabilities are stripped for persister
-        mockedAggregator.assertSnapshotContent(0, 4, 3, 3);
-    }
-
-    @Override
-    protected BindingRuntimeContext getBindingRuntimeContext() {
-        final BindingRuntimeContext ret = super.getBindingRuntimeContext();
-        doReturn(TestIdentity1.class).when(ret).getIdentityClass(TestIdentity1.QNAME);
-        doReturn(TestIdentity2.class).when(ret).getIdentityClass(TestIdentity2.QNAME);
-        final HashBiMap<String, String> toBeReturned = HashBiMap.create();
-        toBeReturned.put("two", "Two");
-        toBeReturned.put("one", "One");
-        toBeReturned.put("version1", "Version1");
-        doReturn(toBeReturned).when(ret).getEnumMapping(anyString());
-        return ret;
-    }
-
-    private VerifyingPersister mockAggregator() throws IOException {
-        return new VerifyingPersister();
-    }
-
-    private VerifyingNotificationListener createCommitNotificationListener() throws InstanceNotFoundException {
-        final VerifyingNotificationListener listener = new VerifyingNotificationListener();
-        platformMBeanServer.addNotificationListener(ConfigJMXNotification.OBJECT_NAME, listener, null, null);
-        return listener;
-    }
-
-    private NetconfMessage loadGetConfigMessage() throws Exception {
-        return XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/getConfig.xml");
-    }
-
-    private NetconfMessage loadEditConfigMessage() throws Exception {
-        return XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/editConfig.xml");
-    }
-
-    private NetconfMessage loadCommitMessage() throws Exception {
-        return XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/commit.xml");
-    }
-
-    private static class VerifyingNotificationListener implements NotificationListener {
-        public List<Notification> notifications = Lists.newArrayList();
-
-        @Override
-        public void handleNotification(final Notification notification, final Object handback) {
-            this.notifications.add(notification);
-        }
-
-        void assertNotificationCount(final Object size) {
-            assertEquals(size, notifications.size());
-        }
-
-        void assertNotificationContent(final int notificationIndex) {
-            final Notification notification = notifications.get(notificationIndex);
-            assertEquals(CommitJMXNotification.class, notification.getClass());
-        }
-    }
-
-    private static class VerifyingPersister implements Persister {
-
-        public List<ConfigSnapshotHolder> snapshots = Lists.newArrayList();
-        private Persister mockedPersister;
-
-        public VerifyingPersister() throws IOException {
-            final Persister mockedAggregator = mock(Persister.class);
-
-            doAnswer(new Answer<Object>() {
-                @Override
-                public Object answer(final InvocationOnMock invocation) throws Throwable {
-                    final ConfigSnapshotHolder configSnapshot = (ConfigSnapshotHolder) invocation.getArguments()[0];
-                    snapshots.add(configSnapshot);
-                    return null;
-                }
-            }).when(mockedAggregator).persistConfig(any(ConfigSnapshotHolder.class));
-
-            this.mockedPersister = mockedAggregator;
-        }
-
-        void assertSnapshotCount(final Object size) {
-            assertEquals(size, snapshots.size());
-        }
-
-        void assertSnapshotContent(final int notificationIndex, final int expectedModulesSize, final int expectedServicesSize, final int expectedCapsSize)
-                throws SAXException, IOException {
-            final ConfigSnapshotHolder snapshot = snapshots.get(notificationIndex);
-            final int capsSize = snapshot.getCapabilities().size();
-            assertEquals("Expected capabilities count should be " + expectedCapsSize + " but was " + snapshot.getCapabilities(), expectedCapsSize, capsSize);
-            final Document configSnapshot = readXmlToDocument(snapshot.getConfigSnapshot());
-            assertElementsCount(configSnapshot, "module", expectedModulesSize);
-            assertElementsCount(configSnapshot, "instance", expectedServicesSize);
-        }
-
-        @Override
-        public void persistConfig(final ConfigSnapshotHolder configSnapshotHolder) throws IOException {
-            mockedPersister.persistConfig(configSnapshotHolder);
-        }
-
-        @Override
-        public List<ConfigSnapshotHolder> loadLastConfigs() throws IOException {
-            return mockedPersister.loadLastConfigs();
-        }
-
-        @Override
-        public void close() {
-            mockedPersister.close();
-        }
-    }
-}
diff --git a/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITMonitoringTest.java b/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITMonitoringTest.java
deleted file mode 100644 (file)
index 8e1b1a0..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.netconf.it;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.opendaylight.netconf.util.test.XmlUnitUtil.assertContainsElementWithText;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.nio.charset.StandardCharsets;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.junit.Test;
-import org.opendaylight.controller.config.util.capability.Capability;
-import org.opendaylight.controller.config.util.xml.XmlUtil;
-import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.api.monitoring.CapabilityListener;
-import org.opendaylight.netconf.client.TestingNetconfClient;
-import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
-import org.opendaylight.netconf.mapping.api.NetconfOperationService;
-import org.opendaylight.netconf.util.test.XmlFileLoader;
-import org.w3c.dom.Document;
-
-public class NetconfITMonitoringTest extends AbstractNetconfConfigTest {
-
-    public static final int PORT = 12025;
-    public static final InetSocketAddress TCP_ADDRESS = new InetSocketAddress(LOOPBACK_ADDRESS, PORT);
-    public static final TestingCapability TESTING_CAPABILITY = new TestingCapability();
-
-    @Override
-    protected InetSocketAddress getTcpServerAddress() {
-        return TCP_ADDRESS;
-    }
-
-    @Test
-    public void testGetResponseFromMonitoring() throws Exception {
-        try (TestingNetconfClient netconfClient = new TestingNetconfClient("client-monitoring", getClientDispatcher(), getClientConfiguration(TCP_ADDRESS, 10000))) {
-            try (TestingNetconfClient netconfClient2 = new TestingNetconfClient("client-monitoring2", getClientDispatcher(), getClientConfiguration(TCP_ADDRESS, 10000))) {
-                Thread.sleep(500);
-                final NetconfMessage response = netconfClient2.sendMessage(getGet());
-                assertSessionElementsInResponse(response.getDocument(), 2);
-            }
-            Thread.sleep(500);
-            final NetconfMessage response = netconfClient.sendMessage(getGet());
-            assertSessionElementsInResponse(response.getDocument(), 1);
-        }
-    }
-
-    @Test(timeout = 13 * 10000)
-    public void testClientHelloWithAuth() throws Exception {
-        String fileName = "netconfMessages/client_hello_with_auth.xml";
-        final String hello = XmlFileLoader.fileToString(fileName);
-
-        fileName = "netconfMessages/get.xml";
-        final String get = XmlFileLoader.fileToString(fileName);
-
-        final Socket sock = new Socket(TCP_ADDRESS.getHostName(), TCP_ADDRESS.getPort());
-        sock.getOutputStream().write(hello.getBytes(StandardCharsets.UTF_8));
-        final String separator = "]]>]]>";
-
-        sock.getOutputStream().write(separator.getBytes(StandardCharsets.UTF_8));
-        sock.getOutputStream().write(get.getBytes(StandardCharsets.UTF_8));
-        sock.getOutputStream().write(separator.getBytes(StandardCharsets.UTF_8));
-
-        final StringBuilder responseBuilder = new StringBuilder();
-
-        try (InputStream inputStream = sock.getInputStream();
-             InputStreamReader reader = new InputStreamReader(inputStream);
-             BufferedReader buff = new BufferedReader(reader)) {
-            String line;
-            while ((line = buff.readLine()) != null) {
-
-                responseBuilder.append(line);
-                responseBuilder.append(System.lineSeparator());
-
-                if(line.contains("</rpc-reply>"))
-                    break;
-            }
-        }
-
-        sock.close();
-
-        final String helloMsg = responseBuilder.substring(0, responseBuilder.indexOf(separator));
-        Document doc = XmlUtil.readXmlToDocument(helloMsg);
-        assertContainsElementWithText(doc, "urn:ietf:params:netconf:capability:candidate:1.0");
-
-        final String replyMsg = responseBuilder.substring(responseBuilder.indexOf(separator) + separator.length());
-        doc = XmlUtil.readXmlToDocument(replyMsg);
-        assertContainsElementWithText(doc, "tomas");
-    }
-
-    private void assertSessionElementsInResponse(final Document document, final int i) {
-        final int elementSize = document.getElementsByTagName("session-id").getLength();
-        assertEquals("Incorrect number of session-id tags in " + XmlUtil.toString(document), i, elementSize);
-    }
-
-    public static AggregatedNetconfOperationServiceFactory getNetconfOperationProvider() throws Exception {
-        final AggregatedNetconfOperationServiceFactory factoriesListener = mock(AggregatedNetconfOperationServiceFactory.class);
-        final NetconfOperationService snap = mock(NetconfOperationService.class);
-        try {
-            doNothing().when(snap).close();
-        } catch (final Exception e) {
-            // not happening
-            throw new IllegalStateException(e);
-        }
-        final Set<Capability> caps = Sets.newHashSet();
-        caps.add(TESTING_CAPABILITY);
-
-        doReturn(caps).when(factoriesListener).getCapabilities();
-        doReturn(snap).when(factoriesListener).createService(anyString());
-
-        AutoCloseable mock = mock(AutoCloseable.class);
-        doNothing().when(mock).close();
-        doReturn(mock).when(factoriesListener).registerCapabilityListener(any(CapabilityListener.class));
-
-        return factoriesListener;
-    }
-
-    private static class TestingCapability implements Capability {
-        @Override
-        public String getCapabilityUri() {
-            return "namespaceModuleRevision";
-        }
-
-        @Override
-        public Optional<String> getModuleNamespace() {
-            return Optional.of("namespace");
-        }
-
-        @Override
-        public Optional<String> getModuleName() {
-            return Optional.of("name");
-        }
-
-        @Override
-        public Optional<String> getRevision() {
-            return Optional.of("revision");
-        }
-
-        @Override
-        public Optional<String> getCapabilitySchema() {
-            return Optional.of("content");
-        }
-
-        @Override
-        public List<String> getLocation() {
-            return Collections.emptyList();
-        }
-    }
-}
diff --git a/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITSecureTest.java b/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITSecureTest.java
deleted file mode 100644 (file)
index d39f2e5..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netconf.it;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-
-import com.google.common.collect.Lists;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import io.netty.channel.EventLoopGroup;
-import io.netty.channel.local.LocalAddress;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.util.concurrent.GlobalEventExecutor;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.nio.file.Files;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.sshd.server.keyprovider.PEMGeneratorHostKeyProvider;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.controller.config.util.xml.XmlUtil;
-import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.auth.AuthProvider;
-import org.opendaylight.netconf.client.NetconfClientDispatcher;
-import org.opendaylight.netconf.client.NetconfClientDispatcherImpl;
-import org.opendaylight.netconf.client.NetconfClientSessionListener;
-import org.opendaylight.netconf.client.SimpleNetconfClientSessionListener;
-import org.opendaylight.netconf.client.TestingNetconfClient;
-import org.opendaylight.netconf.client.conf.NetconfClientConfiguration;
-import org.opendaylight.netconf.client.conf.NetconfClientConfigurationBuilder;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.LoginPassword;
-import org.opendaylight.netconf.sal.connect.api.RemoteDevice;
-import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator;
-import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences;
-import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
-import org.opendaylight.netconf.ssh.SshProxyServer;
-import org.opendaylight.netconf.ssh.SshProxyServerConfigurationBuilder;
-import org.opendaylight.netconf.util.messages.NetconfMessageUtil;
-import org.opendaylight.netconf.util.osgi.NetconfConfigUtil;
-import org.opendaylight.protocol.framework.NeverReconnectStrategy;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.xml.sax.SAXException;
-
-public class NetconfITSecureTest extends AbstractNetconfConfigTest {
-
-    public static final int PORT = 12024;
-    private static final InetSocketAddress TLS_ADDRESS = new InetSocketAddress("127.0.0.1", PORT);
-
-    public static final String USERNAME = "user";
-    public static final String PASSWORD = "pwd";
-
-    private SshProxyServer sshProxyServer;
-
-    private ExecutorService nioExec;
-    private EventLoopGroup clientGroup;
-    private ScheduledExecutorService minaTimerEx;
-
-    @Before
-    public void setUp() throws Exception {
-        nioExec = Executors.newFixedThreadPool(1);
-        clientGroup = new NioEventLoopGroup();
-        minaTimerEx = Executors.newScheduledThreadPool(1);
-        sshProxyServer = new SshProxyServer(minaTimerEx, clientGroup, nioExec);
-        sshProxyServer.bind(
-                new SshProxyServerConfigurationBuilder()
-                        .setBindingAddress(TLS_ADDRESS)
-                        .setLocalAddress(NetconfConfigUtil.getNetconfLocalAddress())
-                        .setAuthenticator(new AuthProvider() {
-                                              @Override
-                                              public boolean authenticated(String username, String password) {
-                                                  return true;
-                                              }
-                                          }
-                        )
-                        .setKeyPairProvider(new PEMGeneratorHostKeyProvider(Files.createTempFile("prefix", "suffix").toAbsolutePath().toString()))
-                        .setIdleTimeout(Integer.MAX_VALUE)
-                        .createSshProxyServerConfiguration());
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        sshProxyServer.close();
-        clientGroup.shutdownGracefully();
-        minaTimerEx.shutdownNow();
-        nioExec.shutdownNow();
-    }
-
-    @Test(timeout = 2*60*1000)
-    public void testSecure() throws Exception {
-        final NetconfClientDispatcher dispatch = new NetconfClientDispatcherImpl(getNettyThreadgroup(), getNettyThreadgroup(), getHashedWheelTimer());
-        try (TestingNetconfClient netconfClient = new TestingNetconfClient("testing-ssh-client", dispatch, getClientConfiguration(new SimpleNetconfClientSessionListener(), TLS_ADDRESS))) {
-            NetconfMessage response = netconfClient.sendMessage(getGetConfig());
-            assertFalse("Unexpected error message " + XmlUtil.toString(response.getDocument()),
-                    NetconfMessageUtil.isErrorMessage(response));
-
-            final NetconfMessage gs = new NetconfMessage(XmlUtil.readXmlToDocument("<rpc message-id=\"2\"\n" +
-                    "     xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n" +
-                    "    <get-schema xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring\">\n" +
-                    "        <identifier>config</identifier>\n" +
-                    "    </get-schema>\n" +
-                    "</rpc>\n"));
-
-            response = netconfClient.sendMessage(gs);
-            assertFalse("Unexpected error message " + XmlUtil.toString(response.getDocument()),
-                    NetconfMessageUtil.isErrorMessage(response));
-        }
-    }
-
-    /**
-     * Test all requests are handled properly and no mismatch occurs in listener
-     */
-    @Test(timeout = 6*60*1000)
-    public void testSecureStress() throws Exception {
-        final int requests = 4000;
-
-        final NetconfClientDispatcher dispatch = new NetconfClientDispatcherImpl(getNettyThreadgroup(), getNettyThreadgroup(), getHashedWheelTimer());
-        final NetconfDeviceCommunicator sessionListener = getSessionListener();
-        try (TestingNetconfClient netconfClient = new TestingNetconfClient("testing-ssh-client", dispatch, getClientConfiguration(sessionListener, TLS_ADDRESS))) {
-
-            final AtomicInteger responseCounter = new AtomicInteger(0);
-            final List<ListenableFuture<RpcResult<NetconfMessage>>> futures = Lists.newArrayList();
-
-            for (int i = 0; i < requests; i++) {
-                NetconfMessage getConfig = getGetConfig();
-                getConfig = changeMessageId(getConfig, i);
-                final ListenableFuture<RpcResult<NetconfMessage>> netconfMessageFuture = sessionListener.sendRequest(getConfig, QName.create("namespace", "2012-12-12", "get"));
-                futures.add(netconfMessageFuture);
-                Futures.addCallback(netconfMessageFuture, new FutureCallback<RpcResult<NetconfMessage>>() {
-                    @Override
-                    public void onSuccess(final RpcResult<NetconfMessage> result) {
-                        responseCounter.incrementAndGet();
-                    }
-
-                    @Override
-                    public void onFailure(final Throwable t) {
-                        throw new RuntimeException(t);
-                    }
-                });
-            }
-
-            // Wait for every future
-            for (final ListenableFuture<RpcResult<NetconfMessage>> future : futures) {
-                try {
-                    future.get(3, TimeUnit.MINUTES);
-                } catch (final TimeoutException e) {
-                    fail("Request " + futures.indexOf(future) + " is not responding");
-                }
-            }
-
-            // Give future listeners some time to finish counter incrementation
-            Thread.sleep(5000);
-
-            assertEquals(requests, responseCounter.get());
-        }
-    }
-
-    public static NetconfMessage changeMessageId(final NetconfMessage getConfig, final int i) throws IOException, SAXException {
-        String s = XmlUtil.toString(getConfig.getDocument(), false);
-        s = s.replace("101", Integer.toString(i));
-        return new NetconfMessage(XmlUtil.readXmlToDocument(s));
-    }
-
-    static NetconfClientConfiguration getClientConfiguration(final NetconfClientSessionListener sessionListener,final InetSocketAddress tlsAddress) throws IOException {
-        final NetconfClientConfigurationBuilder b = NetconfClientConfigurationBuilder.create();
-        b.withAddress(tlsAddress);
-        // Using session listener from sal-netconf-connector since stress test cannot be performed with simple listener
-        b.withSessionListener(sessionListener);
-        b.withReconnectStrategy(new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, 5000));
-        b.withProtocol(NetconfClientConfiguration.NetconfClientProtocol.SSH);
-        b.withConnectionTimeoutMillis(5000);
-        b.withAuthHandler(getAuthHandler());
-        return b.build();
-    }
-
-    static NetconfDeviceCommunicator getSessionListener() {
-        RemoteDevice<NetconfSessionPreferences, NetconfMessage, NetconfDeviceCommunicator> mockedRemoteDevice = mock(RemoteDevice.class);
-        doNothing().when(mockedRemoteDevice).onRemoteSessionUp(any(NetconfSessionPreferences.class), any(NetconfDeviceCommunicator.class));
-        doNothing().when(mockedRemoteDevice).onRemoteSessionDown();
-        return new NetconfDeviceCommunicator(new RemoteDeviceId("secure-test", InetSocketAddress.createUnresolved("localhost", 22)), mockedRemoteDevice);
-    }
-
-    public AuthProvider getAuthProvider() throws Exception {
-        final AuthProvider mockAuth = mock(AuthProvider.class);
-        doReturn("mockedAuth").when(mockAuth).toString();
-        doReturn(true).when(mockAuth).authenticated(anyString(), anyString());
-        return mockAuth;
-    }
-
-    public static AuthenticationHandler getAuthHandler() throws IOException {
-        return new LoginPassword(USERNAME, PASSWORD);
-    }
-
-    @Override
-    protected LocalAddress getTcpServerAddress() {
-        return NetconfConfigUtil.getNetconfLocalAddress();
-    }
-}
diff --git a/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITSecureTestTool.java b/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITSecureTestTool.java
deleted file mode 100644 (file)
index 6e7ef74..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netconf.it;
-
-import static java.lang.Thread.sleep;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.opendaylight.netconf.it.NetconfITSecureTest.getSessionListener;
-
-import com.google.common.base.Throwables;
-import com.google.common.collect.Lists;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.util.HashedWheelTimer;
-import java.net.InetSocketAddress;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicInteger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.client.NetconfClientDispatcher;
-import org.opendaylight.netconf.client.NetconfClientDispatcherImpl;
-import org.opendaylight.netconf.client.TestingNetconfClient;
-import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator;
-import org.opendaylight.netconf.test.tool.Main.Params;
-import org.opendaylight.netconf.test.tool.NetconfDeviceSimulator;
-import org.opendaylight.netconf.util.test.XmlFileLoader;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-public class NetconfITSecureTestTool
-{
-
-    //set up port both for testool device and test
-    public static final int PORT = 17833;
-    private static final InetSocketAddress TLS_ADDRESS = new InetSocketAddress("127.0.0.1", PORT);
-
-    private String xmlFile = "netconfMessages/editConfig.xml";
-
-    private ExecutorService msgExec = Executors.newFixedThreadPool(8);
-
-    Collection<Future<?>> tasks = new LinkedList<Future<?>>();
-
-    final NetconfDeviceSimulator netconfDeviceSimulator = new NetconfDeviceSimulator();
-
-    @Before
-    public void setUp() throws Exception {
-
-        //Set up parameters for testtool device
-        Params params = new Params();
-        params.debug = true;
-        params.deviceCount = 1;
-        params.startingPort = PORT;
-        params.ssh = true;
-        params.exi = true;
-
-        final List<Integer> openDevices = netconfDeviceSimulator.start(params);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-
-    }
-
-    /**
-     * Test all requests are handled properly and no mismatch occurs in listener
-     */
-    @Test(timeout = 6*60*1000)
-    public void testSecureStress() throws Exception {
-
-        final int requests = 4000;
-
-        List<Future<?>> tasks = new ArrayList<>();
-
-        final NetconfClientDispatcher dispatch = new NetconfClientDispatcherImpl(new NioEventLoopGroup(), new NioEventLoopGroup(), new HashedWheelTimer());
-
-        final NetconfDeviceCommunicator sessionListener = getSessionListener();
-
-        try (TestingNetconfClient netconfClient = new TestingNetconfClient("testing-ssh-client", dispatch, NetconfITSecureTest.getClientConfiguration(sessionListener, TLS_ADDRESS));)
-        {
-
-            final AtomicInteger responseCounter = new AtomicInteger(0);
-            final List<ListenableFuture<RpcResult<NetconfMessage>>> futures = Lists.newArrayList();
-
-            for (int i = 0; i < requests; i++) {
-
-                NetconfMessage getConfig = XmlFileLoader.xmlFileToNetconfMessage(xmlFile);
-
-                getConfig = NetconfITSecureTest.changeMessageId(getConfig,i);
-
-                Runnable worker = new NetconfITSecureTestToolRunnable(getConfig,i, sessionListener, futures, responseCounter);
-
-                tasks.add(msgExec.submit(worker));
-
-            }
-
-            msgExec.shutdown();
-
-            // Wait for every future
-            for (final Future<?> task : tasks){
-                try
-                {
-
-                    task.get(3, TimeUnit.MINUTES);
-                } catch (final TimeoutException e) {
-                    fail(String.format("Request %d is not responding", tasks.indexOf(task)));
-                }
-            }
-
-            for (final ListenableFuture<RpcResult<NetconfMessage>> future : futures) {
-                try {
-
-                    future.get(3, TimeUnit.MINUTES);
-                } catch (final TimeoutException e) {
-                    fail(String.format("Reply %d is not responding", futures.indexOf(future)));
-                }
-            }
-
-            sleep(5000);
-
-            assertEquals(requests, responseCounter.get());
-
-        }
-    }
-
-    class NetconfITSecureTestToolRunnable implements Runnable {
-
-        private NetconfMessage getConfig;
-        private int it;
-        private NetconfDeviceCommunicator sessionListener;
-        private List<ListenableFuture<RpcResult<NetconfMessage>>> futures;
-        private AtomicInteger responseCounter;
-
-        public NetconfITSecureTestToolRunnable(NetconfMessage getConfig, int it, NetconfDeviceCommunicator sessionListener, List<ListenableFuture<RpcResult<NetconfMessage>>> futures, AtomicInteger responseCounter){
-            this.getConfig = getConfig;
-            this.it = it;
-            this.sessionListener = sessionListener;
-            this.futures = futures;
-            this.responseCounter = responseCounter;
-        }
-
-        @Override
-        public void run(){
-
-            ListenableFuture<RpcResult<NetconfMessage>> netconfMessageFuture;
-
-            netconfMessageFuture = sessionListener.sendRequest(getConfig, QName.create("namespace", "2012-12-12", "get"));
-
-            futures.add(netconfMessageFuture);
-            Futures.addCallback(netconfMessageFuture, new FutureCallback<RpcResult<NetconfMessage>>() {
-
-                    @Override
-                    public void onSuccess(final RpcResult<NetconfMessage> result) {
-
-                        if(result.isSuccessful()&result.getErrors().isEmpty()) {
-                            responseCounter.incrementAndGet();
-                        } else {
-
-                            fail(String.format("Message result not ok %s", result.getErrors().toString()));
-
-                        }
-                    }
-
-                    @Override
-                    public void onFailure(final Throwable t) {
-
-                        fail(String.format("Message failed %s", Throwables.getStackTraceAsString(t)));
-
-                    }
-                }
-            );
-        }
-    }
-
-}
diff --git a/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITTest.java b/netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITTest.java
deleted file mode 100644 (file)
index fc97e69..0000000
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netconf.it;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.doReturn;
-
-import com.google.common.base.Throwables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-import javax.management.ObjectName;
-import javax.xml.parsers.ParserConfigurationException;
-import org.junit.Before;
-import org.junit.Test;
-import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
-import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
-import org.opendaylight.controller.config.util.xml.DocumentedException;
-import org.opendaylight.controller.config.util.xml.XmlElement;
-import org.opendaylight.controller.config.util.xml.XmlUtil;
-import org.opendaylight.controller.config.yang.test.impl.DepTestImplModuleFactory;
-import org.opendaylight.controller.config.yang.test.impl.MultipleDependenciesModuleFactory;
-import org.opendaylight.controller.config.yang.test.impl.MultipleDependenciesModuleMXBean;
-import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleFactory;
-import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleMXBean;
-import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.client.NetconfClientDispatcher;
-import org.opendaylight.netconf.client.TestingNetconfClient;
-import org.opendaylight.netconf.util.test.XmlFileLoader;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.test.types.rev131127.TestIdentity1;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.test.types.rev131127.TestIdentity2;
-import org.opendaylight.yangtools.sal.binding.generator.util.BindingRuntimeContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-public class NetconfITTest extends AbstractNetconfConfigTest {
-
-    public static final int PORT = 12023;
-    public static final InetSocketAddress TCP_ADDRESS = new InetSocketAddress(LOOPBACK_ADDRESS, PORT);
-
-    private NetconfMessage getConfigCandidate, editConfig, closeSession;
-    private NetconfClientDispatcher clientDispatcher;
-
-    @Before
-    public void setUp() throws Exception {
-        loadMessages();
-        clientDispatcher = getClientDispatcher();
-    }
-
-    @Override
-    protected InetSocketAddress getTcpServerAddress() {
-        return TCP_ADDRESS;
-    }
-
-    private void loadMessages() throws IOException, SAXException, ParserConfigurationException {
-        this.editConfig = XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/edit_config.xml");
-        this.getConfigCandidate = XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/getConfig_candidate.xml");
-        this.closeSession = XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/closeSession.xml");
-    }
-
-    @Test
-    public void testNetconfClientDemonstration() throws Exception {
-        try (TestingNetconfClient netconfClient = new TestingNetconfClient("client", clientDispatcher, getClientConfiguration(TCP_ADDRESS, 4000))) {
-
-            final Set<String> capabilitiesFromNetconfServer = netconfClient.getCapabilities();
-            final long sessionId = netconfClient.getSessionId();
-
-            // NetconfMessage can be created :
-            // new NetconfMessage(XmlUtil.readXmlToDocument("<xml/>"));
-
-            final NetconfMessage response = netconfClient.sendMessage(getGetConfig());
-            response.getDocument();
-        }
-    }
-
-    @Test
-    public void testTwoSessions() throws Exception {
-        try (TestingNetconfClient netconfClient = new TestingNetconfClient("1", clientDispatcher, getClientConfiguration(TCP_ADDRESS, 10000)))  {
-            try (TestingNetconfClient netconfClient2 = new TestingNetconfClient("2", clientDispatcher, getClientConfiguration(TCP_ADDRESS, 10000))) {
-                assertNotNull(netconfClient2.getCapabilities());
-            }
-        }
-    }
-
-    @Test
-    public void rpcReplyContainsAllAttributesTest() throws Exception {
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            final String rpc = "<rpc message-id=\"5\" a=\"a\" b=\"44\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"><get/>" + "</rpc>";
-            final Document doc = XmlUtil.readXmlToDocument(rpc);
-            final NetconfMessage message = netconfClient.sendMessage(new NetconfMessage(doc));
-            assertNotNull(message);
-            final NamedNodeMap expectedAttributes = doc.getDocumentElement().getAttributes();
-            final NamedNodeMap returnedAttributes = message.getDocument().getDocumentElement().getAttributes();
-
-            assertSameAttributes(expectedAttributes, returnedAttributes);
-        }
-    }
-
-    private void assertSameAttributes(final NamedNodeMap expectedAttributes, final NamedNodeMap returnedAttributes) {
-        assertNotNull("Expecting 4 attributes", returnedAttributes);
-        assertEquals(expectedAttributes.getLength(), returnedAttributes.getLength());
-
-        for (int i = 0; i < expectedAttributes.getLength(); i++) {
-            final Node expAttr = expectedAttributes.item(i);
-            final Node attr = returnedAttributes.item(i);
-            assertEquals(expAttr.getNodeName(), attr.getNodeName());
-            assertEquals(expAttr.getNamespaceURI(), attr.getNamespaceURI());
-            assertEquals(expAttr.getTextContent(), attr.getTextContent());
-        }
-    }
-
-    @Test
-    public void rpcReplyErrorContainsAllAttributesTest() throws Exception {
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            final String rpc = "<rpc message-id=\"1\" a=\"adada\" b=\"4\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"><commit/>" + "</rpc>";
-            final Document doc = XmlUtil.readXmlToDocument(rpc);
-            final NetconfMessage message = netconfClient.sendMessage(new NetconfMessage(doc));
-            final NamedNodeMap expectedAttributes = doc.getDocumentElement().getAttributes();
-            final NamedNodeMap returnedAttributes = message.getDocument().getDocumentElement().getAttributes();
-
-            assertSameAttributes(expectedAttributes, returnedAttributes);
-        }
-    }
-
-    @Test
-    public void rpcOutputContainsCorrectNamespace() throws Exception {
-        final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
-        final ObjectName dep = transaction.createModule(DepTestImplModuleFactory.NAME, "instanceD");
-        final ObjectName impl = transaction.createModule(NetconfTestImplModuleFactory.NAME, "instance");
-        final NetconfTestImplModuleMXBean proxy = configRegistryClient
-                .newMXBeanProxy(impl, NetconfTestImplModuleMXBean.class);
-        proxy.setTestingDep(dep);
-        proxy.setSimpleShort((short) 0);
-
-        transaction.commit();
-
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            final String expectedNamespace = "urn:opendaylight:params:xml:ns:yang:controller:test:impl";
-
-            final String rpc = "<rpc message-id=\"5\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">"
-                    + "<no-arg xmlns=\""
-                    + expectedNamespace
-                    + "\">    "
-                    + "<context-instance>/modules/module[type='impl-netconf'][name='instance']</context-instance>"
-                    + "<arg1>argument1</arg1>" + "</no-arg>" + "</rpc>";
-            final Document doc = XmlUtil.readXmlToDocument(rpc);
-            final NetconfMessage message = netconfClient.sendMessage(new NetconfMessage(doc));
-
-            final Element rpcReply = message.getDocument().getDocumentElement();
-            final XmlElement resultElement = XmlElement.fromDomElement(rpcReply).getOnlyChildElement();
-            assertEquals("result", resultElement.getName());
-
-            final String namespace = resultElement.getNamespaceAttribute();
-            assertEquals(expectedNamespace, namespace);
-        }
-    }
-
-    @Test
-    public void testCloseSession() throws Exception {
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-
-            // edit config
-            Document rpcReply = netconfClient.sendMessage(this.editConfig)
-                    .getDocument();
-            assertIsOK(rpcReply);
-
-            rpcReply = netconfClient.sendMessage(this.closeSession)
-                    .getDocument();
-
-            assertIsOK(rpcReply);
-        }
-    }
-
-    @Test
-    public void testEditConfig() throws Exception {
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            // send edit_config.xml
-            final Document rpcReply = netconfClient.sendMessage(this.editConfig).getDocument();
-            assertIsOK(rpcReply);
-        }
-    }
-
-    @Test
-    public void testValidate() throws Exception {
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            // begin transaction
-            Document rpcReply = netconfClient.sendMessage(getConfigCandidate).getDocument();
-            assertEquals("data", XmlElement.fromDomDocument(rpcReply).getOnlyChildElement().getName());
-
-            // operations empty
-            rpcReply = netconfClient.sendMessage(XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/validate.xml"))
-                    .getDocument();
-            assertIsOK(rpcReply);
-        }
-    }
-
-    private void assertIsOK(final Document rpcReply) throws DocumentedException {
-        assertEquals("rpc-reply", rpcReply.getDocumentElement().getLocalName());
-        assertEquals("ok", XmlElement.fromDomDocument(rpcReply).getOnlyChildElement().getName());
-    }
-
-    private Document assertGetConfigWorks(final TestingNetconfClient netconfClient) throws InterruptedException, ExecutionException, TimeoutException, DocumentedException {
-        return assertGetConfigWorks(netconfClient, getGetConfig());
-    }
-
-    private Document assertGetConfigWorks(final TestingNetconfClient netconfClient, final NetconfMessage getConfigMessage)
-            throws InterruptedException, ExecutionException, TimeoutException, DocumentedException {
-        final NetconfMessage rpcReply = netconfClient.sendMessage(getConfigMessage);
-        assertNotNull(rpcReply);
-        assertEquals("data", XmlElement.fromDomDocument(rpcReply.getDocument()).getOnlyChildElement().getName());
-        return rpcReply.getDocument();
-    }
-
-    @Test
-    public void testGetConfig() throws Exception {
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            assertGetConfigWorks(netconfClient);
-        }
-    }
-
-    @Test
-    public void createYangTestBasedOnYuma() throws Exception {
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            Document rpcReply = netconfClient.sendMessage(
-                    XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/editConfig_merge_yang-test.xml"))
-                    .getDocument();
-            assertEquals("rpc-reply", rpcReply.getDocumentElement().getTagName());
-            assertIsOK(rpcReply);
-            assertGetConfigWorks(netconfClient, this.getConfigCandidate);
-            rpcReply = netconfClient.sendMessage(XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/commit.xml"))
-                    .getDocument();
-            assertIsOK(rpcReply);
-
-            final ObjectName on = new ObjectName(
-                    "org.opendaylight.controller:instanceName=impl-dep-instance,type=Module,moduleFactoryName=impl-dep");
-            final Set<ObjectName> cfgBeans = configRegistryClient.lookupConfigBeans();
-            assertEquals(cfgBeans, Sets.newHashSet(on));
-        }
-    }
-
-    private TestingNetconfClient createSession(final InetSocketAddress address, final String expected) throws Exception {
-        final TestingNetconfClient netconfClient = new TestingNetconfClient("test " + address.toString(), clientDispatcher, getClientConfiguration(address, 5000));
-        assertEquals(expected, Long.toString(netconfClient.getSessionId()));
-        return netconfClient;
-    }
-
-    @Test
-    public void testIdRef() throws Exception {
-        final NetconfMessage editId = XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/editConfig_identities.xml");
-        final NetconfMessage commit = XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/commit.xml");
-
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            assertIsOK(netconfClient.sendMessage(editId).getDocument());
-            assertIsOK(netconfClient.sendMessage(commit).getDocument());
-
-            final NetconfMessage response = netconfClient.sendMessage(getGetConfig());
-
-            assertThat(XmlUtil.toString(response.getDocument()), containsString("<afi xmlns:prefix=\"urn:opendaylight:params:xml:ns:yang:controller:config:test:types\">prefix:test-identity1</afi>"));
-            assertThat(XmlUtil.toString(response.getDocument()), containsString("<afi xmlns:prefix=\"urn:opendaylight:params:xml:ns:yang:controller:config:test:types\">prefix:test-identity2</afi>"));
-            assertThat(XmlUtil.toString(response.getDocument()), containsString("<safi xmlns:prefix=\"urn:opendaylight:params:xml:ns:yang:controller:config:test:types\">prefix:test-identity2</safi>"));
-            assertThat(XmlUtil.toString(response.getDocument()), containsString("<safi xmlns:prefix=\"urn:opendaylight:params:xml:ns:yang:controller:config:test:types\">prefix:test-identity1</safi>"));
-
-        } catch (final Exception e) {
-            fail(Throwables.getStackTraceAsString(e));
-        }
-    }
-
-    @Override
-    protected BindingRuntimeContext getBindingRuntimeContext() {
-        final BindingRuntimeContext ret = super.getBindingRuntimeContext();
-        doReturn(TestIdentity1.class).when(ret).getIdentityClass(TestIdentity1.QNAME);
-        doReturn(TestIdentity2.class).when(ret).getIdentityClass(TestIdentity2.QNAME);
-        return ret;
-    }
-
-    @Test
-    public void testMultipleDependencies() throws Exception {
-        // push first xml, should add parent and d1,d2 dependencies
-        try (TestingNetconfClient netconfClient = createSession(TCP_ADDRESS, "1")) {
-            final Document rpcReply = netconfClient.sendMessage(
-                    XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/editConfig_merge_multiple-deps1.xml"))
-                    .getDocument();
-            assertIsOK(rpcReply);
-            commit(netconfClient);
-        }
-        // verify that parent.getTestingDeps == d1,d2
-        final MultipleDependenciesModuleMXBean parentProxy = configRegistryClient.newMXBeanProxy(
-                configRegistryClient.lookupConfigBean(MultipleDependenciesModuleFactory.NAME, "parent"),
-                MultipleDependenciesModuleMXBean.class);
-        {
-            final List<ObjectName> testingDeps = parentProxy.getTestingDeps();
-            assertEquals(2, testingDeps.size());
-            final Set<String> actualRefs = getServiceReferences(testingDeps);
-            assertEquals(Sets.newHashSet("ref_d1", "ref_d2"), actualRefs);
-        }
-
-        // push second xml, should add d3 to parent's dependencies
-        mergeD3(parentProxy);
-        // push second xml again, to test that d3 is not added again
-        mergeD3(parentProxy);
-    }
-
-    public void mergeD3(final MultipleDependenciesModuleMXBean parentProxy) throws Exception {
-        try (TestingNetconfClient netconfClient = new TestingNetconfClient(
-                "test " + TCP_ADDRESS.toString(), clientDispatcher, getClientConfiguration(TCP_ADDRESS, 5000))) {
-
-            final Document rpcReply = netconfClient.sendMessage(
-                    XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/editConfig_merge_multiple-deps2.xml"))
-                    .getDocument();
-            assertIsOK(rpcReply);
-            commit(netconfClient);
-        }
-        {
-            final List<ObjectName> testingDeps = parentProxy.getTestingDeps();
-            assertEquals(3, testingDeps.size());
-            final Set<String> actualRefs = getServiceReferences(testingDeps);
-            assertEquals(Sets.newHashSet("ref_d1", "ref_d2", "ref_d3"), actualRefs);
-        }
-    }
-
-    public Set<String> getServiceReferences(final List<ObjectName> testingDeps) {
-        return new HashSet<>(Lists.transform(testingDeps, ObjectNameUtil::getReferenceName));
-    }
-
-    public void commit(final TestingNetconfClient netconfClient) throws Exception {
-        final Document rpcReply;
-        rpcReply = netconfClient.sendMessage(XmlFileLoader.xmlFileToNetconfMessage("netconfMessages/commit.xml"))
-                .getDocument();
-        assertIsOK(rpcReply);
-    }
-}
diff --git a/netconf/netconf-it/src/test/resources/logback-test.xml b/netconf/netconf-it/src/test/resources/logback-test.xml
deleted file mode 100644 (file)
index e9ee13d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<configuration scan="true">
-
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
-        </encoder>
-    </appender>
-
-  <logger name="org.opendaylight.controller.netconf" level="INFO"/>
-  <logger name="org.opendaylight.controller.sal.connect.netconf" level="DEBUG"/>
-
-  <root level="error">
-    <appender-ref ref="STDOUT" />
-  </root>
-
-</configuration>
diff --git a/netconf/netconf-it/src/test/resources/netconfMessages/editConfig_identities.xml b/netconf/netconf-it/src/test/resources/netconfMessages/editConfig_identities.xml
deleted file mode 100644 (file)
index cf9f3e5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<rpc message-id="a" a="64" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-<edit-config>
-    <target>
-        <candidate/>
-    </target>
-    <test-option>
-        set
-    </test-option>
-    <default-operation>merge</default-operation>
-    <config>
-        <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-            <module>
-                <type xmlns:test-impl="urn:opendaylight:params:xml:ns:yang:controller:test:impl">
-                    test-impl:impl-identity-test
-                </type>
-                <name>id-test</name>
-                <identities>
-                    <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity1</afi>
-                    <safi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity2</safi>
-                </identities>
-                <identities>
-                    <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity2</afi>
-                    <safi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity1</safi>
-                </identities>
-                <identities-container>
-                    <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity2</afi>
-                </identities-container>
-                <afi xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:test:types">prefix:test-identity1</afi>
-            </module>
-        </modules>
-
-        <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-
-        </services>
-    </config>
-</edit-config>
-</rpc>
index b7fae22c00b7d15d60f7201d2f951d23d4533881..8d0385948a133bc34ce40d8f78fca8eeba962f2d 100644 (file)
@@ -37,7 +37,7 @@ public interface NetconfOperationChainedExecution {
         }
 
         @Override
-        public Document execute(Document requestMessage) throws DocumentedException {
+        public Document execute(Document requestMessage) {
             throw new IllegalStateException("This execution represents the termination point in operation execution "
                     + "and cannot be executed itself");
         }
index 7aa2c2a4d7c99e72639953698e501447d1c8ca6e..4eaf60496c69352465de68969c35dfa76f7e3cd1 100644 (file)
@@ -85,8 +85,7 @@ public class Get extends AbstractNetconfOperation {
 
     @Override
     protected Element handle(final Document document, final XmlElement message,
-                             final NetconfOperationChainedExecution subsequentOperation)
-            throws DocumentedException {
+                             final NetconfOperationChainedExecution subsequentOperation) {
         throw new UnsupportedOperationException("Never gets called");
     }
 }
index 6141babe16e568daa14add06bd0e5c8dcc78e8ed..7bdeac6af5c1c80ecb12a6e64cfde163f3b7a6eb 100644 (file)
@@ -26,7 +26,7 @@ public class NetconfMonitoringOperationService implements NetconfOperationServic
 
     @Override
     public Set<NetconfOperation> getNetconfOperations() {
-        return Sets.<NetconfOperation>newHashSet(new Get(monitor), new GetSchema(monitor));
+        return Sets.newHashSet(new Get(monitor), new GetSchema(monitor));
     }
 
     @Override
index 012d7291982a699e1835b325ea162a7758acb3ed..f295353ec6ca6be788868ddecf93ddcbbf769171 100644 (file)
@@ -28,8 +28,6 @@ import org.opendaylight.netconf.mapping.api.HandlingPriority;
 import org.opendaylight.netconf.mapping.api.NetconfOperationChainedExecution;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.SchemasBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.SessionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
 import org.w3c.dom.Document;
 
 public class GetTest {
@@ -54,9 +52,9 @@ public class GetTest {
         correctSubsequentResult = XmlUtil.readXmlToDocument("<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:"
                 + "1.0\"><data></data></rpc-reply>");
 
-        doReturn(new SessionsBuilder().setSession(Collections.<Session>emptyList()).build()).when(monitor)
+        doReturn(new SessionsBuilder().setSession(Collections.emptyList()).build()).when(monitor)
                 .getSessions();
-        doReturn(new SchemasBuilder().setSchema(Collections.<Schema>emptyList()).build()).when(monitor).getSchemas();
+        doReturn(new SchemasBuilder().setSchema(Collections.emptyList()).build()).when(monitor).getSchemas();
         doReturn(false).when(subsequentOperation).isExecutionTermination();
 
         get = new Get(monitor);
index eb338a674999eca6caa3f90448bd28d8fb7f798c..65ee7744112624d4efb0176b06ea1151d468a587 100644 (file)
@@ -27,7 +27,7 @@
       <dependency>
         <groupId>com.siemens.ct.exi</groupId>
         <artifactId>exificient</artifactId>
-        <version>0.9.7</version>
+        <version>1.0.1</version>
       </dependency>
     </dependencies>
   </dependencyManagement>
index 707312abdd709bec92a8791a19283fdd19c26205..29fe99fcb043dee6d76cf3073b1e7be60d6372c2 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.netconf.nettyutil;
 
-import com.siemens.ct.exi.exceptions.EXIException;
-import com.siemens.ct.exi.exceptions.UnsupportedOption;
+import com.siemens.ct.exi.core.exceptions.EXIException;
+import com.siemens.ct.exi.core.exceptions.UnsupportedOption;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandler;
index 4135896b34d28361a4a9fd6f19d6e09864fccdcc..d9c15ae03578052a079bc157d44d2e7e9dcb6e1e 100644 (file)
@@ -19,7 +19,6 @@ import io.netty.handler.ssl.SslHandler;
 import io.netty.util.Timeout;
 import io.netty.util.Timer;
 import io.netty.util.TimerTask;
-import io.netty.util.concurrent.Future;
 import io.netty.util.concurrent.GenericFutureListener;
 import io.netty.util.concurrent.Promise;
 import java.util.concurrent.TimeUnit;
@@ -84,14 +83,10 @@ public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionP
         } else {
             final Optional<SslHandler> sslHandler = getSslHandler(channel);
             if (sslHandler.isPresent()) {
-                Future<Channel> future = sslHandler.get().handshakeFuture();
-                future.addListener(new GenericFutureListener<Future<? super Channel>>() {
-                    @Override
-                    public void operationComplete(final Future<? super Channel> future) {
-                        Preconditions.checkState(future.isSuccess(), "Ssl handshake was not successful");
-                        LOG.debug("Ssl handshake complete");
-                        start();
-                    }
+                sslHandler.get().handshakeFuture().addListener(future -> {
+                    Preconditions.checkState(future.isSuccess(), "Ssl handshake was not successful");
+                    LOG.debug("Ssl handshake complete");
+                    start();
                 });
             } else {
                 start();
@@ -106,7 +101,7 @@ public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionP
 
     private static Optional<SslHandler> getSslHandler(final Channel channel) {
         final SslHandler sslHandler = channel.pipeline().get(SslHandler.class);
-        return sslHandler == null ? Optional.<SslHandler>absent() : Optional.of(sslHandler);
+        return sslHandler == null ? Optional.absent() : Optional.of(sslHandler);
     }
 
     public P getSessionPreferences() {
@@ -139,14 +134,11 @@ public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionP
                             LOG.warn("Netconf session was not established after {}", connectionTimeoutMillis);
                             changeState(State.FAILED);
 
-                            channel.close().addListener(new GenericFutureListener<ChannelFuture>() {
-                                @Override
-                                public void operationComplete(final ChannelFuture future) throws Exception {
-                                    if (future.isSuccess()) {
-                                        LOG.debug("Channel {} closed: success", future.channel());
-                                    } else {
-                                        LOG.warn("Channel {} closed: fail", future.channel());
-                                    }
+                            channel.close().addListener((GenericFutureListener<ChannelFuture>) future -> {
+                                if (future.isSuccess()) {
+                                    LOG.debug("Channel {} closed: success", future.channel());
+                                } else {
+                                    LOG.warn("Channel {} closed: fail", future.channel());
                                 }
                             });
                         }
index 383e8b7d50d2eb87e3ffeb5cbfe9e8b5d9703991..b8924bbcdc8b4a7bbfe680d67e3ff3250c01fc0c 100644 (file)
@@ -8,14 +8,15 @@
 
 package org.opendaylight.netconf.nettyutil.handler;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
-import com.siemens.ct.exi.EXIFactory;
-import com.siemens.ct.exi.api.sax.SAXEncoder;
-import com.siemens.ct.exi.api.sax.SAXFactory;
-import com.siemens.ct.exi.exceptions.EXIException;
+import com.siemens.ct.exi.core.EXIFactory;
+import com.siemens.ct.exi.core.exceptions.EXIException;
+import com.siemens.ct.exi.main.api.sax.SAXEncoder;
+import com.siemens.ct.exi.main.api.sax.SAXFactory;
 import org.opendaylight.netconf.nettyutil.handler.exi.EXIParameters;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
@@ -26,12 +27,7 @@ public final class NetconfEXICodec {
      * OpenEXI does not allow us to directly prevent resolution of external entities. In order
      * to prevent XXE attacks, we reuse a single no-op entity resolver.
      */
-    private static final EntityResolver ENTITY_RESOLVER = new EntityResolver() {
-        @Override
-        public InputSource resolveEntity(final String publicId, final String systemId) {
-            return new InputSource();
-        }
-    };
+    private static final EntityResolver ENTITY_RESOLVER = (publicId, systemId) -> new InputSource();
 
     /**
      * Since we have a limited number of options we can have, instantiating a weak cache
@@ -48,7 +44,7 @@ public final class NetconfEXICodec {
     private final SAXFactory exiFactory;
 
     private NetconfEXICodec(final EXIFactory exiFactory) {
-        this.exiFactory = new SAXFactory(Preconditions.checkNotNull(exiFactory));
+        this.exiFactory = new SAXFactory(requireNonNull(exiFactory));
     }
 
     public static NetconfEXICodec forParameters(final EXIParameters parameters) {
index 94287cc18695c8a837dca7cf7e646f3f53a707ea..1ddacb8bb512f9b1abc0c5df3e4f2236723af36b 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.netconf.nettyutil.handler;
 
-import com.google.common.base.Preconditions;
-import com.siemens.ct.exi.exceptions.EXIException;
+import static java.util.Objects.requireNonNull;
+
+import com.siemens.ct.exi.core.exceptions.EXIException;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufInputStream;
 import io.netty.buffer.ByteBufUtil;
@@ -57,7 +58,7 @@ public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder {
     private final DocumentBuilder documentBuilder;
 
     private NetconfEXIToMessageDecoder(final XMLReader reader) {
-        this.reader = Preconditions.checkNotNull(reader);
+        this.reader = requireNonNull(reader);
         this.documentBuilder = UntrustedXML.newDocumentBuilder();
     }
 
index 0493805db1f7f85096d084f553c5726b787650a1..932613cfd119d1e2aa0e92d3c555ff09db38305a 100644 (file)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.netconf.nettyutil.handler;
 
-import com.google.common.base.Preconditions;
-import com.siemens.ct.exi.api.sax.SAXEncoder;
-import com.siemens.ct.exi.exceptions.EXIException;
+import static java.util.Objects.requireNonNull;
+
+import com.siemens.ct.exi.core.exceptions.EXIException;
+import com.siemens.ct.exi.main.api.sax.SAXEncoder;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufOutputStream;
 import io.netty.channel.ChannelHandlerContext;
@@ -29,7 +30,7 @@ public final class NetconfMessageToEXIEncoder extends MessageToByteEncoder<Netco
     private final NetconfEXICodec codec;
 
     private NetconfMessageToEXIEncoder(final NetconfEXICodec codec) {
-        this.codec = Preconditions.checkNotNull(codec);
+        this.codec = requireNonNull(codec);
     }
 
     public static NetconfMessageToEXIEncoder create(final NetconfEXICodec codec) {
index f033e0efe3406eb1f03edbdf323502e1018dbcfd..c7ab89d8c71d81008cf352c217e7e7eea12217a6 100644 (file)
@@ -31,7 +31,7 @@ public class NetconfMessageToXMLEncoder extends MessageToByteEncoder<NetconfMess
     private final Optional<String> clientId;
 
     public NetconfMessageToXMLEncoder() {
-        this(Optional.<String>absent());
+        this(Optional.absent());
     }
 
     public NetconfMessageToXMLEncoder(final Optional<String> clientId) {
index 82f707572ce2a160ef45ae10609f810c45333c8d..6e02a3fa97cca9e3a5eab0df66750cfb2ce63b4f 100644 (file)
@@ -21,7 +21,6 @@ import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.List;
-import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
@@ -60,7 +59,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder
     @Override
     @VisibleForTesting
     public void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
-            throws IOException, SAXException, NetconfDocumentedException {
+            throws IOException, SAXException {
         if (in.readableBytes() == 0) {
             LOG.debug("No more content in incoming buffer.");
             return;
@@ -108,8 +107,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder
         }
     }
 
-    private static NetconfMessage getNetconfMessage(final String additionalHeader, final Document doc)
-            throws NetconfDocumentedException {
+    private static NetconfMessage getNetconfMessage(final String additionalHeader, final Document doc) {
         NetconfMessage msg = new NetconfMessage(doc);
         if (NetconfHelloMessage.isHelloMessage(msg)) {
             if (additionalHeader != null) {
index 8d8ccd9fb732f2f6ceeb1d3b404cacf55a6384ec..5340baa6e44b77299f660ed04a54f5a8dd74ce97 100644 (file)
@@ -7,14 +7,15 @@
  */
 package org.opendaylight.netconf.nettyutil.handler.exi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.siemens.ct.exi.CodingMode;
-import com.siemens.ct.exi.EXIFactory;
-import com.siemens.ct.exi.EncodingOptions;
-import com.siemens.ct.exi.FidelityOptions;
-import com.siemens.ct.exi.exceptions.UnsupportedOption;
-import com.siemens.ct.exi.helpers.DefaultEXIFactory;
+import com.siemens.ct.exi.core.CodingMode;
+import com.siemens.ct.exi.core.EXIFactory;
+import com.siemens.ct.exi.core.EncodingOptions;
+import com.siemens.ct.exi.core.FidelityOptions;
+import com.siemens.ct.exi.core.exceptions.UnsupportedOption;
+import com.siemens.ct.exi.core.helpers.DefaultEXIFactory;
 import java.util.Objects;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.slf4j.Logger;
@@ -63,8 +64,8 @@ public final class EXIParameters {
     private final CodingMode codingMode;
 
     public EXIParameters(final CodingMode codingMode, final FidelityOptions fidelityOptions) {
-        this.fidelityOptions = Preconditions.checkNotNull(fidelityOptions);
-        this.codingMode = Preconditions.checkNotNull(codingMode);
+        this.fidelityOptions = requireNonNull(fidelityOptions);
+        this.codingMode = requireNonNull(codingMode);
     }
 
     @VisibleForTesting
index 2d080ef3fca0e4372937b8bcb11c807fd5a1264a..149ccf16f9910dfbf38a866f5c0d89fbda50c7b6 100644 (file)
@@ -63,7 +63,7 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
     private GenericFutureListener negotiationFutureListener;
 
     public AsyncSshHandler(final AuthenticationHandler authenticationHandler, final SshClient sshClient,
-            final Future<?> negotiationFuture) throws IOException {
+            final Future<?> negotiationFuture) {
         this(authenticationHandler, sshClient);
         this.negotiationFuture = negotiationFuture;
     }
@@ -73,16 +73,14 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
      *
      * @param authenticationHandler authentication handler
      * @param sshClient             started SshClient
-     * @throws IOException          if the I/O operation fails
      */
     public AsyncSshHandler(final AuthenticationHandler authenticationHandler,
-                           final SshClient sshClient) throws IOException {
+                           final SshClient sshClient) {
         this.authenticationHandler = Preconditions.checkNotNull(authenticationHandler);
         this.sshClient = Preconditions.checkNotNull(sshClient);
     }
 
-    public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler)
-            throws IOException {
+    public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler) {
         return new AsyncSshHandler(authenticationHandler, DEFAULT_CLIENT);
     }
 
@@ -93,10 +91,9 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
      * @param authenticationHandler authentication handler
      * @param negotiationFuture     negotiation future
      * @return                      {@code AsyncSshHandler}
-     * @throws IOException          if the I/O operation fails
      */
     public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler,
-            final Future<?> negotiationFuture) throws IOException {
+            final Future<?> negotiationFuture) {
         return new AsyncSshHandler(authenticationHandler, DEFAULT_CLIENT, negotiationFuture);
     }
 
@@ -167,7 +164,7 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
 
         ClientChannel localChannel = channel;
         sshReadAsyncListener = new AsyncSshHandlerReader(() -> AsyncSshHandler.this.disconnect(ctx, ctx.newPromise()),
-            msg -> ctx.fireChannelRead(msg), localChannel.toString(), localChannel.getAsyncOut());
+            ctx::fireChannelRead, localChannel.toString(), localChannel.getAsyncOut());
 
         // if readAsyncListener receives immediate close,
         // it will close this handler and closing this handler sets channel variable to null
@@ -212,7 +209,7 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
     }
 
     @Override
-    public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) throws Exception {
+    public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) {
         disconnect(ctx, promise);
     }
 
index 193f87ce8f871c2f5334eadd92cfc4fe66c6983e..80be3858d9a5f3988d3f6c80bf4bb7d5149be58d 100644 (file)
@@ -11,13 +11,13 @@ package org.opendaylight.netconf.nettyutil.handler;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
-import com.google.common.collect.Lists;
-import com.siemens.ct.exi.api.sax.SAXEncoder;
-import com.siemens.ct.exi.exceptions.EXIException;
+import com.siemens.ct.exi.core.exceptions.EXIException;
+import com.siemens.ct.exi.main.api.sax.SAXEncoder;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import javax.xml.transform.TransformerException;
@@ -71,7 +71,7 @@ public class NetconfEXIHandlersTest {
             assertEquals((byte)0, buffer.array()[i]);
         }
 
-        final List<Object> out = Lists.newArrayList();
+        final List<Object> out = new ArrayList<>();
         netconfEXIToMessageDecoder.decode(null, buffer, out);
 
         XMLUnit.compareXML(msg.getDocument(), ((NetconfMessage) out.get(0)).getDocument());
index 018acdbc7f5ce5e9cdb63b97e97b635bfbffe60f..5e1bd3896d5e66ca1a38ac1d9dbab01140c1fdde 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.netconf.nettyutil.handler.exi;
 
 import static org.junit.Assert.assertEquals;
 
-import com.siemens.ct.exi.CodingMode;
-import com.siemens.ct.exi.EXIFactory;
-import com.siemens.ct.exi.FidelityOptions;
+import com.siemens.ct.exi.core.CodingMode;
+import com.siemens.ct.exi.core.EXIFactory;
+import com.siemens.ct.exi.core.FidelityOptions;
 import java.util.Arrays;
 import org.junit.Test;
 import org.junit.runner.RunWith;
index f2adab81908a2dbfefff3696eb2ac74a16f845d3..fa3d2081bbb450169e5d9fdda367b6a588e6d881 100644 (file)
@@ -10,8 +10,8 @@ package org.opendaylight.netconf.nettyutil.handler.exi;
 
 import static org.junit.Assert.assertTrue;
 
-import com.siemens.ct.exi.CodingMode;
-import com.siemens.ct.exi.FidelityOptions;
+import com.siemens.ct.exi.core.CodingMode;
+import com.siemens.ct.exi.core.FidelityOptions;
 import java.util.Arrays;
 import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.XMLUnit;
index bc57f3c7a1c578306a3c1fba604a0b72962c8695..4023ece6dbd67311262e16961aeb4b70c3ad89a2 100644 (file)
@@ -219,7 +219,7 @@ public class AsyncSshHandlerTest {
             public void onSuccess(final SshFutureListener<IoReadFuture> result) {
                 doReturn(new IllegalStateException()).when(mockedReadFuture).getException();
                 doReturn(mockedReadFuture).when(mockedReadFuture)
-                        .removeListener(Matchers.<SshFutureListener<IoReadFuture>>any());
+                        .removeListener(Matchers.any());
                 doReturn(true).when(asyncOut).isClosing();
                 doReturn(true).when(asyncOut).isClosed();
                 result.operationComplete(mockedReadFuture);
@@ -250,7 +250,7 @@ public class AsyncSshHandlerTest {
             public void onSuccess(final SshFutureListener<IoReadFuture> result) {
                 doReturn(new IllegalStateException()).when(mockedReadFuture).getException();
                 doReturn(mockedReadFuture).when(mockedReadFuture)
-                        .removeListener(Matchers.<SshFutureListener<IoReadFuture>>any());
+                        .removeListener(Matchers.any());
                 result.operationComplete(mockedReadFuture);
             }
         }, MoreExecutors.directExecutor());
@@ -493,7 +493,7 @@ public class AsyncSshHandlerTest {
     private static IoOutputStream getMockedIoOutputStream() {
         final IoOutputStream mock = mock(IoOutputStream.class);
         final IoWriteFuture ioWriteFuture = mock(IoWriteFuture.class);
-        doReturn(ioWriteFuture).when(ioWriteFuture).addListener(Matchers.<SshFutureListener<IoWriteFuture>>any());
+        doReturn(ioWriteFuture).when(ioWriteFuture).addListener(Matchers.any());
         doReturn(true).when(ioWriteFuture).isWritten();
 
         Futures.addCallback(stubAddListener(ioWriteFuture), new SuccessFutureListener<IoWriteFuture>() {
@@ -513,10 +513,10 @@ public class AsyncSshHandlerTest {
         final IoInputStream mock = mock(IoInputStream.class);
         final IoReadFuture ioReadFuture = mock(IoReadFuture.class);
         doReturn(null).when(ioReadFuture).getException();
-        doReturn(ioReadFuture).when(ioReadFuture).removeListener(Matchers.<SshFutureListener<IoReadFuture>>any());
+        doReturn(ioReadFuture).when(ioReadFuture).removeListener(Matchers.any());
         doReturn(5).when(ioReadFuture).getRead();
         doReturn(new ByteArrayBuffer(new byte[]{0, 1, 2, 3, 4})).when(ioReadFuture).getBuffer();
-        doReturn(ioReadFuture).when(ioReadFuture).addListener(Matchers.<SshFutureListener<IoReadFuture>>any());
+        doReturn(ioReadFuture).when(ioReadFuture).addListener(Matchers.any());
 
         // Always success for read
         Futures.addCallback(stubAddListener(ioReadFuture), new SuccessFutureListener<IoReadFuture>() {
index 9860de76bbc73ebed93d2ab1ddd5e11b0f5cba8a..b0d9cf75baae8599de5cd0722d642b96e4d91fae 100644 (file)
@@ -89,7 +89,7 @@ public class CreateSubscription extends AbstractSingletonNetconfOperation
                 .registerNotificationListener(streamNameType, new NotificationSubscription(netconfSession, filter));
         subscriptions.add(notificationListenerRegistration);
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     private static StreamNameType parseStreamIfPresent(final XmlElement operationElement) throws DocumentedException {
index bd7c9d17f98d3bd7a55538a15184f0273aa47010..e55f852a89c76cc50870c1920d2181d0c2f04221 100644 (file)
@@ -54,8 +54,7 @@ public class Get extends AbstractNetconfOperation implements AutoCloseable {
 
     @Override
     protected Element handle(final Document document, final XmlElement message,
-                             final NetconfOperationChainedExecution subsequentOperation)
-            throws DocumentedException {
+                             final NetconfOperationChainedExecution subsequentOperation) {
         throw new UnsupportedOperationException("Never gets called");
     }
 
@@ -103,7 +102,7 @@ public class Get extends AbstractNetconfOperation implements AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
 
     }
 }
index d2fdaaddb77ccef5627e0cae32265b7da397c3aa..ade7a3564810cdb45a19dfab2891a203c5b09258 100644 (file)
@@ -77,7 +77,7 @@ public final class NotificationsTransformUtil {
      * Transform base notification for capabilities into NetconfNotification.
      */
     public static NetconfNotification transform(final Notification notification, SchemaPath path) {
-        return transform(notification, Optional.<Date>absent(), path);
+        return transform(notification, Optional.absent(), path);
     }
 
     public static NetconfNotification transform(final Notification notification,
index 21b7d0d83d6bd9fc1f999a594fddbe1522a9763a..cc4c57c07b2bc1a81d2f727dfc6a8877a46df001 100644 (file)
@@ -41,7 +41,7 @@ public class Activator implements BundleActivator {
     private NetconfNotificationManager netconfNotificationManager;
 
     @Override
-    public void start(final BundleContext context) throws Exception {
+    public void start(final BundleContext context) {
         netconfNotificationManager = new NetconfNotificationManager();
         // Add properties to autowire with netconf-impl instance for cfg subsystem
         final Dictionary<String, String> props = new Hashtable<>();
@@ -52,7 +52,7 @@ public class Activator implements BundleActivator {
         final NetconfOperationServiceFactory netconfOperationServiceFactory = new NetconfOperationServiceFactory() {
 
             private final Set<Capability> capabilities =
-                    Collections.<Capability>singleton(new BasicCapability(NetconfNotification.NOTIFICATION_NAMESPACE));
+                    Collections.singleton(new BasicCapability(NetconfNotification.NOTIFICATION_NAMESPACE));
 
             @Override
             public Set<Capability> getCapabilities() {
@@ -61,8 +61,8 @@ public class Activator implements BundleActivator {
 
             @Override
             public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
-                listener.onCapabilitiesChanged(capabilities, Collections.<Capability>emptySet());
-                return () -> listener.onCapabilitiesChanged(Collections.<Capability>emptySet(), capabilities);
+                listener.onCapabilitiesChanged(capabilities, Collections.emptySet());
+                return () -> listener.onCapabilitiesChanged(Collections.emptySet(), capabilities);
             }
 
             @Override
@@ -74,7 +74,7 @@ public class Activator implements BundleActivator {
 
                     @Override
                     public Set<NetconfOperation> getNetconfOperations() {
-                        return Sets.<NetconfOperation>newHashSet(
+                        return Sets.newHashSet(
                                 new Get(netconfSessionIdForReporting, netconfNotificationManager),
                                 createSubscription);
                     }
@@ -94,7 +94,7 @@ public class Activator implements BundleActivator {
     }
 
     @Override
-    public void stop(final BundleContext context) throws Exception {
+    public void stop(final BundleContext context) {
         if (netconfNotificationCollectorServiceRegistration != null) {
             netconfNotificationCollectorServiceRegistration.unregister();
             netconfNotificationCollectorServiceRegistration = null;
index 971e50631ed5fc11ddfa8d4b89f7d6104f9c22d8..dd2d08970081b269816e116be86c2c47394193ca 100644 (file)
@@ -20,7 +20,6 @@ import org.apache.sshd.common.util.threads.ThreadUtils;
 import org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider;
 import org.opendaylight.netconf.auth.AuthProvider;
 import org.opendaylight.netconf.util.NetconfConfiguration;
-import org.osgi.framework.InvalidSyntaxException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,7 +49,7 @@ public class NetconfSSHProvider {
 
     // Called via blueprint
     @SuppressWarnings("unused")
-    public void init() throws IOException, InvalidSyntaxException {
+    public void init() throws IOException {
         minaTimerExecutor = Executors.newScheduledThreadPool(POOL_SIZE,
             runnable -> new Thread(runnable, "netconf-ssh-server-mina-timers"));
         clientGroup = new NioEventLoopGroup();
@@ -79,7 +78,7 @@ public class NetconfSSHProvider {
     }
 
     private SshProxyServer startSSHServer()
-            throws IOException, InvalidSyntaxException {
+            throws IOException {
 
         final InetSocketAddress sshSocketAddress = netconfConfiguration.getSshServerAddress();
         LOG.info("Starting netconf SSH server at {}", sshSocketAddress);
index 3d91f3aeb4ab35cd1fee451e869860968f584cf0..733d81af1ffc11b7676767ad07e6cade8a1ecc9f 100644 (file)
@@ -16,8 +16,6 @@ import io.netty.channel.ChannelInitializer;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.local.LocalAddress;
 import io.netty.channel.local.LocalChannel;
-import io.netty.util.concurrent.GenericFutureListener;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.InetSocketAddress;
@@ -105,7 +103,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
     }
 
     @Override
-    public void start(final Environment env) throws IOException {
+    public void start(final Environment env) {
         LOG.trace("Establishing internal connection to netconf server for client: {}", getClientAddress());
 
         final Bootstrap clientBootstrap = new Bootstrap();
@@ -113,25 +111,21 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
 
         clientBootstrap.handler(new ChannelInitializer<LocalChannel>() {
             @Override
-            public void initChannel(final LocalChannel ch) throws Exception {
+            public void initChannel(final LocalChannel ch) {
                 ch.pipeline()
                         .addLast(new SshProxyClientHandler(in, out, netconfHelloMessageAdditionalHeader, callback));
             }
         });
         clientChannelFuture = clientBootstrap.connect(localAddress);
-        clientChannelFuture.addListener(new GenericFutureListener<ChannelFuture>() {
-
-            @Override
-            public void operationComplete(final ChannelFuture future) throws Exception {
-                if (future.isSuccess()) {
-                    clientChannel = clientChannelFuture.channel();
-                } else {
-                    LOG.warn("Unable to establish internal connection to netconf server for client: {}",
-                            getClientAddress());
-                    Preconditions.checkNotNull(callback, "Exit callback must be set");
-                    callback.onExit(1, "Unable to establish internal connection to netconf server for client: "
-                            + getClientAddress());
-                }
+        clientChannelFuture.addListener(future -> {
+            if (future.isSuccess()) {
+                clientChannel = clientChannelFuture.channel();
+            } else {
+                LOG.warn("Unable to establish internal connection to netconf server for client: {}",
+                        getClientAddress());
+                Preconditions.checkNotNull(callback, "Exit callback must be set");
+                callback.onExit(1, "Unable to establish internal connection to netconf server for client: "
+                        + getClientAddress());
             }
         });
     }
@@ -143,14 +137,10 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
 
         clientChannelFuture.cancel(true);
         if (clientChannel != null) {
-            clientChannel.close().addListener(new GenericFutureListener<ChannelFuture>() {
-
-                @Override
-                public void operationComplete(final ChannelFuture future) throws Exception {
-                    if (!future.isSuccess()) {
-                        LOG.warn("Unable to release internal connection to netconf server on channel: {}",
-                                clientChannel);
-                    }
+            clientChannel.close().addListener(future -> {
+                if (!future.isSuccess()) {
+                    LOG.warn("Unable to release internal connection to netconf server on channel: {}",
+                            clientChannel);
                 }
             });
         }
index e8ec506026d24d79255e6788671d28e836b87360..edd63653f1745d8df5eaae6c8e05b2c0dbd8eb02 100644 (file)
@@ -79,7 +79,7 @@ final class SshProxyClientHandler extends ChannelInboundHandlerAdapter {
     }
 
     @Override
-    public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
+    public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
         asyncSshHandlerWriter.write(ctx, msg, ctx.newPromise());
     }
 
index 8b9caef47b15388755bb308e23d608fe81351c14..69090c283f6a93cd3c8136d701f5e6846791f890 100644 (file)
@@ -48,7 +48,7 @@ public class NetconfNorthboundTcpServer implements AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         if (tcpServer.isDone()) {
             tcpServer.channel().close();
         } else {
index d53cf409162c2024911f22df85191762a04dfaf5..54fb94e162e70483f9dce1e8cdf80b917ba335d2 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.tcp;
 import java.net.InetSocketAddress;
 import org.opendaylight.netconf.tcp.netty.ProxyServer;
 import org.opendaylight.netconf.util.NetconfConfiguration;
-import org.osgi.framework.InvalidSyntaxException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,7 +29,7 @@ public class NetconfTCPProvider {
 
     // Called via blueprint
     @SuppressWarnings("unused")
-    public void init() throws InvalidSyntaxException {
+    public void init() {
         final InetSocketAddress address = netconfConfiguration.getTcpServerAddress();
 
         if (address.getAddress().isAnyLocalAddress()) {
index 58d5a304585da74d9849a96cc869aad029da8940..feabd71cf079bfa333fb9d66d1200f830ce4c6dc 100644 (file)
@@ -38,7 +38,7 @@ public class ProxyServer implements AutoCloseable {
                 .handler(new LoggingHandler(LogLevel.DEBUG))
                 .childHandler(new ChannelInitializer<SocketChannel>() {
                     @Override
-                    public void initChannel(SocketChannel ch) throws Exception {
+                    public void initChannel(SocketChannel ch) {
                         ch.pipeline().addLast(new ProxyServerHandler(clientBootstrap, localAddress));
                     }
                 });
index 4731b0fed965b899fc36fb35cf8b174c41697021..5843f41066f510c0caa59fbc19b9952aca435b52 100644 (file)
@@ -36,7 +36,7 @@ public class ProxyServerHandler extends ChannelInboundHandlerAdapter {
         final ProxyClientHandler clientHandler = new ProxyClientHandler(remoteCtx);
         clientBootstrap.handler(new ChannelInitializer<LocalChannel>() {
             @Override
-            public void initChannel(LocalChannel ch) throws Exception {
+            public void initChannel(LocalChannel ch) {
                 ch.pipeline().addLast(clientHandler);
             }
         });
index 06509e07617c62f131fff40192ae2b841232c716..9ec547004e6357b8ebb68340cf6c339897709d31 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>bundle-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 7275be18e6aaeda1620cffcf57e4557882d6c29f..99b541b846d58d342b07cacdf61c7523356fa440 100644 (file)
@@ -120,7 +120,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         if (!closed.compareAndSet(false, true)) {
             return;
         }
@@ -155,7 +155,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable {
 
             future.onComplete(new OnComplete<Object>() {
                 @Override
-                public void onComplete(final Throwable failure, final Object success) throws Throwable {
+                public void onComplete(final Throwable failure, final Object success) {
                     if (failure != null) {
                         LOG.error("Failed to refresh master actor data: {}", failure);
                         return;
index a87f77c2e9da1b2dc4bc805e5a10239dcbf38818..a71f7cb23f832a284c72b14867a6672691855a37 100644 (file)
@@ -209,10 +209,8 @@ public class NetconfTopologyManager
             dataChangeListenerRegistration = null;
         }
 
-        contexts.values().forEach(netconfTopologyContext -> close(netconfTopologyContext));
-
-        clusterRegistrations.values().forEach(
-            clusterSingletonServiceRegistration -> close(clusterSingletonServiceRegistration));
+        contexts.values().forEach(NetconfTopologyManager::close);
+        clusterRegistrations.values().forEach(NetconfTopologyManager::close);
 
         contexts.clear();
         clusterRegistrations.clear();
index e9ee161437a629d1292725c5267a1659a7848084..29423dddb18e6322c5795b122b4b3bae2c5a71d0 100644 (file)
@@ -54,7 +54,7 @@ public class ProxyYangTextSourceProvider implements RemoteYangTextSourceProvider
 
         scalaFuture.onComplete(new OnComplete<Object>() {
             @Override
-            public void onComplete(final Throwable failure, final Object success) throws Throwable {
+            public void onComplete(final Throwable failure, final Object success) {
                 if (failure != null) {
                     promise.failure(failure);
                     return;
index f81c7541f179f53a310daa9666b4af0691c520d5..a00bbb7f16df694ba2a9854a67994ea3ec1e09e9 100644 (file)
@@ -111,7 +111,7 @@ public class NetconfNodeActor extends AbstractUntypedActor {
 
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public void handleReceive(final Object message) throws Exception {
+    public void handleReceive(final Object message) {
         LOG.debug("{}:  received message {}", id, message);
 
         if (message instanceof CreateInitialMasterActorData) { // master
index c7a7d232c0c6329651d95f3961856dd125f363d9..abce08922b575af03a0ffa192c28f4087b307fd6 100644 (file)
@@ -32,7 +32,7 @@ class ReadAdapter {
     }
 
     @SuppressWarnings("checkstyle:IllegalThrows")
-    public void handle(final Object message, final ActorRef sender, final ActorRef self) throws Throwable {
+    public void handle(final Object message, final ActorRef sender, final ActorRef self) {
         if (message instanceof ReadRequest) {
 
             final ReadRequest readRequest = (ReadRequest) message;
index 0a2685965d7475e564887199e11a22d73ed22ffd..f96e76bf0becf56f080e18e0a93f7e2c257f32ee 100644 (file)
@@ -35,7 +35,7 @@ public final class ReadTransactionActor extends UntypedAbstractActor {
     }
 
     @Override
-    public void onReceive(final Object message) throws Throwable {
+    public void onReceive(final Object message) {
         if (message instanceof ReadActorMessage) {
             readAdapter.handle(message, sender(), self());
         } else {
index eddb34bc5ab07ad4db0ca5f559f7ec23322085c1..0220b62642b31ef7ce7457ce083055852a40faed 100644 (file)
@@ -49,7 +49,7 @@ public final class ReadWriteTransactionActor extends UntypedAbstractActor {
     }
 
     @Override
-    public void onReceive(final Object message) throws Throwable {
+    public void onReceive(final Object message) {
         if (message instanceof ReadActorMessage) {
             readAdapter.handle(message, sender(), self());
         } else if (message instanceof WriteActorMessage) {
index c8ab4237a74aa737a3020944716ea8c9cde7bc08..2a5c7ada48ecdd9a5cb4a62172786331ffe6d3cb 100644 (file)
@@ -50,7 +50,7 @@ public final class WriteTransactionActor extends UntypedAbstractActor {
     }
 
     @Override
-    public void onReceive(final Object message) throws Throwable {
+    public void onReceive(final Object message) {
         if (message instanceof WriteActorMessage) {
             writeAdapter.handle(message, sender(), context(), self());
         } else if (message instanceof ReceiveTimeout) {
index 3ab1cd9752f8c112ba67907fc1a7a48626443e42..7bf63ce9d275d1933daedac8e9226c8d0d0620f3 100644 (file)
@@ -18,11 +18,11 @@ import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.Objects;
 import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.controller.md.sal.common.api.MappingCheckedFuture;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologyUtils;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
index 82fbc41e05cc9b553c9859e6c59b1ea34d62a7fb..8b268e3149cee17f82aec65fe69396a028dd75dc 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.topology.singleton.impl.tx;
 
 import akka.actor.ActorRef;
@@ -23,11 +22,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.function.Consumer;
 import javax.annotation.concurrent.GuardedBy;
 import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.controller.md.sal.common.api.MappingCheckedFuture;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
 import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -79,7 +79,7 @@ public class ProxyReadWriteTransaction implements DOMDataReadWriteTransaction {
             return false;
         }
 
-        processTransactionOperation(facade -> facade.cancel());
+        processTransactionOperation(AsyncWriteTransaction::cancel);
         return true;
     }
 
index 06578783beb4673d5471edeb1e97b07b7aa649d7..53d7e6b7e525eb8ab5044afdd6fed20b2a8bbd7d 100644 (file)
@@ -37,7 +37,7 @@ public class NetconfConnectorDTO implements AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         if (communicator != null) {
             communicator.close();
         }
index c9ed78508f50b43a0d7a98fec397fb8e176635bc..62690ea6253e99ff923f75d97b20550be20aa886 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.topology.singleton.messages;
 
 import java.io.Externalizable;
-import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils;
@@ -43,12 +42,12 @@ public class NormalizedNodeMessage implements Externalizable {
     }
 
     @Override
-    public void writeExternal(final ObjectOutput out) throws IOException {
+    public void writeExternal(final ObjectOutput out) {
         SerializationUtils.serializePathAndNode(getIdentifier(), node, out);
     }
 
     @Override
-    public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
+    public void readExternal(final ObjectInput in) {
         SerializationUtils.deserializePathAndNode(in, this, APPLIER);
     }
 
index 500a97bced913c167f4cbbc2432df927c8e2022c..a7ad10784f30a6a52801595ca64a584e762bfeb9 100644 (file)
@@ -84,9 +84,10 @@ import org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRouter;
 import org.opendaylight.controller.md.sal.dom.broker.impl.mount.DOMMountPointServiceImpl;
 import org.opendaylight.controller.md.sal.dom.spi.DefaultDOMRpcResult;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
+import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
 import org.opendaylight.mdsal.eos.dom.simple.SimpleDOMEntityOwnershipService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
@@ -123,7 +124,6 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
@@ -167,7 +167,7 @@ public class MountPointEndToEndTest {
     @Mock private ScheduledThreadPool mockKeepaliveExecutor;
 
     @Mock private ActorSystemProvider mockMasterActorSystemProvider;
-    @Mock private MountProvisionListener masterMountPointListener;
+    @Mock private DOMMountPointListener masterMountPointListener;
     private final DOMMountPointService masterMountPointService = new DOMMountPointServiceImpl();
     private final DOMRpcRouter deviceRpcService = new DOMRpcRouter();
     private DOMClusterSingletonServiceProviderImpl masterClusterSingletonServiceProvider;
@@ -180,7 +180,7 @@ public class MountPointEndToEndTest {
     @Mock private ActorSystemProvider mockSlaveActorSystemProvider;
     @Mock private ClusterSingletonServiceProvider mockSlaveClusterSingletonServiceProvider;
     @Mock private ClusterSingletonServiceRegistration mockSlaveClusterSingletonServiceReg;
-    @Mock private MountProvisionListener slaveMountPointListener;
+    @Mock private DOMMountPointListener slaveMountPointListener;
     private final DOMMountPointService slaveMountPointService = new DOMMountPointServiceImpl();
     private DataBroker slaveDataBroker;
     private ActorSystem slaveSystem;
@@ -269,8 +269,8 @@ public class MountPointEndToEndTest {
                 mockMasterActorSystemProvider, eventExecutor, mockClientDispatcher, TOPOLOGY_ID, config,
                 masterMountPointService, mockEncryptionService) {
             @Override
-            protected NetconfTopologyContext newNetconfTopologyContext(NetconfTopologySetup setup,
-                    ServiceGroupIdentifier serviceGroupIdent, Timeout actorResponseWaitTime) {
+            protected NetconfTopologyContext newNetconfTopologyContext(final NetconfTopologySetup setup,
+                    final ServiceGroupIdentifier serviceGroupIdent, final Timeout actorResponseWaitTime) {
                 NetconfTopologyContext context =
                         super.newNetconfTopologyContext(setup, serviceGroupIdent, actorResponseWaitTime);
                 NetconfTopologyContext spiedContext = spy(context);
@@ -304,10 +304,10 @@ public class MountPointEndToEndTest {
         slaveNetconfTopologyManager = new NetconfTopologyManager(slaveDataBroker, mockRpcProviderRegistry,
                 mockSlaveClusterSingletonServiceProvider, mockKeepaliveExecutor, mockThreadPool,
                 mockSlaveActorSystemProvider, eventExecutor, mockClientDispatcher, TOPOLOGY_ID, config,
-                slaveMountPointService, mockEncryptionService)  {
+                slaveMountPointService, mockEncryptionService) {
             @Override
-            protected NetconfTopologyContext newNetconfTopologyContext(NetconfTopologySetup setup,
-                    ServiceGroupIdentifier serviceGroupIdent, Timeout actorResponseWaitTime) {
+            protected NetconfTopologyContext newNetconfTopologyContext(final NetconfTopologySetup setup,
+                    final ServiceGroupIdentifier serviceGroupIdent, final Timeout actorResponseWaitTime) {
                 NetconfTopologyContext spiedContext =
                         spy(super.newNetconfTopologyContext(setup, serviceGroupIdent, actorResponseWaitTime));
                 slaveNetconfTopologyContextFuture.set(spiedContext);
@@ -321,12 +321,12 @@ public class MountPointEndToEndTest {
 
         slaveTxChain = slaveDataBroker.createTransactionChain(new TransactionChainListener() {
             @Override
-            public void onTransactionChainSuccessful(TransactionChain<?, ?> chain) {
+            public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
             }
 
             @Override
-            public void onTransactionChainFailed(TransactionChain<?, ?> chain, AsyncTransaction<?, ?> transaction,
-                    Throwable cause) {
+            public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
+                    final AsyncTransaction<?, ?> transaction, final Throwable cause) {
                 LOG.error("Slave transaction chain failed", cause);
             }
         });
@@ -466,7 +466,7 @@ public class MountPointEndToEndTest {
         verify(mockSlaveClusterSingletonServiceReg).close();
     }
 
-    private void testDOMRpcService(DOMRpcService domRpcService)
+    private void testDOMRpcService(final DOMRpcService domRpcService)
             throws InterruptedException, ExecutionException, TimeoutException {
         testPutTopRpc(domRpcService, new DefaultDOMRpcResult((NormalizedNode<?, ?>)null));
         testPutTopRpc(domRpcService, null);
@@ -481,7 +481,7 @@ public class MountPointEndToEndTest {
         testFailedRpc(domRpcService, getTopRpcSchemaPath, null);
     }
 
-    private void testPutTopRpc(DOMRpcService domRpcService, DOMRpcResult result)
+    private void testPutTopRpc(final DOMRpcService domRpcService, final DOMRpcResult result)
             throws InterruptedException, ExecutionException, TimeoutException {
         ContainerNode putTopInput = bindingToNormalized.toNormalizedNodeRpcData(
                 new PutTopInputBuilder().setTopLevelList(Arrays.asList(new TopLevelListBuilder().setName("one")
@@ -489,13 +489,14 @@ public class MountPointEndToEndTest {
         testRpc(domRpcService, putTopRpcSchemaPath, putTopInput, result);
     }
 
-    private void testGetTopRpc(DOMRpcService domRpcService, DOMRpcResult result)
+    private void testGetTopRpc(final DOMRpcService domRpcService, final DOMRpcResult result)
             throws InterruptedException, ExecutionException, TimeoutException {
         testRpc(domRpcService, getTopRpcSchemaPath, null, result);
     }
 
-    private void testRpc(DOMRpcService domRpcService, SchemaPath schemaPath, NormalizedNode<?, ?> input,
-            DOMRpcResult result) throws InterruptedException, ExecutionException, TimeoutException {
+    private void testRpc(final DOMRpcService domRpcService, final SchemaPath schemaPath,
+            final NormalizedNode<?, ?> input, final DOMRpcResult result) throws InterruptedException,
+            ExecutionException, TimeoutException {
         final DOMRpcResult actual = invokeRpc(domRpcService, schemaPath, input, Futures.immediateCheckedFuture(result));
         if (result == null) {
             assertNull(actual);
@@ -520,8 +521,8 @@ public class MountPointEndToEndTest {
         }
     }
 
-    private void testFailedRpc(DOMRpcService domRpcService, SchemaPath schemaPath, NormalizedNode<?, ?> input)
-            throws InterruptedException, TimeoutException  {
+    private void testFailedRpc(final DOMRpcService domRpcService, final SchemaPath schemaPath,
+            final NormalizedNode<?, ?> input) throws InterruptedException, TimeoutException {
         try {
             invokeRpc(domRpcService, schemaPath, input, Futures.immediateFailedCheckedFuture(
                     new ClusteringRpcException("mock")));
@@ -532,8 +533,8 @@ public class MountPointEndToEndTest {
         }
     }
 
-    private DOMRpcResult invokeRpc(DOMRpcService domRpcService, SchemaPath schemaPath, NormalizedNode<?, ?> input,
-            CheckedFuture<DOMRpcResult, DOMRpcException> returnFuture)
+    private DOMRpcResult invokeRpc(final DOMRpcService domRpcService, final SchemaPath schemaPath,
+            final NormalizedNode<?, ?> input, final CheckedFuture<DOMRpcResult, DOMRpcException> returnFuture)
                     throws InterruptedException, ExecutionException, TimeoutException {
         topRpcImplementation.init(returnFuture);
         final ListenableFuture<DOMRpcResult> resultFuture = domRpcService.invokeRpc(schemaPath, input);
@@ -543,7 +544,7 @@ public class MountPointEndToEndTest {
         return resultFuture.get(5, TimeUnit.SECONDS);
     }
 
-    private static void testDOMDataBrokerOperations(DOMDataBroker dataBroker)
+    private static void testDOMDataBrokerOperations(final DOMDataBroker dataBroker)
             throws InterruptedException, ExecutionException, TimeoutException {
 
         DOMDataWriteTransaction writeTx = dataBroker.newWriteOnlyTransaction();
@@ -573,7 +574,7 @@ public class MountPointEndToEndTest {
         assertTrue(readTx.cancel());
     }
 
-    private static void writeNetconfNode(String cacheDir, DataBroker databroker)
+    private static void writeNetconfNode(final String cacheDir, final DataBroker databroker)
             throws InterruptedException, ExecutionException, TimeoutException {
         final NetconfNode netconfNode = new NetconfNodeBuilder()
                 .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1"))))
@@ -596,8 +597,8 @@ public class MountPointEndToEndTest {
         writeTx.commit().get(5, TimeUnit.SECONDS);
     }
 
-    private static void verifyDataInStore(DOMDataReadTransaction readTx, YangInstanceIdentifier path,
-            NormalizedNode<?, ?> expNode) throws InterruptedException, ExecutionException, TimeoutException {
+    private static void verifyDataInStore(final DOMDataReadTransaction readTx, final YangInstanceIdentifier path,
+            final NormalizedNode<?, ?> expNode) throws InterruptedException, ExecutionException, TimeoutException {
         final Optional<NormalizedNode<?, ?>> read = readTx.read(LogicalDatastoreType.CONFIGURATION, path)
                 .get(5, TimeUnit.SECONDS);
         assertTrue(read.isPresent());
@@ -607,7 +608,7 @@ public class MountPointEndToEndTest {
         assertTrue(exists);
     }
 
-    private static void verifyTopologyNodesCreated(DataBroker dataBroker) {
+    private static void verifyTopologyNodesCreated(final DataBroker dataBroker) {
         await().atMost(5, TimeUnit.SECONDS).until(() -> {
             try (ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
                 Optional<Topology> configTopology = readTx.read(LogicalDatastoreType.CONFIGURATION,
@@ -635,26 +636,27 @@ public class MountPointEndToEndTest {
         return dataBrokerTest;
     }
 
-    private void awaitMountPointNotPresent(DOMMountPointService mountPointService) {
+    private void awaitMountPointNotPresent(final DOMMountPointService mountPointService) {
         await().atMost(5, TimeUnit.SECONDS).until(
             () -> !mountPointService.getMountPoint(yangNodeInstanceId).isPresent());
     }
 
-    private static DOMDataBroker getDOMDataBroker(DOMMountPoint mountPoint) {
+    private static DOMDataBroker getDOMDataBroker(final DOMMountPoint mountPoint) {
         return getMountPointService(mountPoint, DOMDataBroker.class);
     }
 
-    private static DOMRpcService getDOMRpcService(DOMMountPoint mountPoint) {
+    private static DOMRpcService getDOMRpcService(final DOMMountPoint mountPoint) {
         return getMountPointService(mountPoint, DOMRpcService.class);
     }
 
-    private static <T extends DOMService> T getMountPointService(DOMMountPoint mountPoint, Class<T> serviceClass) {
+    private static <T extends DOMService> T getMountPointService(final DOMMountPoint mountPoint,
+            final Class<T> serviceClass) {
         final Optional<T> maybeService = mountPoint.getService(serviceClass);
         assertTrue(maybeService.isPresent());
         return maybeService.get();
     }
 
-    private DOMMountPoint awaitMountPoint(DOMMountPointService mountPointService) {
+    private DOMMountPoint awaitMountPoint(final DOMMountPointService mountPointService) {
         await().atMost(5, TimeUnit.SECONDS).until(() -> {
             return mountPointService.getMountPoint(yangNodeInstanceId).isPresent();
         });
@@ -662,7 +664,7 @@ public class MountPointEndToEndTest {
         return mountPointService.getMountPoint(yangNodeInstanceId).get();
     }
 
-    private RpcDefinition findRpcDefinition(String rpc) {
+    private RpcDefinition findRpcDefinition(final String rpc) {
         Module topModule = deviceSchemaContext.findModule(TOP_MODULE_NAME, topModuleInfo.getName().getRevision()).get();
         RpcDefinition rpcDefinition = null;
         for (RpcDefinition def: topModule.getRpcs()) {
@@ -681,18 +683,18 @@ public class MountPointEndToEndTest {
         private volatile CheckedFuture<DOMRpcResult, DOMRpcException> returnFuture;
 
         @Override
-        public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(DOMRpcIdentifier rpc,
-                NormalizedNode<?, ?> input) {
+        public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final DOMRpcIdentifier rpc,
+                final NormalizedNode<?, ?> input) {
             rpcInvokedFuture.set(new SimpleEntry<>(rpc, input));
             return returnFuture;
         }
 
-        void init(CheckedFuture<DOMRpcResult, DOMRpcException> retFuture) {
+        void init(final CheckedFuture<DOMRpcResult, DOMRpcException> retFuture) {
             this.returnFuture = retFuture;
             rpcInvokedFuture = SettableFuture.create();
         }
 
-        void verify(DOMRpcIdentifier expRpc, NormalizedNode<?, ?> expInput)
+        void verify(final DOMRpcIdentifier expRpc, final NormalizedNode<?, ?> expInput)
                 throws InterruptedException, ExecutionException, TimeoutException {
             final Entry<DOMRpcIdentifier, NormalizedNode<?, ?>> actual = rpcInvokedFuture.get(5, TimeUnit.SECONDS);
             assertEquals(expRpc, actual.getKey());
index 33c0b70525344aca04b7abd719d712314d74f35c..721817e809085435ab67da54f7b1a693f87b9e5d 100644 (file)
@@ -398,7 +398,7 @@ public class NetconfNodeManagerTest {
 
         @SuppressWarnings({ "rawtypes", "unchecked" })
         @Override
-        public void handleReceive(Object message) throws Exception {
+        public void handleReceive(Object message) {
             CompletableFuture dropFuture = messagesToDrop.remove(message.getClass());
             if (dropFuture != null) {
                 dropFuture.complete(message);
index 01a7749a123e69677f22afea57f370e68dea70a6..d2c3638f696605c9ada1df859efbf9772e99faf2 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.topology.singleton.impl;
 
 import static org.awaitility.Awaitility.await;
@@ -53,6 +52,7 @@ import org.opendaylight.controller.md.sal.binding.test.ConstantSchemaAbstractDat
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
@@ -76,7 +76,6 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 
 public class NetconfTopologyManagerTest {
     private static final int ACTOR_RESPONSE_WAIT_TIME = 10;
index f60f24cdbde305ce6d32878fd1d0b5964d620fcc..83bf71ebbc3fbbc7157804a02362a4ed84144e83 100644 (file)
@@ -64,7 +64,6 @@
         <dependency>
             <groupId>org.opendaylight.aaa</groupId>
             <artifactId>aaa-encrypt-service</artifactId>
-            <version>0.8.0-SNAPSHOT</version>
         </dependency>
     </dependencies>
 </project>
index 86f08cd5323a461a83e5111081869e43b0de2382..98c45544e2d2f070bf570ba4c89b42186acae548 100644 (file)
@@ -62,7 +62,7 @@ public class NetconfTopologyImpl extends AbstractNetconfTopology
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         // close all existing connectors, delete whole topology in datastore?
         for (final NetconfConnectorDTO connectorDTO : activeConnectors.values()) {
             connectorDTO.close();
index a3f37d6c92e7cde366e881cf8476ea73fb26d4f7..6e16741be273b17cec739ce38d38c4cf2c024fa9 100644 (file)
@@ -66,8 +66,7 @@ public final class NetconfMessageUtil {
         }
     }
 
-    public static Collection<String> extractCapabilitiesFromHello(final Document doc)
-            throws NetconfDocumentedException {
+    public static Collection<String> extractCapabilitiesFromHello(final Document doc) {
         XmlElement responseElement = XmlElement.fromDomDocument(doc);
         // Extract child element <capabilities> from <hello> with or without(fallback) the same namespace
         Optional<XmlElement> capabilitiesElement = responseElement
index 9c4df2b9b1eeedf91a9af2c49aba6c84ee1b70b8..f89d2848ef3cae6f52d11a19b1ce5e2b4738b496 100644 (file)
@@ -100,7 +100,7 @@ public final class SendErrorExceptionUtil {
         }
 
         @Override
-        public void operationComplete(final ChannelFuture channelFuture) throws Exception {
+        public void operationComplete(final ChannelFuture channelFuture) {
             Preconditions.checkState(channelFuture.isSuccess(), "Unable to send exception %s", sendErrorException,
                     channelFuture.cause());
         }
index 1f26843fc0a222bb7f2bf11b836d60059adacd37..7f959483f0dc8d777effee14e93b77b9b8e14858 100644 (file)
@@ -13,7 +13,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index 795a743c597b7a8054b424f7783cc67b88b18785..07c027e36da503ebcf95e1cbfbbdc7376fd1f5dc 100644 (file)
       <groupId>org.opendaylight.mdsal</groupId>
       <artifactId>mdsal-binding-generator-impl</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-topology</artifactId>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-inet-types-2013-07-15</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>yang-ext</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
       <artifactId>gson</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-module-junit4</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-api-mockito</artifactId>
+      <groupId>org.awaitility</groupId>
+      <artifactId>awaitility</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
index 590996ea19dd9f939b3dadfb695b1e81c41e2af5..261ba28d2978f9169c36cfdbf63253783be6d1b8 100644 (file)
@@ -146,7 +146,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
 
         } catch (final IOException e) {
             LOG.warn("Unable to download yang library from {}", url, e);
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
     }
 
@@ -163,13 +163,13 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
         } catch (final ExecutionException e) {
             LOG.warn("{}: Unable to detect available schemas, get to {} failed", deviceId,
                     MODULES_STATE_MODULE_LIST, e);
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
 
         if (moduleListNodeResult.getErrors().isEmpty() == false) {
             LOG.warn("{}: Unable to detect available schemas, get to {} failed, {}",
                     deviceId, MODULES_STATE_MODULE_LIST, moduleListNodeResult.getErrors());
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
 
 
@@ -182,7 +182,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
         }
 
         LOG.warn("{}: Unable to detect available schemas, get to {} was empty", deviceId, toId(ModulesState.QNAME));
-        return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+        return new LibraryModulesSchemas(Collections.emptyMap());
     }
 
     private static LibraryModulesSchemas create(final ContainerNode modulesStateNode) {
@@ -226,7 +226,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
 
         } catch (final IOException e) {
             LOG.warn("Unable to download yang library from {}", url, e);
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
     }
 
@@ -260,7 +260,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
                     contentType.equals("application/json") ? readJson(in) : readXml(in);
 
             if (!optionalModulesStateNode.isPresent()) {
-                return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+                return new LibraryModulesSchemas(Collections.emptyMap());
             }
 
             final NormalizedNode<?, ?> modulesStateNode = optionalModulesStateNode.get();
@@ -290,7 +290,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
             return new LibraryModulesSchemas(schemasMapping.build());
         } catch (final IOException e) {
             LOG.warn("Unable to download yang library from {}", connection.getURL(), e);
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
     }
 
@@ -382,7 +382,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
                 : QName.create(URI.create(moduleNameSpace), moduleName);
 
         try {
-            return Optional.<Map.Entry<QName, URL>>of(new AbstractMap.SimpleImmutableEntry<>(
+            return Optional.of(new AbstractMap.SimpleImmutableEntry<>(
                     moduleQName, new URL(schemaUriAsString.get())));
         } catch (final MalformedURLException e) {
             LOG.warn("Skipping library schema for {}. URL {} representing yang schema resource is not valid",
index c9ccf93fcbcf54385d1f99179218da152c55636e..fc100b3db80a2ec232db0ad3e15ceb8fdb0f7e42 100644 (file)
@@ -353,7 +353,7 @@ public class NetconfDevice
         }
 
         @Override
-        public DeviceSources call() throws Exception {
+        public DeviceSources call() {
             final NetconfDeviceSchemas availableSchemas =
                     stateSchemasResolver.resolve(deviceRpc, remoteSessionCapabilities, id);
             LOG.debug("{}: Schemas exposed by ietf-netconf-monitoring: {}", id,
index 822a43a22aace8b4706faf479fb3152193620b3c..5083b2edc04cf7d850cee6cffede1ddf8823b45b 100644 (file)
@@ -55,7 +55,7 @@ public final class NetconfStateSchemas implements NetconfDeviceSchemas {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetconfStateSchemas.class);
 
-    public static final NetconfStateSchemas EMPTY = new NetconfStateSchemas(Collections.<RemoteYangSchema>emptySet());
+    public static final NetconfStateSchemas EMPTY = new NetconfStateSchemas(Collections.emptySet());
 
     private static final YangInstanceIdentifier STATE_SCHEMAS_IDENTIFIER =
             YangInstanceIdentifier.builder().node(NetconfState.QNAME).node(Schemas.QNAME).build();
index eaece00f2861a9b0dd8b60e4e34e7147f9f82ae7..b962ae20757c034bbef70201a3fd6be0b2bf59c1 100644 (file)
@@ -86,7 +86,7 @@ public class NetconfDeviceCommunicator
             final RemoteDeviceId id,
             final RemoteDevice<NetconfSessionPreferences, NetconfMessage, NetconfDeviceCommunicator> remoteDevice,
             final int rpcMessageLimit) {
-        this(id, remoteDevice, Optional.<UserPreferences>absent(), rpcMessageLimit);
+        this(id, remoteDevice, Optional.absent(), rpcMessageLimit);
     }
 
     private NetconfDeviceCommunicator(
index e4d16e9394f4c92d22d7bf7b6dd2bc1e8faed0ca..b24eb89c9927bcc3da6d7dcd1b8bcc4405de9e75 100644 (file)
@@ -90,7 +90,8 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
 
     }
 
-    public void close() throws Exception {
+    @Override
+    public void close() {
         mountInstance.close();
         if (topologyDatastoreAdapter != null) {
             topologyDatastoreAdapter.close();
@@ -101,7 +102,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
         }
     }
 
-    public static final class MountInstance implements AutoCloseable {
+    public static class MountInstance implements AutoCloseable {
 
         private final DOMMountPointService mountService;
         private final RemoteDeviceId id;
@@ -109,7 +110,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
 
         private ObjectRegistration<DOMMountPoint> topologyRegistration;
 
-        public MountInstance(final DOMMountPointService mountService, final RemoteDeviceId id) {
+        MountInstance(final DOMMountPointService mountService, final RemoteDeviceId id) {
             this.mountService = Preconditions.checkNotNull(mountService);
             this.id = Preconditions.checkNotNull(id);
         }
@@ -153,7 +154,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
         }
 
         @Override
-        public synchronized void close() throws Exception {
+        public synchronized void close() {
             onTopologyDeviceDisconnected();
         }
 
index c9b22510270f514ed87720aca8e81735fa9c7343..5bc790363466de47a6b707715bb25efb5d79fb45 100644 (file)
@@ -50,7 +50,7 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public final class NetconfDeviceTopologyAdapter implements AutoCloseable {
+public class NetconfDeviceTopologyAdapter implements AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetconfDeviceTopologyAdapter.class);
 
index 6e3b0554c64e1cd68c6bfcdd2d8fd299bda73f43..eb48fdbd96ba56f49e372172855823758bf7ffee 100644 (file)
@@ -107,9 +107,9 @@ public abstract class AbstractWriteTx implements DOMDataWriteTransaction {
         }
 
         final DataContainerChild<?, ?> editStructure =
-                netOps.createEditConfigStrcture(Optional.<NormalizedNode<?, ?>>fromNullable(data),
+                netOps.createEditConfigStrcture(Optional.fromNullable(data),
                         Optional.of(ModifyAction.REPLACE), path);
-        editConfig(path, Optional.fromNullable(data), editStructure, Optional.<ModifyAction>absent(), "put");
+        editConfig(path, Optional.fromNullable(data), editStructure, Optional.absent(), "put");
     }
 
     @Override
@@ -125,9 +125,9 @@ public abstract class AbstractWriteTx implements DOMDataWriteTransaction {
         }
 
         final DataContainerChild<?, ?> editStructure =
-                netOps.createEditConfigStrcture(Optional.<NormalizedNode<?, ?>>fromNullable(data),
-                        Optional.<ModifyAction>absent(), path);
-        editConfig(path, Optional.fromNullable(data), editStructure, Optional.<ModifyAction>absent(), "merge");
+                netOps.createEditConfigStrcture(Optional.fromNullable(data),
+                        Optional.absent(), path);
+        editConfig(path, Optional.fromNullable(data), editStructure, Optional.absent(), "merge");
     }
 
     /**
@@ -144,9 +144,9 @@ public abstract class AbstractWriteTx implements DOMDataWriteTransaction {
     public synchronized void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
         checkEditable(store);
         final DataContainerChild<?, ?> editStructure =
-                netOps.createEditConfigStrcture(Optional.<NormalizedNode<?, ?>>absent(),
+                netOps.createEditConfigStrcture(Optional.absent(),
                         Optional.of(ModifyAction.DELETE), path);
-        editConfig(path, Optional.<NormalizedNode<?, ?>>absent(),
+        editConfig(path, Optional.absent(),
                 editStructure, Optional.of(ModifyAction.NONE), "delete");
     }
 
index f04dc916281b512101c2d1c2911bb793fa07ea1c..870e815ee0bf5a3ee25403d98ba54f62988b74f0 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.sal.connect.netconf.sal.tx;
 
 import com.google.common.base.Optional;
@@ -13,10 +12,10 @@ import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
+import org.opendaylight.controller.md.sal.common.api.MappingCheckedFuture;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
 import org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps;
 import org.opendaylight.netconf.sal.connect.netconf.util.NetconfRpcFutureCallback;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
@@ -25,7 +24,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 public final class ReadOnlyTx implements DOMDataReadOnlyTransaction {
 
     private static final Logger LOG  = LoggerFactory.getLogger(ReadOnlyTx.class);
index 0ba6cead958387ab434fd5bd40cbfc03b2cd1411..8cfc267ecd9e0c73ecf65beceecdd1f5c1bae93b 100644 (file)
@@ -19,7 +19,6 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.io.ByteArrayInputStream;
-import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import javax.annotation.Nonnull;
@@ -188,7 +187,7 @@ public final class NetconfRemoteSchemaYangSourceProvider implements SchemaSource
         }
 
         @Override
-        public InputStream openStream() throws IOException {
+        public InputStream openStream() {
             return new ByteArrayInputStream(schemaString.get().getBytes(StandardCharsets.UTF_8));
         }
     }
index 2c055b9cf18a4349b0b82862d25a4ffe97792b89..6218f59cb81fffd822e7cbdba1b7ca37f63196df 100644 (file)
@@ -257,7 +257,7 @@ public final class NetconfBaseOps {
     public ListenableFuture<DOMRpcResult> editConfigCandidate(final FutureCallback<? super DOMRpcResult> callback,
                                                               final DataContainerChild<?, ?> editStructure,
                                                               final boolean rollback) {
-        return editConfig(callback, NETCONF_CANDIDATE_QNAME, editStructure, Optional.<ModifyAction>absent(), rollback);
+        return editConfig(callback, NETCONF_CANDIDATE_QNAME, editStructure, Optional.absent(), rollback);
     }
 
     public ListenableFuture<DOMRpcResult> editConfigRunning(final FutureCallback<? super DOMRpcResult> callback,
@@ -269,7 +269,7 @@ public final class NetconfBaseOps {
     public ListenableFuture<DOMRpcResult> editConfigRunning(final FutureCallback<? super DOMRpcResult> callback,
                                                             final DataContainerChild<?, ?> editStructure,
                                                             final boolean rollback) {
-        return editConfig(callback, NETCONF_RUNNING_QNAME, editStructure, Optional.<ModifyAction>absent(), rollback);
+        return editConfig(callback, NETCONF_RUNNING_QNAME, editStructure, Optional.absent(), rollback);
     }
 
     public ListenableFuture<DOMRpcResult> editConfig(
index 2a0830658dc8d324eb04fd868ef51f744516f425..da65e5595934cc2655da5532c760a314e5371f45 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.netconf.sal.connect.netconf.util;
 
-import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
@@ -58,7 +57,7 @@ public final class NodeContainerProxy implements ContainerSchemaNode {
     }
 
     private static Map<QName, DataSchemaNode> asMap(final Collection<DataSchemaNode> childNodes) {
-        return Maps.uniqueIndex(childNodes, (Function<DataSchemaNode, QName>) DataSchemaNode::getQName);
+        return Maps.uniqueIndex(childNodes, DataSchemaNode::getQName);
     }
 
     @Override
index 793e6786d38703a69d3e433d9cbd2a2f5a1a2119..bc30126a528ac5139ebff66acc51905c759fbec5 100644 (file)
@@ -9,41 +9,48 @@ package org.opendaylight.netconf.sal.connect.util;
 
 import com.google.common.base.Preconditions;
 import java.net.InetSocketAddress;
+import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.HostBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.network.topology.topology.topology.types.TopologyNetconf;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 
 public final class RemoteDeviceId {
+    private static final String DEFAULT_TOPOLOGY_NAME = TopologyNetconf.QNAME.getLocalName();
+    private static final KeyedInstanceIdentifier<Topology, TopologyKey> DEFAULT_TOPOLOGY_IID =
+            InstanceIdentifier.create(NetworkTopology.class)
+            .child(Topology.class, new TopologyKey(new TopologyId(DEFAULT_TOPOLOGY_NAME)));
+    private static final YangInstanceIdentifier DEFAULT_TOPOLOGY_NODE = YangInstanceIdentifier.builder()
+            .node(NetworkTopology.QNAME).node(Topology.QNAME)
+            .nodeWithKey(Topology.QNAME, QName.create(Topology.QNAME, "topology-id"), DEFAULT_TOPOLOGY_NAME)
+            .node(Node.QNAME)
+            .build();
+    private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "node-id").intern();
 
     private final String name;
-    private final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier path;
-    private final InstanceIdentifier<Node> bindingPath;
     private final NodeKey key;
-    private final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier topologyPath;
-    private final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
-            .network.topology.rev131021.network.topology.topology.Node> topologyBindingPath;
+    private final YangInstanceIdentifier topologyPath;
+    private final KeyedInstanceIdentifier<Node, NodeKey> topologyBindingPath;
     private InetSocketAddress address;
     private Host host;
 
     private RemoteDeviceId(final String name) {
         this.name = Preconditions.checkNotNull(name);
+        this.topologyPath = DEFAULT_TOPOLOGY_NODE
+                .node(new NodeIdentifierWithPredicates(Node.QNAME, NODE_ID_QNAME, name));
         this.key = new NodeKey(new NodeId(name));
-        this.path = createBIPath(name);
-        this.bindingPath = createBindingPath(key);
-        this.topologyPath = createBIPathForTopology(name);
-        this.topologyBindingPath = createBindingPathForTopology(key);
+        this.topologyBindingPath = DEFAULT_TOPOLOGY_IID.child(Node.class, key);
     }
 
     public RemoteDeviceId(final String name, InetSocketAddress address) {
@@ -52,51 +59,6 @@ public final class RemoteDeviceId {
         this.host = buildHost();
     }
 
-    private static InstanceIdentifier<Node> createBindingPath(final NodeKey key) {
-        return InstanceIdentifier.builder(Nodes.class).child(Node.class, key).build();
-    }
-
-    private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBIPath(final String name) {
-        final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder builder =
-                org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder();
-        builder.node(Nodes.QNAME).node(Node.QNAME)
-                .nodeWithKey(Node.QNAME, QName.create(Node.QNAME.getNamespace(), Node.QNAME.getRevision(), "id"), name);
-
-        return builder.build();
-    }
-
-    private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network
-            .topology.rev131021.network.topology.topology.Node> createBindingPathForTopology(final NodeKey key) {
-        final InstanceIdentifier<NetworkTopology> networkTopology =
-                InstanceIdentifier.builder(NetworkTopology.class).build();
-        final KeyedInstanceIdentifier<Topology, TopologyKey> topology = networkTopology
-                .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())));
-        return topology
-                .child(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
-                        .network.topology.rev131021.network.topology.topology.Node.class,
-                        new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network
-                                .topology.topology.NodeKey(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
-                                .network.topology.rev131021.NodeId(key.getId().getValue())));
-    }
-
-    private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBIPathForTopology(
-            final String name) {
-        final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder builder =
-                org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder();
-        builder
-                .node(NetworkTopology.QNAME)
-                .node(Topology.QNAME)
-                .nodeWithKey(Topology.QNAME, QName.create(Topology.QNAME, "topology-id"),
-                        TopologyNetconf.QNAME.getLocalName())
-                .node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
-                        .network.topology.rev131021.network.topology.topology.Node.QNAME)
-                .nodeWithKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
-                        .network.topology.rev131021.network.topology.topology.Node.QNAME,
-                        QName.create(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
-                                .network.topology.rev131021.network.topology.topology.Node.QNAME, "node-id"), name);
-        return builder.build();
-    }
-
     private Host buildHost() {
         return HostBuilder.getDefaultInstance(address.getHostString());
     }
@@ -105,20 +67,11 @@ public final class RemoteDeviceId {
         return name;
     }
 
-    public InstanceIdentifier<Node> getBindingPath() {
-        return bindingPath;
-    }
-
-    public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier getPath() {
-        return path;
-    }
-
     public NodeKey getBindingKey() {
         return key;
     }
 
-    public InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
-            .network.topology.rev131021.network.topology.topology.Node> getTopologyBindingPath() {
+    public InstanceIdentifier<Node> getTopologyBindingPath() {
         return topologyBindingPath;
     }
 
@@ -147,19 +100,12 @@ public final class RemoteDeviceId {
         if (!(obj instanceof RemoteDeviceId)) {
             return false;
         }
-
         final RemoteDeviceId that = (RemoteDeviceId) obj;
-
-        if (!name.equals(that.name)) {
-            return false;
-        }
-        return bindingPath.equals(that.bindingPath);
+        return name.equals(that.name) && topologyBindingPath.equals(that.topologyBindingPath);
     }
 
     @Override
     public int hashCode() {
-        int result = name.hashCode();
-        result = 31 * result + bindingPath.hashCode();
-        return result;
+        return Objects.hash(name, topologyBindingPath);
     }
 }
diff --git a/netconf/sal-netconf-connector/src/main/yang/netconf-node-inventory.yang b/netconf/sal-netconf-connector/src/main/yang/netconf-node-inventory.yang
deleted file mode 100644 (file)
index 45fbd42..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-module netconf-node-inventory {
-    namespace "urn:opendaylight:netconf-node-inventory";
-    prefix "netinv";
-
-    import opendaylight-inventory { prefix inv; revision-date "2013-08-19";}
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-
-    revision "2014-01-08" {
-        description "Initial revision of Inventory model";
-    }
-
-    grouping netconf-node-fields {
-        status deprecated;
-        leaf connected {
-            type boolean;
-        }
-
-        leaf-list initial-capability {
-            type string;
-        }
-
-        leaf-list current-capability {
-            type string;
-        }
-
-        container pass-through {
-            when "../connected = true";
-            description
-                "When the underlying node is connected, its NETCONF context
-                is available verbatim under this container through the
-                mount extension.";
-        }
-    }
-
-    augment /inv:nodes/inv:node {
-        ext:augment-identifier "netconf-node";
-        status deprecated;
-        uses netconf-node-fields;
-    }
-}
index 3cc5c74a9fb44746efddbee52e6461bb0b801283..3618bf67d341a3f6d5519aaf840d689c1d0cf26e 100644 (file)
@@ -61,7 +61,6 @@ import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.ModuleImport;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
@@ -178,7 +177,7 @@ public class NetconfDeviceTest {
         // Make fallback attempt to fail due to empty resolved sources
         final SchemaResolutionException schemaResolutionException
                 = new SchemaResolutionException("fail first",
-                Collections.<SourceIdentifier>emptyList(), HashMultimap.<SourceIdentifier, ModuleImport>create());
+                Collections.emptyList(), HashMultimap.create());
         doReturn(Futures.immediateFailedFuture(schemaResolutionException))
                 .when(schemaFactory).createSchemaContext(anyCollectionOf(SourceIdentifier.class));
 
index 89f0ee26422afa6913ee219028d33618896d6404..05678f14ffa9ff3c3533b72998a6eaf0f7c54aea 100644 (file)
@@ -22,7 +22,6 @@ import java.util.Arrays;
 import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMNotification;
@@ -32,18 +31,14 @@ import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPrefe
 import org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
 
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({NetconfDeviceTopologyAdapter.class, NetconfDeviceSalProvider.MountInstance.class,
-        NetconfSessionPreferences.class})
 public class NetconfDeviceSalFacadeTest {
 
     private NetconfDeviceSalFacade deviceFacade;
 
+    @Mock
     private NetconfDeviceTopologyAdapter netconfDeviceTopologyAdapter;
+    @Mock
     private NetconfDeviceSalProvider.MountInstance mountInstance;
 
     @Mock
@@ -57,9 +52,6 @@ public class NetconfDeviceSalFacadeTest {
 
         deviceFacade = new NetconfDeviceSalFacade(remoteDeviceId, salProvider);
 
-        netconfDeviceTopologyAdapter = PowerMockito.mock(NetconfDeviceTopologyAdapter.class);
-        mountInstance = PowerMockito.mock(NetconfDeviceSalProvider.MountInstance.class);
-
         doReturn(netconfDeviceTopologyAdapter).when(salProvider).getTopologyDatastoreAdapter();
         doNothing().when(netconfDeviceTopologyAdapter)
                 .updateDeviceData(any(Boolean.class), any(NetconfDeviceCapabilities.class));
index d5cd4af37f4cc96d4b3d27e824bcc3cff894b3cc..91879669b3357b2549ffd708933d2e0c88a00dc8 100644 (file)
@@ -16,11 +16,9 @@ import static org.mockito.Mockito.verify;
 import static org.opendaylight.mdsal.common.api.CommitInfo.emptyFluentFuture;
 
 import com.google.common.base.Optional;
-import com.google.common.util.concurrent.MoreExecutors;
 import java.net.InetSocketAddress;
-import java.util.EnumMap;
 import java.util.concurrent.TimeUnit;
-import javassist.ClassPool;
+import org.awaitility.Awaitility;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
@@ -28,25 +26,13 @@ import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.controller.md.sal.binding.test.ConcurrentDataBrokerTestCustomizer;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
-import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
-import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
-import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
@@ -54,23 +40,18 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev15
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 public class NetconfDeviceTopologyAdapterTest {
 
     private final RemoteDeviceId id = new RemoteDeviceId("test", new InetSocketAddress("localhost", 22));
 
-    @Mock
-    private DataBroker broker;
     @Mock
     private WriteTransaction writeTx;
     @Mock
@@ -92,7 +73,6 @@ public class NetconfDeviceTopologyAdapterTest {
     @Before
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks(this);
-        doReturn(txChain).when(broker).createTransactionChain(any(TransactionChainListener.class));
         doReturn(writeTx).when(txChain).newWriteOnlyTransaction();
         doNothing().when(writeTx)
                 .put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(NetconfNode.class));
@@ -106,29 +86,11 @@ public class NetconfDeviceTopologyAdapterTest {
             "/schemas/yang-ext.yang", "/schemas/netconf-node-topology.yang",
             "/schemas/network-topology-augment-test@2016-08-08.yang");
         schemaContext.getModules();
-        final DOMSchemaService schemaService = createSchemaService();
-
-        final DOMStore operStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", schemaService);
-        final DOMStore configStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", schemaService);
-
-        final EnumMap<LogicalDatastoreType, DOMStore> datastores = new EnumMap<>(LogicalDatastoreType.class);
-        datastores.put(LogicalDatastoreType.CONFIGURATION, configStore);
-        datastores.put(LogicalDatastoreType.OPERATIONAL, operStore);
-
-        domDataBroker = new SerializedDOMDataBroker(datastores, MoreExecutors.newDirectExecutorService());
-
-        final ClassPool pool = ClassPool.getDefault();
-        final DataObjectSerializerGenerator generator = StreamWriterGenerator.create(JavassistUtils.forClassPool(pool));
-        final BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(generator);
-        final ModuleInfoBackedContext moduleInfoBackedContext = ModuleInfoBackedContext.create();
-        codecRegistry.onBindingRuntimeContextUpdated(
-                BindingRuntimeContext.create(moduleInfoBackedContext, schemaContext));
 
-        final GeneratedClassLoadingStrategy loading = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
-        final BindingToNormalizedNodeCodec bindingToNormalized =
-                new BindingToNormalizedNodeCodec(loading, codecRegistry);
-        bindingToNormalized.onGlobalContextUpdated(schemaContext);
-        dataBroker = new BindingDOMDataBrokerAdapter(domDataBroker, bindingToNormalized);
+        ConcurrentDataBrokerTestCustomizer customizer = new ConcurrentDataBrokerTestCustomizer(true);
+        domDataBroker = customizer.getDOMDataBroker();
+        dataBroker = customizer.createDataBroker();
+        customizer.updateSchema(schemaContext);
 
         transactionChain = dataBroker.createTransactionChain(new TransactionChainListener() {
             @Override
@@ -160,14 +122,13 @@ public class NetconfDeviceTopologyAdapterTest {
         adapter = new NetconfDeviceTopologyAdapter(id, transactionChain); //not a mock
         adapter.setDeviceAsFailed(null);
 
-        Optional<NetconfNode> netconfNode = dataBroker.newReadWriteTransaction().read(LogicalDatastoreType.OPERATIONAL,
-                id.getTopologyBindingPath().augmentation(NetconfNode.class)).checkedGet(5, TimeUnit.SECONDS);
-
-        assertEquals("Netconf node should be presented.", true, netconfNode.isPresent());
-        assertEquals("Connection status should be failed.",
-                NetconfNodeConnectionStatus.ConnectionStatus.UnableToConnect.getName(),
-                netconfNode.get().getConnectionStatus().getName());
-
+        Awaitility.await().atMost(5, TimeUnit.SECONDS).until(() -> {
+            Optional<NetconfNode> netconfNode = dataBroker.newReadWriteTransaction()
+                    .read(LogicalDatastoreType.OPERATIONAL, id.getTopologyBindingPath().augmentation(NetconfNode.class))
+                    .checkedGet(5, TimeUnit.SECONDS);
+            return netconfNode.isPresent() && netconfNode.get().getConnectionStatus()
+                    == NetconfNodeConnectionStatus.ConnectionStatus.UnableToConnect;
+        });
     }
 
     @Test
@@ -224,33 +185,6 @@ public class NetconfDeviceTopologyAdapterTest {
                 dataTestId, testNode.get().getValue());
     }
 
-    private DOMSchemaService createSchemaService() {
-        return new DOMSchemaService() {
-
-            @Override
-            public SchemaContext getSessionContext() {
-                return schemaContext;
-            }
-
-            @Override
-            public SchemaContext getGlobalContext() {
-                return schemaContext;
-            }
-
-            @Override
-            public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
-                    final SchemaContextListener listener) {
-                listener.onGlobalContextUpdated(getGlobalContext());
-                return new AbstractListenerRegistration<SchemaContextListener>(listener) {
-                    @Override
-                    protected void removeRegistration() {
-                        // No-op
-                    }
-                };
-            }
-        };
-    }
-
     @Test
     public void testRemoveDeviceConfiguration() throws Exception {
         doReturn(emptyFluentFuture()).when(writeTx).commit();
index edf7b96f307a1e925188807dd1a238dcf6cd8d4b..6b85cd1fc88f5f9ff3b6486572326373e3a9d32c 100644 (file)
@@ -32,7 +32,6 @@ import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.yangtools.util.xml.UntrustedXML;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.Revision;
-import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -56,7 +55,7 @@ public class NetconfRemoteSchemaYangSourceProviderTest {
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks(this);
 
-        final DOMRpcResult value = new DefaultDOMRpcResult(getNode(), Collections.<RpcError>emptySet());
+        final DOMRpcResult value = new DefaultDOMRpcResult(getNode(), Collections.emptySet());
         CheckedFuture<DOMRpcResult, DOMRpcException> response = Futures.immediateCheckedFuture(value);
         doReturn(response).when(service).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
 
index 5ddbfa5c2a20d64827d551f8609b3e88f709c57f..a884a887f209f8f244dd8daad51bd39f691a6f90 100644 (file)
@@ -58,17 +58,14 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.mon
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Schemas;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.ModifyAction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
 
 public class NetconfMessageTransformerTest {
@@ -165,7 +162,7 @@ public class NetconfMessageTransformerTest {
         assertNotNull(compositeNodeRpcResult.getResult());
         final DOMSource schemaContent =
             ((AnyXmlNode) ((ContainerNode) compositeNodeRpcResult.getResult()).getValue().iterator().next()).getValue();
-        assertThat(((Element) schemaContent.getNode()).getTextContent(),
+        assertThat(schemaContent.getNode().getTextContent(),
                 CoreMatchers.containsString("Random YANG SCHEMA"));
     }
 
@@ -261,7 +258,7 @@ public class NetconfMessageTransformerTest {
                 .nodeWithKey(Schema.QNAME, keys).build();
         final DataContainerChild<?, ?> editConfigStructure =
                 createEditConfigStructure(BaseSchema.BASE_NETCONF_CTX_WITH_NOTIFICATIONS.getSchemaContext(), id,
-                        Optional.<ModifyAction>absent(), Optional.<NormalizedNode<?, ?>>fromNullable(schemaNode));
+                        Optional.absent(), Optional.fromNullable(schemaNode));
 
         final DataContainerChild<?, ?> target = NetconfBaseOps.getTargetNode(NETCONF_CANDIDATE_QNAME);
 
index 5a6fe21722b41be5714921c7cdc0e45773a7e4c0..d94a302110ab91677cc7299b161842c5d45d4097 100644 (file)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
 <modules-are-note-here xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
     <module-set-id>21429371628890</module-set-id>
-</modules-are-note-here>
\ No newline at end of file
+</modules-are-note-here>
index d4e6683278d10178e5613fe1a81edc273a6c0b1e..9544559d0dbabc4e0d875437b96a03943cb6b9c5 100644 (file)
@@ -137,7 +137,7 @@ public class Execution implements Callable<Void> {
                 }
 
                 @Override
-                public Response onCompleted(Response response) throws Exception {
+                public Response onCompleted(Response response) {
                     semaphore.release();
                     return response;
                 }
@@ -155,7 +155,7 @@ public class Execution implements Callable<Void> {
     }
 
     @Override
-    public Void call() throws Exception {
+    public Void call() {
         if (invokeAsync) {
             this.invokeAsync();
         } else {
index afece1b190195919783e49555ddfd40efe173e86..eb2f93f1ac2557344183fbebd1bb66fc4c41534c 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.netconf.test.tool;
 
+import com.google.common.collect.ClassToInstanceMap;
+import com.google.common.collect.ImmutableClassToInstanceMap;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -24,6 +26,7 @@ import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroke
 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory;
 import org.opendaylight.controller.sal.core.spi.data.DOMStore;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaServiceExtension;
 import org.opendaylight.netconf.api.capability.Capability;
 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.netconf.impl.SessionIdProvider;
@@ -88,7 +91,7 @@ class MdsalOperationProvider implements NetconfOperationServiceFactory {
     @Override
     public AutoCloseable registerCapabilityListener(
             final CapabilityListener listener) {
-        listener.onCapabilitiesChanged(caps, Collections.<Capability>emptySet());
+        listener.onCapabilitiesChanged(caps, Collections.emptySet());
         return () -> {
         };
     }
@@ -153,7 +156,7 @@ class MdsalOperationProvider implements NetconfOperationServiceFactory {
             final DiscardChanges discardChanges = new DiscardChanges(
                 String.valueOf(currentSessionId), transactionProvider);
 
-            return Sets.<NetconfOperation>newHashSet(get, getConfig,
+            return Sets.newHashSet(get, getConfig,
                     editConfig, commit, lock, unLock, discardChanges);
         }
 
@@ -250,6 +253,11 @@ class MdsalOperationProvider implements NetconfOperationServiceFactory {
                         }
                     };
                 }
+
+                @Override
+                public ClassToInstanceMap<DOMSchemaServiceExtension> getExtensions() {
+                    return ImmutableClassToInstanceMap.of();
+                }
             };
         }
     }
index c19cc5574575f48298f8e7cb6bbde2150f16d361..dea8fa819913cdb77b9ea2be0be32b4f99eeebee 100644 (file)
@@ -268,7 +268,7 @@ public class NetconfDeviceSimulator implements Closeable {
     }
 
     private SshProxyServerConfiguration getSshConfiguration(final InetSocketAddress bindingAddress,
-            final LocalAddress tcpLocalAddress, final KeyPairProvider keyPairProvider) throws IOException {
+            final LocalAddress tcpLocalAddress, final KeyPairProvider keyPairProvider) {
         return new SshProxyServerConfigurationBuilder()
                 .setBindingAddress(bindingAddress)
                 .setLocalAddress(tcpLocalAddress)
@@ -370,7 +370,7 @@ public class NetconfDeviceSimulator implements Closeable {
             }
 
             @Override
-            public InputStream openStream() throws IOException {
+            public InputStream openStream() {
                 return getClass().getResourceAsStream(resource);
             }
         }), PotentialSchemaSource.create(sourceId, YangTextSchemaSource.class,
index 3f275681aae80eac644e285b975ac5e383b9d952..f67c96e2f4399de2c4fffaccd43b76a1f5d9f849 100644 (file)
@@ -259,7 +259,7 @@ public final class ScaleUtil {
 
     private static class TimeoutGuard implements Callable<Void> {
         @Override
-        public Void call() throws Exception {
+        public Void call() {
             resultsLog.warn("Timeout for scale test reached after: {} ..aborting", STOPWATCH);
             root.warn("Timeout for scale test reached after: {} ..aborting", STOPWATCH);
             System.exit(0);
@@ -286,7 +286,7 @@ public final class ScaleUtil {
             }
 
             @Override
-            public T call() throws Exception {
+            public T call() {
                 try {
                     return theCallable.call();
                 } catch (Exception e) {
index b49f39998b8222b269e4a1a6bad7a49aeaa7eb20..f2828d1eeda304e03a6c5ad0b85a9cd8cccf600d 100644 (file)
@@ -50,7 +50,7 @@ class SimulatedOperationProvider implements NetconfOperationServiceFactory {
     @Override
     public AutoCloseable registerCapabilityListener(
             final CapabilityListener listener) {
-        listener.onCapabilitiesChanged(caps, Collections.<Capability>emptySet());
+        listener.onCapabilitiesChanged(caps, Collections.emptySet());
         return () -> {
         };
     }
index 98d38dd475e46d4cafe5f426e301c94d73fe9b82..ecbb6de768f0b2dfe9ceff8b358231219e846ff9 100644 (file)
@@ -58,7 +58,7 @@ public class AsyncExecutionStrategy implements ExecutionStrategy {
                 }
 
                 @Override
-                public Response onCompleted(Response response) throws Exception {
+                public Response onCompleted(Response response) {
                     semaphore.release();
                     return response;
                 }
index 787aa7f4bac7630a56f18007c950326655a11026..59ff9260c9a8ae658e20f3f4b3f8c5a186f24093 100644 (file)
@@ -63,7 +63,7 @@ public class PerfClientCallable implements Callable<Void> {
     }
 
     @Override
-    public Void call() throws Exception {
+    public Void call() {
         executionStrategy.invoke();
         asyncHttpClient.closeAsynchronously();
         return null;
index 94eff3d25d8e64de4c06bf335651d7622df11ddd..55580f6bed01261615629ac42a3edb3cfae716e6 100644 (file)
@@ -69,7 +69,7 @@ public final class RestPerfClient {
 
     }
 
-    public static void main(String[] args) throws IOException {
+    public static void main(String[] args) {
 
         Parameters parameters = parseArgs(args, Parameters.getParser());
         parameters.validate();
index c2868795c95ec66cae7a68023388282ecb932e3f..9a29a1ec9dde73527163f637ce412bbfd3742c95 100644 (file)
@@ -59,7 +59,7 @@ public class StressClientCallable implements Callable<Boolean> {
     }
 
     @Override
-    public Boolean call() throws Exception {
+    public Boolean call() {
         executionStrategy.invoke();
         netconfClientSession.close();
         return Boolean.TRUE;
index 665442535ce7c5bf9be6cf2d5d45d0a3df2ce10d..390be4b4163b02df0875a5b627c1ac9a8f94b08e 100644 (file)
@@ -9,11 +9,9 @@ package org.opendaylight.netconf.test.tool.config;
 
 import com.google.common.collect.ImmutableSet;
 import java.io.File;
-import java.security.PublicKey;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
-import org.apache.sshd.server.session.ServerSession;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.auth.AuthProvider;
 import org.opendaylight.netconf.test.tool.operations.OperationsCreator;
@@ -53,12 +51,9 @@ public class Configuration {
         return true;
     };
 
-    public static final PublickeyAuthenticator DEFAULT_PUBLIC_KEY_AUTHENTICATOR = new PublickeyAuthenticator() {
-        @Override
-        public boolean authenticate(final String username, final PublicKey key, final ServerSession session) {
-            LOG.info("Auth with public key: {}", key);
-            return true;
-        }
+    public static final PublickeyAuthenticator DEFAULT_PUBLIC_KEY_AUTHENTICATOR = (username, key, session) -> {
+        LOG.info("Auth with public key: {}", key);
+        return true;
     };
 
     private int generateConfigsTimeout = (int) TimeUnit.MINUTES.toMillis(30);
index d806f768df47172845b67954a18759f92a8822b1..ed43703e3ec413c6e961162e9ec076bcd336768a 100644 (file)
@@ -33,7 +33,7 @@ class SettableRpc implements NetconfOperation {
     }
 
     @Override
-    public HandlingPriority canHandle(final Document message) throws DocumentedException {
+    public HandlingPriority canHandle(final Document message) {
         return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1000);
     }
 
index b93f59a41fbfe6b6a0ca85c0d907a14e64b6b98c..15ae253007b902bf53829a1f31db65e4460267b6 100644 (file)
@@ -44,7 +44,7 @@ public class OperationsProvider implements NetconfOperationServiceFactory {
     @Override
     public AutoCloseable registerCapabilityListener(
         final CapabilityListener listener) {
-        listener.onCapabilitiesChanged(caps, Collections.<Capability>emptySet());
+        listener.onCapabilitiesChanged(caps, Collections.emptySet());
         return () -> {
         };
     }
index 4276e5fb2f52c01a0ffa462b799b1fdc2e19a171..c985f45f9f93bc74d7900a4161e245dce416f9ae 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -24,9 +23,8 @@ public class SimulatedCommit extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     @Override
index c6f7fac0db34e99026e3a9e2c9ec82c3d72b72cb..8a42baa7a29e6d263ffcc6c15416ff7f93642333 100644 (file)
@@ -25,7 +25,6 @@ import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlRootElement;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
@@ -90,8 +89,7 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         long delayAggregator = 0;
 
         for (final Map.Entry<Notification, NetconfMessage> notification : notifications.entrySet()) {
@@ -105,7 +103,7 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im
                 }, delayAggregator, TimeUnit.SECONDS);
             }
         }
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     private static NetconfMessage parseNetconfNotification(String content) {
index ef5d06beb232a5643e145a773a236f79b0ab99e9..fe54d84f9fae69acc422a09235de5cffab93c0f2 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -24,8 +23,7 @@ public class SimulatedDiscardChanges extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
index 2e902c054ccf0065908145f2475c32acf6d627a2..509d9416de1846f679cd46324ba4a97244f09c02 100644 (file)
@@ -41,7 +41,7 @@ public class SimulatedEditConfig extends AbstractLastNetconfOperation {
             storage.setConfigList(configElementData.getChildElements());
         }
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     @Override
index 83897d0c98b81d1c50626039d5f2a62ce8f5669a..e5b197d3c37f4bf4aa51b29efc7d83de48dbda1c 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -27,8 +26,7 @@ public class SimulatedGet extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
 
         for (final XmlElement e : storage.getConfigList()) {
index 572fd961b742b1e9b90228651821aa749c37d05a..4c2a8592a9946111412974fc325b484fc2a7f31d 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.base.Optional;
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -60,8 +59,7 @@ public class SimulatedGetConfig extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
 
         for (final XmlElement e : storage.getConfigList()) {
index c7d4e0c13aa16bf31db82d89c119218287ca92b2..1dfbd1f4287e7f77bb1ddb591c916d0c4a39500a 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -24,8 +23,7 @@ public class SimulatedLock extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
index ce06534a9cd378398db21024d0744914252aaa7e..bfd0026c37bc42debe4debd7cea6c28382bbc181 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -24,9 +23,8 @@ public class SimulatedUnLock extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     @Override
index a3e449f05a1d971515d59e2a296f4f706a205c84..a6e0f07773dbadc6a6810fcec128903ab8ae9cd6 100644 (file)
@@ -32,7 +32,7 @@ class SettableRpc implements NetconfOperation {
     }
 
     @Override
-    public HandlingPriority canHandle(final Document message) throws DocumentedException {
+    public HandlingPriority canHandle(final Document message) {
         return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1000);
     }
 
index 51f80848bd2a86463cf333f7eb0e62f12ef1acfa..9ac7b647c0b22412c507331bb752145094809819 100644 (file)
@@ -11,7 +11,6 @@ import com.google.common.base.MoreObjects.ToStringHelper;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
@@ -102,7 +101,7 @@ public final class SchemaSourceCache<T extends SchemaSourceRepresentation>
             }
 
             @Override
-            public InputStream openStream() throws IOException {
+            public InputStream openStream() {
                 return TestToolUtils.getDataAsStream(cachedSource);
             }
         };
index fcdbc0a35ce1e4e615128d45c7421069bc0ea44c..cdceb338152049680f4676ad36e5c5f566883016 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index 2751298d071d71a46c8eeabbca506c48d925590c..82a1b5c4748b9340c876ef16c9918d4183a7bbcb 100644 (file)
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.powermock</groupId>
-            <artifactId>powermock-module-junit4</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.powermock</groupId>
-            <artifactId>powermock-api-mockito</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>commons-io</groupId>
             <artifactId>commons-io</artifactId>
index ff3541bbe2a6c2eda9d8447377ae3007b4326bc3..946f8d1a59cd4563109918ad2f3a9c7ab366b022 100644 (file)
@@ -22,6 +22,6 @@ public class YangLibRestApp extends Application {
 
     @Override
     public Set<Object> getSingletons() {
-        return Collections.<Object>singleton(this.yangLibService);
+        return Collections.singleton(this.yangLibService);
     }
 }
diff --git a/pom.xml b/pom.xml
index 6ae5c38495dffce5579840059c8a810453cd412f..a424ddba2742effe70ce22a919ff0559134c9aa1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index f3b131055cb5b7c1b248899bbfec7815825087b6..9c2e4a443596aba7fce6318ad6459fb06df29ed1 100644 (file)
@@ -7,7 +7,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
@@ -48,7 +48,7 @@
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>mockito-configuration</artifactId>
-      <version>2.0.7</version>
+      <version>2.0.9</version>
       <scope>test</scope>
     </dependency>
     <dependency>
index 494ccf8ec4cb5d305dad89d9cf54ed41ab3f3263..2ee8419f8f223f2de26baf1d806f78fee87557cd 100644 (file)
@@ -89,7 +89,7 @@ final class ProtocolSessionPromise<S extends ProtocolSession<?>> extends Default
         }
 
         @Override
-        public void operationComplete(final ChannelFuture cf) throws Exception {
+        public void operationComplete(final ChannelFuture cf) {
             synchronized (lock) {
 
                 LOG.debug("Promise {} connection resolved", lock);
index 87313f4e4cfb1140bc8f2c59e63dc39bddb06bcf..a0728514ed1a4a568938e7595903b808f5185917 100644 (file)
@@ -91,7 +91,7 @@ final class ReconnectPromise<S extends ProtocolSession<?>, L extends SessionList
         }
 
         @Override
-        public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
+        public void channelInactive(final ChannelHandlerContext ctx) {
             // This is the ultimate channel inactive handler, not forwarding
             if (promise.isCancelled()) {
                 return;
index 8c80b93ae6a9a1abead18c483195adda14bb3aae..f794520660fdf0fb77d54ec73a01d69e033bd5b0 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 6e595cf6b6a367255ba2b166c1cee27a5e83b7a2..100262f577eb8ddd1759c0a07ac90e092b90e086 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
       <groupId>org.opendaylight.odlparent</groupId>
       <artifactId>odlparent-lite</artifactId>
-      <version>3.1.2</version>
+      <version>3.1.3</version>
       <relativePath/>
     </parent>
 
index 1036757f498ef4957da1daf40ca19522914f1f7c..4eedb93245726b268e183bb1d26eee4962ed75bb 100644 (file)
@@ -177,12 +177,6 @@ public class MultivaluedHashMap<K, V> implements MultivaluedMap<K, V> {
     }
 
     private List<V> getValues(K key) {
-        List<V> list = store.get(key);
-        if (list == null) {
-            list = new LinkedList<>();
-            store.put(key, list);
-        }
-
-        return list;
+        return store.computeIfAbsent(key, k -> new LinkedList<>());
     }
 }
index 6a3c27d676ae3bdbcb569e129d41e797145974db..02373c8358a24a7217be98488147bc7b0d1ad5ac 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index e45ed6e793a00e6a0c64e62d9e2aaf5b742a0dee..707e397a4c1cf40095b3908ca5a426d72f0f68d8 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.netconf.md.sal.rest.schema;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -40,8 +39,8 @@ public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<Schem
     @Override
     public void writeTo(final SchemaExportContext context, final Class<?> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException,
-            WebApplicationException {
+            final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws
+        WebApplicationException {
         try {
             YinExportUtils.writeModuleAsYinText(context.getModule(), entityStream);
         } catch (final XMLStreamException e) {
index f90997354b2ab0305313ac8975e6207bd95c3b6a..85078714834113e203c0f9afa81edecd44ec161a 100644 (file)
@@ -75,8 +75,8 @@ public class JsonNormalizedNodeBodyReader
     @Override
     public NormalizedNodeContext readFrom(final Class<NormalizedNodeContext> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException,
-            WebApplicationException {
+            final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws
+        WebApplicationException {
         try {
             return readFrom(getInstanceIdentifierContext(), entityStream, isPost());
         } catch (final Exception e) {
index 53cc16f8d35053e7d06f95147c9c2741233291e4..852e3033492266baf46874f80fd351d5692b7df6 100644 (file)
@@ -83,7 +83,7 @@ public class JsonToPatchBodyReader extends AbstractIdentifierAwareJaxRsProvider
     public PatchContext readFrom(final Class<PatchContext> type, final Type genericType,
                                  final Annotation[] annotations, final MediaType mediaType,
                                  final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             return readFrom(getInstanceIdentifierContext(), entityStream);
         } catch (final Exception e) {
index c1ca200d13dc59ea80548004b5da2fdd56b0f995..13ceb2e63ca2e95f2a4813dc00a7c52dbb567cce 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.netconf.sal.rest.impl;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -57,7 +56,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     public void writeTo(final PatchStatusContext patchStatusContext, final Class<?> type, final Type genericType,
                         final Annotation[] annotations, final MediaType mediaType,
                         final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
 
         try {
             final XMLStreamWriter xmlWriter =
@@ -71,7 +70,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     }
 
     private static void writeDocument(final XMLStreamWriter writer, final PatchStatusContext context)
-            throws XMLStreamException, IOException {
+            throws XMLStreamException {
         writer.writeStartElement("", "yang-patch-status", "urn:ietf:params:xml:ns:yang:ietf-yang-patch");
         writer.writeStartElement("patch-id");
         writer.writeCharacters(context.getPatchId());
@@ -107,7 +106,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     }
 
     private static void reportErrors(final List<RestconfError> errors, final XMLStreamWriter writer)
-            throws IOException, XMLStreamException {
+            throws XMLStreamException {
         writer.writeStartElement("errors");
 
         for (final RestconfError restconfError : errors) {
index 510a6cf3440a32096246e461990f56f1d74f75f0..59b7a0f4820bd2ff62b00f13a73bee97fafee25a 100644 (file)
@@ -86,8 +86,8 @@ public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPro
     @Override
     public NormalizedNodeContext readFrom(final Class<NormalizedNodeContext> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException,
-            WebApplicationException {
+            final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws
+        WebApplicationException {
         try {
             return readFrom(entityStream);
         } catch (final RestconfDocumentedException e) {
index 071f8bda595a32125eea3606c8e04db1376f7af3..4f88e14d5c28d1b43a15fc6a0aab677fbf676e8c 100644 (file)
@@ -95,7 +95,7 @@ public class XmlToPatchBodyReader extends AbstractIdentifierAwareJaxRsProvider i
     public PatchContext readFrom(final Class<PatchContext> type, final Type genericType,
                                  final Annotation[] annotations, final MediaType mediaType,
                                  final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
 
         try {
             final InstanceIdentifierContext<?> path = getInstanceIdentifierContext();
index 1b53c7544ee9cb3a0a875d898594a7858646fa48..49427f1a749ef374b6c73387ee29ea0b0eaa6d9d 100644 (file)
@@ -594,21 +594,21 @@ public class BrokerFacade implements Closeable {
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = ((LeafNode<?>) child).getValue();
+                final Object nodeVal = child.getValue();
                 final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
                         Builders.leafBuilder((LeafSchemaNode) childSchema);
                 if (keys.contains(child.getNodeType())) {
-                    leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                    leafBuilder.withValue(child.getValue());
                     builder.withChild(leafBuilder.build());
                 } else {
                     if (trim) {
                         if (defaultVal == null || !defaultVal.equals(nodeVal)) {
-                            leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                            leafBuilder.withValue(child.getValue());
                             builder.withChild(leafBuilder.build());
                         }
                     } else {
                         if (defaultVal != null && defaultVal.equals(nodeVal)) {
-                            leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                            leafBuilder.withValue(child.getValue());
                             builder.withChild(leafBuilder.build());
                         }
                     }
@@ -649,17 +649,17 @@ public class BrokerFacade implements Closeable {
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = ((LeafNode<?>) child).getValue();
+                final Object nodeVal = child.getValue();
                 final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
                         Builders.leafBuilder((LeafSchemaNode) childSchema);
                 if (trim) {
                     if (defaultVal == null || !defaultVal.equals(nodeVal)) {
-                        leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                        leafBuilder.withValue(child.getValue());
                         builder.withChild(leafBuilder.build());
                     }
                 } else {
                     if (defaultVal != null && defaultVal.equals(nodeVal)) {
-                        leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                        leafBuilder.withValue(child.getValue());
                         builder.withChild(leafBuilder.build());
                     }
                 }
index bbc34cbcb52a8b2186ff442de3479384d9d7a55a..677ec32bde8b62223f61e0eeaf6b2ee1bb5cd864 100644 (file)
@@ -112,8 +112,8 @@ public final class ControllerContext implements SchemaContextListener, Closeable
 
     public static ControllerContext newInstance(DOMSchemaService schemaService, DOMMountPointService mountService,
             DOMSchemaService domSchemaService) {
-        final DOMYangTextSourceProvider yangTextSourceProvider =
-            (DOMYangTextSourceProvider) domSchemaService.getSupportedExtensions().get(DOMYangTextSourceProvider.class);
+        final DOMYangTextSourceProvider yangTextSourceProvider = domSchemaService.getExtensions()
+                .getInstance(DOMYangTextSourceProvider.class);
 
         return new ControllerContext(schemaService, mountService, yangTextSourceProvider);
     }
@@ -507,7 +507,7 @@ public final class ControllerContext implements SchemaContextListener, Closeable
             return childByQName((Module) container, name);
         } else {
             throw new IllegalArgumentException("Unhandled parameter types: "
-                    + Arrays.<Object>asList(container, name).toString());
+                    + Arrays.asList(container, name).toString());
         }
     }
 
@@ -538,7 +538,7 @@ public final class ControllerContext implements SchemaContextListener, Closeable
     private InstanceIdentifierContext<?> collectPathArguments(final InstanceIdentifierBuilder builder,
             final List<String> strings, final DataNodeContainer parentNode, final DOMMountPoint mountPoint,
             final boolean returnJustMountPoint) {
-        Preconditions.<List<String>>checkNotNull(strings);
+        Preconditions.checkNotNull(strings);
 
         if (parentNode == null) {
             return null;
index 19d34af0704c14e782ff5ba977ef54fd2711c81b..a78b9cc285862fd9aad9025017fc979342bb32ea 100644 (file)
@@ -40,7 +40,7 @@ public class RestconfProviderImpl extends AbstractMXBean
 
     public void start() {
         this.webSocketServerThread = new Thread(WebSocketServer.createInstance(
-                new String(websocketAddress.getValue()), websocketPort.getValue()));
+                websocketAddress.stringValue(), websocketPort.getValue()));
         this.webSocketServerThread.setName("Web socket server on port " + websocketPort);
         this.webSocketServerThread.start();
 
index 55ea16db73f3364fc73047cdff92b4c12d3006a7..877deda59f31cdb1363858a9b116412b55728c7b 100644 (file)
@@ -50,7 +50,7 @@ abstract class AbstractCommonSubscriber extends AbstractQueryParams implements B
     }
 
     @Override
-    public final void close() throws Exception {
+    public final void close() {
         this.registration.close();
         this.registration = null;
         unregister();
index 2a4d8bccbbd6387ed7e0a9d15fff39ead19acefb..ba7c2a3531d8929fd926f5a1763223a500ad11ce 100644 (file)
@@ -11,5 +11,5 @@ package org.opendaylight.netconf.sal.streams.listeners;
  * Type of the event.
  */
 enum EventType {
-    REGISTER, DEREGISTER, NOTIFY;
+    REGISTER, DEREGISTER, NOTIFY
 }
index a11d7bf803ba2829c0e8a43c649658e031d3cdc3..aa56910523bcf44e74e531838e3df95ae3c3e6f9 100755 (executable)
@@ -34,7 +34,6 @@ import io.netty.handler.codec.http.websocketx.WebSocketFrame;
 import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
 import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory;
 import io.netty.util.CharsetUtil;
-import java.io.IOException;
 import java.util.List;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfImpl;
 import org.opendaylight.netconf.sal.streams.listeners.ListenerAdapter;
@@ -54,7 +53,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
     private WebSocketServerHandshaker handshaker;
 
     @Override
-    protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) throws Exception {
+    protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) {
         if (msg instanceof FullHttpRequest) {
             handleHttpRequest(ctx, (FullHttpRequest) msg);
         } else if (msg instanceof WebSocketFrame) {
@@ -70,7 +69,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
      * @param req
      *            FullHttpRequest
      */
-    private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) throws Exception {
+    private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) {
         // Handle a bad request.
         if (!req.getDecoderResult().isSuccess()) {
             sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));
@@ -154,7 +153,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
      * @param frame
      *            {@link WebSocketFrame}
      */
-    private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) throws IOException {
+    private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) {
         if (frame instanceof CloseWebSocketFrame) {
             this.handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain());
             final String streamName = Notificator.createStreamNameFromUri(((CloseWebSocketFrame) frame).reasonText());
@@ -182,7 +181,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
     }
 
     @Override
-    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
+    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
         ctx.close();
     }
 
index c13535bf1946a16f0a7a084fca3c1e32668c38f8..365e982c49113908ec249951a04a92e554a6414b 100644 (file)
@@ -21,7 +21,7 @@ import io.netty.handler.codec.http.HttpServerCodec;
 public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
 
     @Override
-    protected void initChannel(final SocketChannel ch) throws Exception {
+    protected void initChannel(final SocketChannel ch) {
         ChannelPipeline pipeline = ch.pipeline();
         pipeline.addLast("codec-http", new HttpServerCodec());
         pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
index e968b710a1c9491c507b776cbc1280c1a04b408b..8ef05653dafcf74da73925cc44c68b36dc3182aa 100644 (file)
@@ -14,6 +14,7 @@ import static org.mockito.Mockito.mock;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableClassToInstanceMap;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -75,8 +76,10 @@ public final class TestRestconfUtils {
 
         DOMSchemaService mockSchemaService = mock(DOMSchemaService.class);
         doReturn(schemaContext).when(mockSchemaService).getGlobalContext();
+        doReturn(ImmutableClassToInstanceMap.of()).when(mockSchemaService).getExtensions();
 
         DOMSchemaService mockDomSchemaService = mock(DOMSchemaService.class);
+        doReturn(ImmutableClassToInstanceMap.of()).when(mockDomSchemaService).getExtensions();
 
         return ControllerContext.newInstance(mockSchemaService, mockMountService, mockDomSchemaService);
     }
index b6289b400976515319ecc04679cb542beec39da6..8c021273645b195caa0e9e588a80c09071aec0eb 100644 (file)
@@ -15,7 +15,6 @@ import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.FileNotFoundException;
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
 import javax.ws.rs.WebApplicationException;
@@ -280,7 +279,7 @@ public class JsonToNnTest extends AbstractBodyReaderTest {
         try {
             normalizedNodeContext = this.jsonBodyReader.readFrom(null, null, null,
                     this.mediaType, null, inputStream);
-        } catch (WebApplicationException | IOException e) {
+        } catch (WebApplicationException e) {
             // TODO Auto-generated catch block
         }
 
index 664a00cbb0675f556f4ac82316ccaec8366d370a..8bbfae93426b712c1864cc2f092e01f2e658ece8 100644 (file)
@@ -171,7 +171,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception to be thrown.");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.APPLICATION, ErrorTag.OPERATION_NOT_SUPPORTED,
-                    Optional.<String>absent(), Optional.<String>absent());
+                    Optional.absent(), Optional.absent());
         }
     }
 
@@ -218,7 +218,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception to be thrown.");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.TRANSPORT, ErrorTag.OPERATION_FAILED, Optional.of("foo"),
-                    Optional.<String>absent());
+                    Optional.absent());
             verifyRestconfDocumentedException(e, 1, ErrorType.RPC, ErrorTag.IN_USE, Optional.of("bar"),
                     Optional.of("app-tag"));
         }
@@ -249,7 +249,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
-                    Optional.<String>absent(), Optional.<String>absent());
+                    Optional.absent(), Optional.absent());
         }
     }
 
@@ -260,7 +260,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.RPC, ErrorTag.UNKNOWN_ELEMENT,
-                    Optional.<String>absent(), Optional.<String>absent());
+                    Optional.absent(), Optional.absent());
         }
     }
 
@@ -314,7 +314,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception.");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
-                    Optional.<String>absent(), Optional.<String>absent());
+                    Optional.absent(), Optional.absent());
         }
     }
 
index 5ac807007203169e260a001c237bda98204e1357..5f452874414db85939709363fe333a3d3ee19268 100644 (file)
@@ -449,7 +449,7 @@ public class JSONRestconfServiceImplTest {
 
         final String uriPath = "toaster:cancel-toast";
 
-        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.<String>absent());
+        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.absent());
 
         assertEquals("Output present", false, output.isPresent());
 
@@ -469,7 +469,7 @@ public class JSONRestconfServiceImplTest {
 
         final String uriPath = "toaster:testOutput";
 
-        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.<String>absent());
+        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.absent());
 
         assertEquals("Output present", true, output.isPresent());
         assertNotNull("Returned null response", output.get());
@@ -486,7 +486,7 @@ public class JSONRestconfServiceImplTest {
 
         final String uriPath = "toaster:cancel-toast";
 
-        this.service.invokeRpc(uriPath, Optional.<String>absent());
+        this.service.invokeRpc(uriPath, Optional.absent());
     }
 
     void testGet(final LogicalDatastoreType datastoreType) throws OperationFailedException {
index d9c9f55299fa7c8b7cd4e8da5bbaba9b4ab2f9f3..0701636fff48ca5c4ebb516bf76879e27f3e4dd1 100644 (file)
@@ -32,7 +32,6 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mockito;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
 import org.opendaylight.netconf.sal.rest.api.Draft02;
@@ -153,7 +152,7 @@ public class RestPostOperationTest extends JerseyTest {
     public void createConfigurationDataNullTest() throws UnsupportedEncodingException {
         when(brokerFacade.commitConfigurationDataPost(any(SchemaContext.class), any(YangInstanceIdentifier.class),
                 any(NormalizedNode.class), Mockito.anyString(), Mockito.anyString()))
-                .thenReturn(Futures.<Void, TransactionCommitFailedException>immediateCheckedFuture(null));
+                .thenReturn(Futures.immediateCheckedFuture(null));
 
         //FIXME : find who is set schemaContext
 //        final String URI_1 = "/config";
index 94a8284d82e980b8e6af0fd8970ec3a281888df6..81117609f88b10723754bede3caf25b9520a8fc8 100644 (file)
@@ -135,7 +135,7 @@ public class RestPutConfigTest {
         final PutResult result = Mockito.mock(PutResult.class);
         final CheckedFuture<Void, TransactionCommitFailedException> checkedFuture =
                 Futures.immediateCheckedFuture(null);
-        Mockito.when(this.brokerFacade.commitConfigurationDataPut(this.schemaContext, yii, data, null, null))
+        Mockito.when(this.brokerFacade.commitConfigurationDataPut(schemaContext, yii, data, null, null))
                 .thenReturn(result);
         Mockito.when(result.getFutureOfPutData()).thenReturn(checkedFuture);
         Mockito.when(result.getStatus()).thenReturn(Status.OK);
index 37a39b62d9c3874d5e0be9ae8eb498152dc0521b..a8c79f356015f1fdd61a149153d69cac77f9f82b 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.restconf.nb.rfc8040.jersey.providers;
 
 import com.google.common.collect.Iterables;
 import com.google.gson.stream.JsonReader;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
@@ -62,7 +61,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyRead
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected NormalizedNodeContext readBody(final InstanceIdentifierContext<?> path, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             return readFrom(path, entityStream, isPost());
         } catch (final Exception e) {
@@ -72,8 +71,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyRead
     }
 
     public static NormalizedNodeContext readFrom(
-            final InstanceIdentifierContext<?> path, final InputStream entityStream, final boolean isPost)
-            throws IOException {
+            final InstanceIdentifierContext<?> path, final InputStream entityStream, final boolean isPost) {
         final NormalizedNodeResult resultHolder = new NormalizedNodeResult();
         final NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder);
 
index 62fd33a51f1f7deba2bec1373fb3d92b83898b38..debebb9d311c92e1de70cef57448a7e5f0a27203 100644 (file)
@@ -73,7 +73,7 @@ public class XmlNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyReade
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected NormalizedNodeContext readBody(final InstanceIdentifierContext<?> path, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             final Document doc = UntrustedXML.newDocumentBuilder().parse(entityStream);
             return parse(path,doc);
index 232a9a7c03ff4b5eeac6a67f2c3c8189395bab23..2b39c8a0d5c0bfdf4604f1a347544cd21c43d927 100644 (file)
@@ -66,7 +66,7 @@ public class JsonToPatchBodyReader extends AbstractToPatchBodyReader {
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected PatchContext readBody(final InstanceIdentifierContext<?> path, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             return readFrom(path, entityStream);
         } catch (final Exception e) {
index e80dd14a16e84f98e7dc7bd07fe8563f1ea57b19..d7d264fdab92d6fd6cb789264f8f3bfb43b8d2e9 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -57,7 +56,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     public void writeTo(final PatchStatusContext patchStatusContext, final Class<?> type, final Type genericType,
                         final Annotation[] annotations, final MediaType mediaType,
                         final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
 
         try {
             final XMLStreamWriter xmlWriter =
@@ -71,7 +70,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     }
 
     private static void writeDocument(final XMLStreamWriter writer, final PatchStatusContext context)
-            throws XMLStreamException, IOException {
+            throws XMLStreamException {
         writer.writeStartElement("", "yang-patch-status", "urn:ietf:params:xml:ns:yang:ietf-yang-patch");
         writer.writeStartElement("patch-id");
         writer.writeCharacters(context.getPatchId());
@@ -107,7 +106,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     }
 
     private static void reportErrors(final List<RestconfError> errors, final XMLStreamWriter writer)
-            throws IOException, XMLStreamException {
+            throws XMLStreamException {
         writer.writeStartElement("errors");
 
         for (final RestconfError restconfError : errors) {
index 8364572de4874a2e2b8ca807e07375e9805eab32..bf452ec49f01f2a4781e7ccf0a40f44650bf6cc5 100644 (file)
@@ -76,7 +76,7 @@ public class XmlToPatchBodyReader extends AbstractToPatchBodyReader {
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected PatchContext readBody(final InstanceIdentifierContext<?> path, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             final Document doc = UntrustedXML.newDocumentBuilder().parse(entityStream);
             return parse(path, doc);
index 0cd7e327b0147e430e35856e0aa763d6c41bd29d..baae974370ffaafa8cac9b71105b83562854b11c 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.restconf.nb.rfc8040.jersey.providers.schema;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -42,8 +41,8 @@ public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<Schem
     @Override
     public void writeTo(final SchemaExportContext context, final Class<?> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException,
-            WebApplicationException {
+            final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws
+        WebApplicationException {
         try {
             YinExportUtils.writeModuleAsYinText(context.getModule(), entityStream);
         } catch (final XMLStreamException e) {
index f516e5f1d45f2882e0f599a6d6f0bfe3bc453d0a..c77fa97ae21dc101a2c6ce060072fe483c02bb46 100644 (file)
@@ -81,7 +81,7 @@ public abstract class AbstractIdentifierAwareJaxRsProvider<T> implements Message
     protected abstract T emptyBody(InstanceIdentifierContext<?> path);
 
     protected abstract T readBody(InstanceIdentifierContext<?> path, InputStream entityStream)
-            throws IOException, WebApplicationException;
+            throws WebApplicationException;
 
 
     private String getIdentifier() {
index 5efca62de73e4feba25732a261c68a3751e57ae6..3e31ea6d5f498af9c884f5fa5b2fd1b4facf56e6 100644 (file)
@@ -225,12 +225,7 @@ public class JSONRestconfServiceRfc8040Impl implements JSONRestconfService, Auto
         }
 
         final InputStream entityStream = new ByteArrayInputStream(payload.getBytes(StandardCharsets.UTF_8));
-        try {
-            return JsonNormalizedNodeBodyReader.readFrom(instanceIdentifierContext, entityStream, isPost);
-        } catch (final IOException e) {
-            propagateExceptionAs(uriPath, e, "GET");
-            return null;
-        }
+        return JsonNormalizedNodeBodyReader.readFrom(instanceIdentifierContext, entityStream, isPost);
     }
 
     private  String toJson(final PatchStatusContext patchStatusContext) throws IOException {
index a237f037cf0afddab2ff7d2aa2bc43a5a3d0b065..200605da4b626b77fd72c811bd14ad019aeb4064 100644 (file)
@@ -36,7 +36,6 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
-import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.OrderedLeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.OrderedMapNode;
@@ -383,7 +382,7 @@ public final class PutDataTransactionUtil {
         final NormalizedNode<?, ?> emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path);
         writeTx.merge(datastore, YangInstanceIdentifier.create(emptySubtree.getIdentifier()), emptySubtree);
         TransactionUtil.ensureParentsByMerge(path, schemaContext, writeTx);
-        for (final MapEntryNode child : ((MapNode) payload).getValue()) {
+        for (final MapEntryNode child : payload.getValue()) {
             final YangInstanceIdentifier childPath = path.node(child.getIdentifier());
             writeTx.put(datastore, childPath, child);
         }
index aca94271bdf65807d8fad4654ed045cdcb1dbda2..b54afbac506494568fcb600488dd1d22a55a2190 100644 (file)
@@ -355,7 +355,7 @@ public final class ReadDataTransactionUtil {
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = ((LeafNode<?>) child).getValue();
+                final Object nodeVal = child.getValue();
                 final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
                         Builders.leafBuilder((LeafSchemaNode) childSchema);
                 if (keys.contains(child.getNodeType())) {
@@ -410,7 +410,7 @@ public final class ReadDataTransactionUtil {
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = ((LeafNode<?>) child).getValue();
+                final Object nodeVal = child.getValue();
                 final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
                         Builders.leafBuilder((LeafSchemaNode) childSchema);
                 if (trim) {
index de38b6a75b686e5ed4a53c78b2fadcc4a04c05b1..02e69b589f51d75a51e999693fc0b7bdcd9db8e3 100644 (file)
@@ -75,9 +75,8 @@ public final class ServicesWrapper implements BaseServicesWrapper, TransactionSe
             final DOMSchemaService domSchemaService) {
         RestconfOperationsService restconfOpsService =
                 new RestconfOperationsServiceImpl(schemaCtxHandler, domMountPointServiceHandler);
-        final DOMYangTextSourceProvider yangTextSourceProvider =
-                (DOMYangTextSourceProvider) domSchemaService.getSupportedExtensions()
-                        .get(DOMYangTextSourceProvider.class);
+        final DOMYangTextSourceProvider yangTextSourceProvider = domSchemaService.getExtensions()
+                .getInstance(DOMYangTextSourceProvider.class);
         RestconfSchemaService restconfSchemaService =
                 new RestconfSchemaServiceImpl(schemaCtxHandler, domMountPointServiceHandler,
                 yangTextSourceProvider);
index fd971523c9df911c3c79a54431abfcc323dba15d..70b866186b276f0d48ea19338679e219a25dd8eb 100644 (file)
@@ -11,5 +11,5 @@ package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
  * Type of the event.
  */
 enum EventType {
-    REGISTER, DEREGISTER, NOTIFY;
+    REGISTER, DEREGISTER, NOTIFY
 }
index fce83008d5aded16545e797a0f114a845a7d2f2d..55aacdaee809052c9a91119dac63fe233509f817 100755 (executable)
@@ -34,7 +34,6 @@ import io.netty.handler.codec.http.websocketx.WebSocketFrame;
 import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
 import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory;
 import io.netty.util.CharsetUtil;
-import java.io.IOException;
 import java.util.List;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.ListenerAdapter;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.NotificationListenerAdapter;
@@ -54,7 +53,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
     private WebSocketServerHandshaker handshaker;
 
     @Override
-    protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) throws Exception {
+    protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) {
         if (msg instanceof FullHttpRequest) {
             handleHttpRequest(ctx, (FullHttpRequest) msg);
         } else if (msg instanceof WebSocketFrame) {
@@ -70,7 +69,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
      * @param req
      *            FullHttpRequest
      */
-    private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) throws Exception {
+    private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) {
         // Handle a bad request.
         if (!req.getDecoderResult().isSuccess()) {
             sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));
@@ -154,7 +153,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
      * @param frame
      *            {@link WebSocketFrame}
      */
-    private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) throws IOException {
+    private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) {
         if (frame instanceof CloseWebSocketFrame) {
             this.handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain());
             final String streamName = Notificator.createStreamNameFromUri(((CloseWebSocketFrame) frame).reasonText());
@@ -181,7 +180,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
     }
 
     @Override
-    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
+    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
         ctx.close();
     }
 
index 2c768d83a56915e371ba685aa0bae4265eb7d23c..5ab8639b2164f4b6a2656bb55a7642a5156b5bd0 100644 (file)
@@ -21,7 +21,7 @@ import io.netty.handler.codec.http.HttpServerCodec;
 public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
 
     @Override
-    protected void initChannel(final SocketChannel ch) throws Exception {
+    protected void initChannel(final SocketChannel ch) {
         ChannelPipeline pipeline = ch.pipeline();
         pipeline.addLast("codec-http", new HttpServerCodec());
         pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
index bad0decc33afc2f0047fa8308901a705e7fb5dd0..7e82357cf53c4a6c3d48fb98081ed7c81a372ff8 100644 (file)
@@ -22,6 +22,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
 import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableClassToInstanceMap;
 import com.google.common.io.Resources;
 import com.google.common.util.concurrent.Futures;
 import java.io.FileNotFoundException;
@@ -150,6 +151,8 @@ public class JSONRestconfServiceRfc8040ImplTest {
     public void setup() throws Exception {
         MockitoAnnotations.initMocks(this);
 
+        doReturn(ImmutableClassToInstanceMap.of()).when(domSchemaService).getExtensions();
+
         doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(mockReadOnlyTx).read(
                 eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class));
 
@@ -496,7 +499,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
 
         final String uriPath = "toaster:cancel-toast";
 
-        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.<String>absent());
+        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.absent());
 
         assertEquals("Output present", false, output.isPresent());
 
@@ -516,7 +519,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
 
         final String uriPath = "toaster:testOutput";
 
-        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.<String>absent());
+        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.absent());
 
         assertEquals("Output present", true, output.isPresent());
         assertNotNull("Returned null response", output.get());
@@ -533,7 +536,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
 
         final String uriPath = "toaster:cancel-toast";
 
-        this.service.invokeRpc(uriPath, Optional.<String>absent());
+        this.service.invokeRpc(uriPath, Optional.absent());
     }
 
     void testGet(final LogicalDatastoreType datastoreType) throws OperationFailedException {
index c16ebd5396633319fa32b309116d9d78f6e00ed5..116139dc3d1ee694cbe6d460861f6cce28bde681 100644 (file)
@@ -126,7 +126,7 @@ public class RestconfMappingNodeUtilTest {
         assertNotNull(normNode);
         final List<Object> listOfValues = new ArrayList<>();
 
-        for (final DataContainerChild<? extends PathArgument, ?> child : ((ContainerNode) normNode).getValue()) {
+        for (final DataContainerChild<? extends PathArgument, ?> child : normNode.getValue()) {
             if (child.getNodeType().equals(MonitoringModule.CONT_CAPABILITES_QNAME)) {
                 for (final DataContainerChild<? extends PathArgument, ?> dataContainerChild : ((ContainerNode) child)
                         .getValue()) {
@@ -216,10 +216,10 @@ public class RestconfMappingNodeUtilTest {
 
         for (final DataContainerChild<? extends PathArgument, ?> child : containerNode.getValue()) {
             if (child instanceof LeafNode) {
-                assertEquals(IetfYangLibrary.MODULE_SET_ID_LEAF_QNAME, ((LeafNode<?>) child).getNodeType());
+                assertEquals(IetfYangLibrary.MODULE_SET_ID_LEAF_QNAME, child.getNodeType());
             }
             if (child instanceof MapNode) {
-                assertEquals(IetfYangLibrary.MODULE_QNAME_LIST, ((MapNode) child).getNodeType());
+                assertEquals(IetfYangLibrary.MODULE_QNAME_LIST, child.getNodeType());
                 for (final MapEntryNode mapEntryNode : ((MapNode) child).getValue()) {
                     String name = "";
                     String revision = "";
@@ -227,10 +227,10 @@ public class RestconfMappingNodeUtilTest {
                             .getValue()) {
                         switch (dataContainerChild.getNodeType().getLocalName()) {
                             case IetfYangLibrary.SPECIFIC_MODULE_NAME_LEAF:
-                                name = String.valueOf(((LeafNode<?>) dataContainerChild).getValue());
+                                name = String.valueOf(dataContainerChild.getValue());
                                 break;
                             case IetfYangLibrary.SPECIFIC_MODULE_REVISION_LEAF:
-                                revision = String.valueOf(((LeafNode<?>) dataContainerChild).getValue());
+                                revision = String.valueOf(dataContainerChild.getValue());
                                 break;
                             default :
                                 LOG.info("Unknown local name '{}' of node.",
index 3c71908ca91eef629793d924e598e4f6180dce48..c01bee307e4c0973c59a8523f6053b1415e355fd 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index 1fd9ada4325d0b0cf0d7d09b339246a292533c41..b9f5290eff16f9be2ace3841f469cb13d52bf3d3 100644 (file)
@@ -285,7 +285,7 @@ public abstract class BaseYangSwaggerGenerator {
         LOG.debug("Adding path: [{}]", resourcePath);
         api.setPath(resourcePath.concat(getContent(dataStore)));
 
-        Iterable<DataSchemaNode> childSchemaNodes = Collections.<DataSchemaNode>emptySet();
+        Iterable<DataSchemaNode> childSchemaNodes = Collections.emptySet();
         if (node instanceof ListSchemaNode || node instanceof ContainerSchemaNode) {
             final DataNodeContainer dataNodeContainer = (DataNodeContainer) node;
             childSchemaNodes = dataNodeContainer.getChildNodes();
index 1ec5a2ebb2c620f3000e4ba163611be019deea7e..df9fca6d258d32c2bcd8a5444cbee82ae4fee6e6 100644 (file)
@@ -21,7 +21,7 @@ import java.util.concurrent.atomic.AtomicLong;
 import javax.ws.rs.core.UriInfo;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.netconf.sal.rest.doc.impl.BaseYangSwaggerGenerator;
 import org.opendaylight.netconf.sal.rest.doc.swagger.Api;
@@ -35,7 +35,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-public class MountPointSwagger implements MountProvisionListener, AutoCloseable {
+public class MountPointSwagger implements DOMMountPointListener, AutoCloseable {
 
     private static final String DATASTORES_REVISION = "-";
     private static final String DATASTORES_LABEL = "Datastores";
@@ -51,10 +51,10 @@ public class MountPointSwagger implements MountProvisionListener, AutoCloseable
 
     private final AtomicLong idKey = new AtomicLong(0);
 
-    private ListenerRegistration<MountProvisionListener> registration;
+    private ListenerRegistration<DOMMountPointListener> registration;
 
-    public MountPointSwagger(DOMSchemaService globalSchema, DOMMountPointService mountService,
-            BaseYangSwaggerGenerator swaggerGenerator) {
+    public MountPointSwagger(final DOMSchemaService globalSchema, final DOMMountPointService mountService,
+            final BaseYangSwaggerGenerator swaggerGenerator) {
         this.globalSchema = Objects.requireNonNull(globalSchema);
         this.mountService = Objects.requireNonNull(mountService);
         this.swaggerGenerator = Objects.requireNonNull(swaggerGenerator);
index 1fa3a01dc3922a7f478c54756580d5b0222b26e7..ee96a376db8f750a6e930d3c57bd843aba4328ee 100644 (file)
@@ -55,16 +55,10 @@ public final class RestDocgenUtil {
         final URI namespace = node.getQName().getNamespace();
         final Optional<Revision> revision = node.getQName().getRevision();
 
-        Map<Optional<Revision>, Module> revisionToModule = NAMESPACE_AND_REVISION_TO_MODULE.get(namespace);
-        if (revisionToModule == null) {
-            revisionToModule = new HashMap<>();
-            NAMESPACE_AND_REVISION_TO_MODULE.put(namespace, revisionToModule);
-        }
-        Module module = revisionToModule.get(revision);
-        if (module == null) {
-            module = schemaContext.findModule(namespace, revision).orElse(null);
-            revisionToModule.put(revision, module);
-        }
+        Map<Optional<Revision>, Module> revisionToModule =
+            NAMESPACE_AND_REVISION_TO_MODULE.computeIfAbsent(namespace, k -> new HashMap<>());
+        Module module =
+            revisionToModule.computeIfAbsent(revision, k -> schemaContext.findModule(namespace, k).orElse(null));
         if (module != null) {
             return module.getName() + ":" + node.getQName().getLocalName();
         }
index cd76f785d7f2d7a80066d7d27a3562c13d7b8614..ddb047fc86de00772f5770ad4e09f1ec467726e9 100644 (file)
@@ -16,7 +16,7 @@
           type='text/css'/>\r
     <link href='../../explorer/css/screen.css' media='screen' rel='stylesheet'\r
           type='text/css'/>\r
-    <link rel="stylesheet" type="text/css" href="../../explorer/css/opendaylight.css">\r
+    <link rel="stylesheet" type="text/css" href="../../explorer/static/opendaylight.css">\r
     <link rel="stylesheet" type="text/css"\r
           href="../../explorer/css/ui-lightness/jquery-ui-1.10.4.custom.min.css">\r
     <script type="text/javascript" src="../../explorer/lib/shred.bundle.js"></script>\r
index f12616bc4b910d8127fc7269ea8bd5bc6b863dd5..b2f76fa6db28e1201c4e8e107c21898e03295d79 100644 (file)
@@ -8,7 +8,7 @@
        type='text/css' />\r
 <link href='css/screen.css' media='screen' rel='stylesheet'\r
        type='text/css' />\r
-<link rel="stylesheet" type="text/css" href="/css/opendaylight.css">\r
+<link rel="stylesheet" type="text/css" href="static/opendaylight.css">\r
 <link rel="stylesheet" type="text/css"\r
        href="css/ui-lightness/jquery-ui-1.10.4.custom.min.css">\r
 <script type="text/javascript" src="lib/shred.bundle.js"></script>\r
index d5795e36f14699ca45f41312b6d7476594d1204d..b55df02c74e086b7ac39094cb21e41355cf274ce 100644 (file)
@@ -11,12 +11,12 @@ import com.google.common.base.Preconditions;
 import java.net.URL;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
+import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
 import org.opendaylight.netconf.sal.restconf.broker.SalRemoteServiceBroker;
 import org.opendaylight.yangtools.restconf.client.RestconfClientFactory;
 import org.opendaylight.yangtools.restconf.client.api.RestconfClientContext;
 import org.opendaylight.yangtools.restconf.client.api.UnsupportedProtocolException;
 import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextHolder;
 import org.slf4j.Logger;