Merge "Fix error reporting for PUT/POST"
authorJakub Morvay <jmorvay@cisco.com>
Tue, 21 Feb 2017 09:33:01 +0000 (09:33 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 21 Feb 2017 09:33:01 +0000 (09:33 +0000)
122 files changed:
features/netconf/odl-netconf-util/pom.xml
features/restconf/odl-restconf-noauth/pom.xml
features/yanglib/odl-yanglib/pom.xml
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/CurrentSchemaContext.java
netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MdsalMonitoringMapperFactory.java
netconf/mdsal-netconf-monitoring/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriterTest.java
netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSession.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactory.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/conf/NetconfClientConfiguration.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/conf/NetconfClientConfigurationBuilder.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/conf/NetconfReconnectingClientConfiguration.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/conf/NetconfReconnectingClientConfigurationBuilder.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/NetconfClientConfigurationTest.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/NetconfClientDispatcherImplTest.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/NetconfReconnectingClientConfigurationTest.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/SimpleNetconfClientSessionListenerTest.java
netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/commands/NetconfCommandsImplCallsTest.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerDispatcherImpl.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSessionNegotiator.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/AggregatedNetconfOperationServiceFactory.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivator.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfOperationServiceFactoryTracker.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/ConcurrentClientsTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/ExiEncodeDecodeTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/mapping/operations/DefaultCloseSessionTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfOperationServiceFactoryTrackerTest.java
netconf/netconf-it/src/test/java/org/opendaylight/netconf/it/NetconfITSecureTestTool.java
netconf/netconf-monitoring/src/test/java/org/opendaylight/netconf/monitoring/xml/JaxBSerializerTest.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractChannelInitializer.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfHelloMessageToXMLEncoder.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/NetconfStartExiMessage.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/NetconfHelloMessageToXMLEncoderTest.java
netconf/netconf-notifications-api/src/test/java/org/opendaylight/netconf/notifications/NetconfNotificationTest.java
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java
netconf/netconf-ssh/src/test/java/org/opendaylight/netconf/netty/ProxyServer.java
netconf/netconf-ssh/src/test/java/org/opendaylight/netconf/ssh/authentication/SSHServerTest.java
netconf/netconf-topology-singleton/pom.xml
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/api/NetconfDOMTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/api/RemoteOperationTxProcessor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteOperationTxProcessorImpl.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/tx/NetconfMasterDOMTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/OpenTransaction.java [new file with mode: 0644]
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java
netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/TopologyUtil.java
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SubtreeFilter.java
netconf/netconf-util/src/test/java/org/opendaylight/netconf/util/osgi/NetconfConfigUtilTest.java
netconf/netconf-util/src/test/java/org/opendaylight/netconf/util/osgi/NetconfConfigurationTest.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/api/NetconfDeviceSchemas.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/SchemalessNetconfDeviceRpc.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/sal/tx/ReadWriteTx.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformer.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/SchemalessNetconfDeviceTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfDeviceCommunicatorTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/KeepaliveSalFacadeTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/ReadWriteTxTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProviderTest.java
netconf/tools/netconf-cli/src/main/java/org/opendaylight/netconf/cli/reader/impl/BasicDataHolderReader.java
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/Main.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/TesttoolNegotiationFactory.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConfig.java
netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibRestApp.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/restconf/impl/FakeContainerSchemaNode.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/restconf/impl/FakeRestconfModule.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/wrapper/services/ServicesWrapperImpl.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/impl/RestconfDataServiceImpl.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/impl/RestconfInvokeOperationsServiceImpl.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/CreateStreamUtil.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/ReadDataTransactionUtil.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/RestconfStreamsConstants.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/SubscribeToStreamUtil.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/parser/ParserIdentifier.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/AbstractBodyReaderTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonBasicDataTypesTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/input/to/cnsn/test/RestPutListDataTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/nn/test/JsonLeafrefToNnTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/nn/test/JsonToNnTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/json/test/NnJsonChoiceCaseTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/json/test/NnToJsonLeafrefType.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/json/test/NnToJsonWithAugmentTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/xml/test/NnInstanceIdentifierToXmlTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/xml/test/NnToXmlWithChoiceTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/xml/test/NnToXmlWithDataFromSeveralModulesTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/BrokerFacadeTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/Bug3595Test.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CnSnToXmlAndJsonInstanceIdentifierTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CodecsExceptionsCatchingTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CutDataToCorrectDepthTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/InvokeRpcMethodTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/MediaTypesTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestCodecExceptionsTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestDeleteOperationTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetAugmentedElementWhenEqualNamesTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutOperationTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestconfDocumentedExceptionMapperTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestconfImplTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/URIParametersParsing.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/URITest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/YangAndXmlAndDataSchemaLoader.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/websockets/test/RestStream.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/streams/listeners/NotificationListenerTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/restful/services/impl/RestconfDataServiceImplTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/validation/RestconfValidationTest.java
restconf/sal-restconf-broker/src/main/java/org/opendaylight/netconf/sal/restconf/broker/SalRemoteServiceBroker.java
restconf/sal-restconf-broker/src/main/java/org/opendaylight/netconf/sal/restconf/broker/event/RemoteDataChangeEvent.java
restconf/sal-restconf-broker/src/main/java/org/opendaylight/netconf/sal/restconf/broker/impl/DataBrokerServiceImpl.java
restconf/sal-restconf-broker/src/main/java/org/opendaylight/netconf/sal/restconf/broker/impl/NotificationServiceImpl.java
restconf/sal-restconf-broker/src/main/java/org/opendaylight/netconf/sal/restconf/broker/transactions/RemoteDataModificationTransaction.java

index b27c3de614aa319ecb9c7218f5b08aa266f8836d..f65cab9b516bd7360ca7a3c104c3c8395eea6bf3 100644 (file)
@@ -50,7 +50,6 @@
             <version>${project.version}</version>
             <type>cfg</type>
             <classifier>config</classifier>
-            <scope>provided</scope>
         </dependency>
     </dependencies>
 </project>
\ No newline at end of file
index 10ddf3b3efb9d81b8ca6a1aa3c3146fc439b04fa..8f9a1a77007f164a05abf49c83583c826a9a13e8 100644 (file)
@@ -95,7 +95,7 @@
         </dependency>
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>odl-karaf-feat-war</artifactId>
+            <artifactId>odl-karaf-feat-jetty</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
             <version>${project.version}</version>
             <type>xml</type>
             <classifier>config</classifier>
-            <scope>provided</scope>
         </dependency>
         <dependency>
             <!-- finalname="${config.configfile.directory}/${config.restconf.service.configfile}" -->
             <version>${project.version}</version>
             <type>xml</type>
             <classifier>configrestconfservice</classifier>
-            <scope>provided</scope>
         </dependency>
     </dependencies>
 </project>
index 2ae5b95e21911b9d492b36624875742a2c5a823d..c80c9387bf21fbcd993b2ca8dff178572c0d98e4 100644 (file)
@@ -60,7 +60,7 @@
 
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>odl-karaf-feat-war</artifactId>
+            <artifactId>odl-karaf-feat-jetty</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index fa7f273465b24a665815026412a8e13f3a2afd57..b117c36676178b2adae4b60cb3017a318620603a 100644 (file)
@@ -14,8 +14,8 @@ import java.util.Collections;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicReference;
 import org.opendaylight.controller.config.util.capability.Capability;
-import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
index 8ed7a7b173be0e580dc047bc6cf9a8c4e62e9a9f..0fe866d847e993942e566cafacfe8d207d685017 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.controller.config.yang.netconf.mdsal.monitoring;
 
+import java.util.Collections;
+import java.util.Set;
 import org.opendaylight.controller.config.util.capability.Capability;
 import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
@@ -17,9 +19,6 @@ import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
 import org.opendaylight.netconf.monitoring.GetSchema;
 
-import java.util.Collections;
-import java.util.Set;
-
 public class MdsalMonitoringMapperFactory implements NetconfOperationServiceFactory, AutoCloseable {
 
     private final NetconfOperationService operationService;
index 953d878d1eb0c785dedc7b61a5150b2d33f70de4..e7689f35db75eecbc1a812fc5091302bf47cc9a2 100644 (file)
@@ -18,8 +18,6 @@ import javax.annotation.Nullable;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 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.yang.library.rev160409.ModulesState;
index 1169fc810746ee70519501cfeeff336fb56f7799..e27f72b5c927ccb8d70d80e1de9ba7de1204780a 100644 (file)
@@ -12,10 +12,10 @@ import io.netty.channel.Channel;
 import io.netty.handler.codec.ByteToMessageDecoder;
 import io.netty.handler.codec.MessageToByteEncoder;
 import java.util.Collection;
+import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.nettyutil.AbstractNetconfSession;
 import org.opendaylight.netconf.nettyutil.handler.NetconfMessageToXMLEncoder;
 import org.opendaylight.netconf.nettyutil.handler.NetconfXMLToMessageDecoder;
-import org.opendaylight.netconf.api.NetconfMessage;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 2d6cac2ba01c8b95886c6bc23e82cf63b12973ce..a49ac1a26d794651d754f1551350e74fcad43750 100644 (file)
@@ -15,13 +15,13 @@ import io.netty.channel.Channel;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
 import java.util.Set;
-import org.opendaylight.netconf.nettyutil.handler.exi.NetconfStartExiMessage;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 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;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
+import org.opendaylight.netconf.nettyutil.handler.exi.NetconfStartExiMessage;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 import org.opendaylight.protocol.framework.SessionNegotiatorFactory;
index cad5391481c26fbda424192468246ccb0b7c8318..59a8d1f446169b123b2065bd32504233666eca62 100644 (file)
@@ -12,9 +12,9 @@ import com.google.common.base.MoreObjects.ToStringHelper;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import java.net.InetSocketAddress;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.client.NetconfClientSessionListener;
+import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 
 public class NetconfClientConfiguration {
index 368cc3b27f591b9e61de2fb0ada1badc75c16827..d1f2b42d4ec51e5247ebfe25affe5fbe6085898a 100644 (file)
@@ -8,9 +8,9 @@
 package org.opendaylight.netconf.client.conf;
 
 import java.net.InetSocketAddress;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.client.NetconfClientSessionListener;
+import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 
 public class NetconfClientConfigurationBuilder {
index f993f3cf6e146872a64576101c6e34f6454456db..dcb9ec310dd623813779820c306801e38a22d044 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.netconf.client.conf;
 import com.google.common.base.MoreObjects.ToStringHelper;
 import com.google.common.base.Preconditions;
 import java.net.InetSocketAddress;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.client.NetconfClientSessionListener;
+import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
 
index 8052c77e7b2c532a4e1139fe24ed868315b2c8ba..dfa334c5b36b069fe81bc861caed083987532703 100644 (file)
@@ -8,9 +8,9 @@
 package org.opendaylight.netconf.client.conf;
 
 import java.net.InetSocketAddress;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.client.NetconfClientSessionListener;
+import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
 
index 7df2e6705f8149aeb3f554b216f11791cf329e8e..0d4f0addf90408a3cb7f09d3300af953d75833c7 100644 (file)
@@ -13,10 +13,10 @@ import java.net.InetSocketAddress;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 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.protocol.framework.ReconnectStrategy;
 
 public class NetconfClientConfigurationTest {
index 82172d771ec15676ed33a8b909c8c2d33d0f0bea..c2c1289555e0d136e96581b4413b166fcf2dd4cb 100644 (file)
@@ -23,11 +23,11 @@ import java.net.InetSocketAddress;
 import java.util.concurrent.Future;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.netconf.client.conf.NetconfReconnectingClientConfigurationBuilder;
+import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
 
index 9d9d9320760fa089c76daf032ef569970308c5a6..6ec737d01699f3b7749c2cdd79529470f1504cd9 100644 (file)
@@ -13,11 +13,11 @@ import java.net.InetSocketAddress;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.netconf.client.conf.NetconfReconnectingClientConfigurationBuilder;
+import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
 
index 32e5dbe43aa22cccc7d28a85934805bb19ca8613..6d0fb5b44e66798b812c64e6db32b1fbef05050e 100644 (file)
@@ -29,8 +29,8 @@ import org.junit.Test;
 import org.mockito.internal.util.collections.Sets;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.NetconfMessage;
+import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 
 public class SimpleNetconfClientSessionListenerTest {
 
index 0b5292522cb1066e42e9a063aee8bfd657a6356e..a0a7290d3d28adcb1a1c6dbb75af63b27738d552 100644 (file)
@@ -19,7 +19,6 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.MockitoAnnotations.initMocks;
 
 import com.google.common.collect.Lists;
-import java.lang.reflect.Field;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
index 9cd5e3c661834b08c64e257629312b17e7473aa5..b7b6f2791fc5ae227b9885144bfafcafafb1daf3 100644 (file)
@@ -17,9 +17,9 @@ 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.nettyutil.AbstractChannelInitializer;
 import org.opendaylight.netconf.api.NetconfServerDispatcher;
 import org.opendaylight.netconf.impl.util.DeserializerExceptionHandler;
+import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
 import org.opendaylight.protocol.framework.AbstractDispatcher;
 
 public class NetconfServerDispatcherImpl extends AbstractDispatcher<NetconfServerSession, NetconfServerSessionListener> implements NetconfServerDispatcher {
index c5d37b708e02d6347a7bc864b3066509f15ffb69..e3fd704663afa7a3d591dee80a3b6b2a8bc14aaf 100644 (file)
@@ -17,11 +17,11 @@ import java.net.InetSocketAddress;
 import java.net.SocketAddress;
 import java.util.AbstractMap;
 import java.util.Map;
-import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfServerSessionPreferences;
+import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
+import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
+import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 6aedd7043aff9cb26520f777364d8030596a2ebb..8f298f836767dfd39d6927ecb10cd4f7659f5706 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.netconf.impl.mapping.operations;
 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.netconf.util.mapping.AbstractSingletonNetconfOperation;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.impl.NetconfServerSession;
+import org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
index 938aec869f9cee8ebf4a355dcf8fa03008c48f66..140a5d06362d2e901bfff190e44ac060989fc84c 100644 (file)
@@ -21,12 +21,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import org.opendaylight.controller.config.util.capability.Capability;
+import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.netconf.mapping.api.NetconfOperation;
 import org.opendaylight.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
 import org.opendaylight.netconf.util.CloseableUtil;
-import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 8feaef6aedc9366381d35cea1a9cc78a8599edf0..0ae2b92e0620faf5f0f05ba26eaa17e3a278b197 100644 (file)
@@ -23,7 +23,6 @@ import org.opendaylight.netconf.impl.SessionIdProvider;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
 import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
 import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
-import org.opendaylight.netconf.util.osgi.NetconfConfigUtil;
 import org.opendaylight.netconf.util.osgi.NetconfConfiguration;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
index 2f9d63f4688540ec50597a89601fafbaec38cd40..33408e2d8ca65a49da60e74c93eae92b65f3ca71 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.netconf.impl.osgi;
 
+import org.opendaylight.netconf.api.util.NetconfConstants;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
-import org.opendaylight.netconf.api.util.NetconfConstants;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
index c9088104e26e44b410ea20018c0591193e8fe98c..8f35f199cbd9ef624aeb3527d575ef2a333acc1e 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netconf.impl;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
@@ -51,12 +50,12 @@ import org.junit.runners.Parameterized;
 import org.opendaylight.controller.config.util.capability.Capability;
 import org.opendaylight.controller.config.util.xml.DocumentedException;
 import org.opendaylight.controller.config.util.xml.XmlUtil;
-import org.opendaylight.netconf.api.monitoring.SessionEvent;
-import org.opendaylight.netconf.api.monitoring.SessionListener;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
+import org.opendaylight.netconf.api.monitoring.SessionEvent;
+import org.opendaylight.netconf.api.monitoring.SessionListener;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.client.NetconfClientDispatcher;
 import org.opendaylight.netconf.client.NetconfClientDispatcherImpl;
index 98148a990a599614234f27096613e43116f53b6c..31806f73e52cb215897ea59f0f2075fb46381fc6 100644 (file)
@@ -10,8 +10,8 @@ package org.opendaylight.netconf.impl;
 import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
-import org.opendaylight.netconf.util.test.XmlFileLoader;
 import org.opendaylight.netconf.api.NetconfMessage;
+import org.opendaylight.netconf.util.test.XmlFileLoader;
 
 public class ExiEncodeDecodeTest  {
     @Test
index 2b8440899cd85c61983df84b26ea4a56f78eae73..d9853b3b9a95d61ace81edeb20cdebd6cca7102c 100644 (file)
@@ -27,10 +27,10 @@ import org.mockito.stubbing.Answer;
 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.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.NetconfTerminationReason;
+import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.impl.NetconfServerSession;
 import org.opendaylight.netconf.impl.NetconfServerSessionListener;
 import org.w3c.dom.Document;
index d20c7ecb05e054af91662fb9f8316b4ef1138a72..ce20e1c0d7c8e240d9ce9bff219af49cff772b6d 100644 (file)
@@ -20,9 +20,9 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
+import org.opendaylight.netconf.api.util.NetconfConstants;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
-import org.opendaylight.netconf.api.util.NetconfConstants;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
 import org.osgi.framework.ServiceReference;
index a6e2717aef3d425574766fbf5443722f719c66fe..6e7ef741bac318108e7b31cb524e065d038fdec1 100644 (file)
@@ -38,10 +38,10 @@ 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.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
index cc0226a5d8f954168b35b6849a8b7371a815d20a..11d269a3eadd45f469c28425e56cbac12b69d6bf 100644 (file)
@@ -20,7 +20,6 @@ import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.config.util.xml.XmlUtil;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
-import org.opendaylight.netconf.api.monitoring.SessionListener;
 import org.opendaylight.netconf.monitoring.xml.model.NetconfState;
 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.IpAddress;
index b7e6e30d38cc60f7c0d29755256228684efcfe27..6bc9d70f1a11813e027b876c852575593497bddc 100644 (file)
@@ -10,12 +10,12 @@ package org.opendaylight.netconf.nettyutil;
 
 import io.netty.channel.Channel;
 import io.netty.util.concurrent.Promise;
-import org.opendaylight.netconf.util.messages.FramingMechanism;
 import org.opendaylight.netconf.api.NetconfSession;
 import org.opendaylight.netconf.nettyutil.handler.FramingMechanismHandlerFactory;
 import org.opendaylight.netconf.nettyutil.handler.NetconfEOMAggregator;
 import org.opendaylight.netconf.nettyutil.handler.NetconfHelloMessageToXMLEncoder;
 import org.opendaylight.netconf.nettyutil.handler.NetconfXMLToHelloMessageDecoder;
+import org.opendaylight.netconf.util.messages.FramingMechanism;
 
 public abstract class AbstractChannelInitializer<S extends NetconfSession> {
 
index 82f963afb07f5e74f3bca323d689d5119e658766..0d50a2f74bed28041f331e8f6625045f6d17bfa2 100644 (file)
@@ -15,9 +15,9 @@ import io.netty.channel.ChannelHandlerContext;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import javax.xml.transform.TransformerException;
+import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
-import org.opendaylight.netconf.api.NetconfMessage;
 
 /**
  * Customized NetconfMessageToXMLEncoder that serializes additional header with
index 1ff2464501378d246c0b5153749830ada60ed163..5353381748e610f2cd3e90076b6fd3a082833a79 100644 (file)
@@ -22,10 +22,10 @@ import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.List;
 import org.opendaylight.controller.config.util.xml.XmlUtil;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 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;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
index 7bdff44d746fb5a3304cb048dba608910bf85c3b..f3711ae388c795e5d20396c51968627651ae03f0 100644 (file)
@@ -14,10 +14,10 @@ import org.opendaylight.controller.config.util.xml.XmlUtil;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.openexi.proc.common.EXIOptions;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 /**
  * Start-exi netconf message.
index 3aab586d4f3873182e089011fdb140423c4e802d..7eaceff6697ccc31fe8d37f8dcaa0cefb9580560 100644 (file)
@@ -20,9 +20,9 @@ import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.config.util.xml.XmlUtil;
+import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
-import org.opendaylight.netconf.api.NetconfMessage;
 
 public class NetconfHelloMessageToXMLEncoderTest {
 
index 345b37adde11e10f8ff277bd8b2a0a663cfb2f2c..bb3da161979f924e2decd9e32ada694bae91a6cf 100644 (file)
@@ -11,13 +11,10 @@ package org.opendaylight.netconf.notifications;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
-import javax.xml.datatype.DatatypeConfigurationException;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
 import org.junit.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
index 87d774b147c0526d8f5c010510e561fbe0577731..66a337433878ab6f692c9de5c8a1ba23248bff93 100644 (file)
@@ -15,9 +15,9 @@ import io.netty.channel.ChannelInboundHandlerAdapter;
 import org.apache.sshd.common.io.IoInputStream;
 import org.apache.sshd.common.io.IoOutputStream;
 import org.apache.sshd.server.ExitCallback;
+import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandlerReader;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandlerWriter;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 2d9b67d42dd7dd2d54759747f2d61a9767f31935..ee34f8fd2f1ad2acbf4a746f1794bc140513563d 100644 (file)
@@ -21,7 +21,6 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.handler.logging.LogLevel;
 import io.netty.handler.logging.LoggingHandler;
 import java.net.InetSocketAddress;
-import org.opendaylight.netconf.util.osgi.NetconfConfigUtil;
 import org.opendaylight.netconf.util.osgi.NetconfConfiguration;
 
 public class ProxyServer implements Runnable {
index 7c7ef6383d9882e1ae5887b73688d00062e6238a..1257e4b7e923f4bed84ac260b7f3e883c5d7db05 100644 (file)
@@ -33,7 +33,6 @@ import org.mockito.MockitoAnnotations;
 import org.opendaylight.netconf.auth.AuthProvider;
 import org.opendaylight.netconf.ssh.SshProxyServer;
 import org.opendaylight.netconf.ssh.SshProxyServerConfigurationBuilder;
-import org.opendaylight.netconf.util.osgi.NetconfConfigUtil;
 import org.opendaylight.netconf.util.osgi.NetconfConfiguration;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceListener;
index 95a546a9f26a6d6ff0a3da08aba1fae5d1aef80e..c4564d8e9619e20f5530e83f53f5a26a317f8ee9 100644 (file)
 
     <dependencies>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-topology</artifactId>
+            <groupId>com.typesafe.akka</groupId>
+            <artifactId>akka-actor_${scala.version}</artifactId>
         </dependency>
         <dependency>
             <groupId>com.typesafe.akka</groupId>
-            <artifactId>akka-actor_2.11</artifactId>
+            <artifactId>akka-cluster_${scala.version}</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>org.opendaylight.netconf</groupId>
-            <artifactId>sal-netconf-connector</artifactId>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-codec-xml</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.typesafe.akka</groupId>
-            <artifactId>akka-cluster_2.11</artifactId>
+            <groupId>org.opendaylight.netconf</groupId>
+            <artifactId>sal-netconf-connector</artifactId>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-singleton-common-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>ietf-topology</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.typesafe.akka</groupId>
-            <artifactId>akka-testkit_2.11</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-data-codec-xml</artifactId>
+            <artifactId>akka-testkit_${scala.version}</artifactId>
         </dependency>
     </dependencies>
 
index ec9c717440b6c6b97071584d65fef709db49365b..58fe9b38f37d166e08465df6d747929bfa5d9338 100644 (file)
@@ -17,8 +17,21 @@ import scala.concurrent.Future;
 /**
  * Provides API for all operations of read and write transactions
  */
+// TODO we should separate between read tx and write tx
 public interface NetconfDOMTransaction {
 
+
+    /**
+     * Opens a new transaction. Transactions have to be opened before applying
+     * any operations on them. Previous transaction has to be either submitted
+     * ({@link #submit()} was invoked) or canceled ({@link #cancel()} was
+     * invoked.
+     *
+     * @throws IllegalStateException
+     *             if the previous transaction was not SUBMITTED or CANCELLED.
+     */
+    void openTransaction();
+
     /**
      * Read data from particular data-store
      * @param store data-store type
index 9023847da30718106a9f49ae363fec10f2912393..5d1c893f48aebf3863044606bd06503adf2b01ab 100644 (file)
@@ -19,6 +19,11 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  */
 public interface RemoteOperationTxProcessor {
 
+    /**
+     * Opens a new transaction.
+     */
+    void doOpenTransaction(ActorRef recipient, ActorRef sender);
+
     /**
      * Delete node in particular data-store in path
      * @param store data-store type
index e4911acbf72a974251ddcc8f566c1b3c4c5a8286..36ab07bbea40f111e952b4a3bca7ac23eab352e8 100644 (file)
@@ -30,6 +30,7 @@ import org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceSalProvider
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.netconf.topology.singleton.api.NetconfDOMTransaction;
 import org.opendaylight.netconf.topology.singleton.impl.tx.NetconfMasterDOMTransaction;
+import org.opendaylight.netconf.topology.singleton.impl.tx.NetconfProxyDOMTransaction;
 import org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologyUtils;
 import org.opendaylight.netconf.topology.singleton.messages.CreateInitialMasterActorData;
 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
@@ -137,8 +138,13 @@ class MasterSalFacade implements AutoCloseable, RemoteDeviceHandler<NetconfSessi
                 new NetconfMasterDOMTransaction(id, remoteSchemaContext, deviceRpc, netconfSessionPreferences);
         deviceDataBroker =
                 new NetconfDOMDataBroker(actorSystem, id, masterDOMTransactions);
+        // We need to create NetconfProxyDOMTransaction so accessing mountpoint
+        // on leader node would be same as on follower node
+        final NetconfDOMTransaction proxyDOMTransation =
+                new NetconfProxyDOMTransaction(id, actorSystem, masterActorRef);
+        final NetconfDOMDataBroker proxyDataBroker = new NetconfDOMDataBroker(actorSystem, id, proxyDOMTransation);
         salProvider.getMountInstance()
-                .onTopologyDeviceConnected(remoteSchemaContext, deviceDataBroker, deviceRpc, notificationService);
+                .onTopologyDeviceConnected(remoteSchemaContext, proxyDataBroker, deviceRpc, notificationService);
     }
 
     private Future<Object> sendInitialDataToActor() {
index db5e3e91b5a2181a9194fcc760e58e89c711a249..f19d0d535b98bf5afffe37bdaaa01979024afdbc 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.netconf.topology.singleton.impl;
 
 import akka.actor.ActorRef;
+import akka.actor.Status;
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
@@ -40,12 +41,28 @@ public class RemoteOperationTxProcessorImpl implements RemoteOperationTxProcesso
     private DOMDataWriteTransaction writeTx;
     private DOMDataReadOnlyTransaction readTx;
 
+    private ActorRef currentUser = null;
+
     public RemoteOperationTxProcessorImpl(final DOMDataBroker dataBroker, final RemoteDeviceId id) {
         this.dataBroker = dataBroker;
         this.id = id;
         this.readTx = dataBroker.newReadOnlyTransaction();
     }
 
+    @Override
+    public void doOpenTransaction(ActorRef recipient, ActorRef sender) {
+        if (currentUser != null) {
+            LOG.error("{}: Opening a new transaction for {} failed.", id, recipient);
+            recipient.tell(new Status.Failure(
+                    new IllegalStateException("Transaction is already opened for another user")), recipient);
+            return;
+        }
+
+        LOG.debug("{}: Opening a new transaction for {}", id, recipient);
+        currentUser = recipient;
+        recipient.tell(new Status.Success(null), sender);
+    }
+
     @Override
     public void doDelete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
         if (writeTx == null) {
@@ -56,6 +73,7 @@ public class RemoteOperationTxProcessorImpl implements RemoteOperationTxProcesso
 
     @Override
     public void doSubmit(final ActorRef recipient, final ActorRef sender) {
+        currentUser = null;
         if (writeTx != null) {
             CheckedFuture<Void, TransactionCommitFailedException> submitFuture = writeTx.submit();
             Futures.addCallback(submitFuture, new FutureCallback<Void>() {
@@ -77,11 +95,13 @@ public class RemoteOperationTxProcessorImpl implements RemoteOperationTxProcesso
 
     @Override
     public void doCancel(final ActorRef recipient, final ActorRef sender) {
+        currentUser = null;
         boolean cancel = false;
         if (writeTx != null) {
             cancel = writeTx.cancel();
         }
         recipient.tell(cancel, sender);
+
     }
 
     @Override
@@ -148,6 +168,7 @@ public class RemoteOperationTxProcessorImpl implements RemoteOperationTxProcesso
 
     @Override
     public void close() throws Exception {
+        currentUser = null;
         if (readTx != null) {
             readTx.close();
         }
index e0fe6cc387ada90a917ae8278a440c1def3caebf..edbfe1be5151177a3b207399ea24dd8e180d905a 100644 (file)
@@ -46,6 +46,7 @@ import org.opendaylight.netconf.topology.singleton.messages.transactions.DeleteR
 import org.opendaylight.netconf.topology.singleton.messages.transactions.EmptyResultResponse;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.ExistsRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.MergeRequest;
+import org.opendaylight.netconf.topology.singleton.messages.transactions.OpenTransaction;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.PutRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.ReadRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.SubmitRequest;
@@ -148,7 +149,9 @@ public class NetconfNodeActor extends UntypedActor {
     }
 
     private void resolveProxyCalls(final Object message, final ActorRef recipient, final ActorRef futureSender) {
-        if (message instanceof ReadRequest) {
+        if (message instanceof OpenTransaction) {
+            operationsProcessor.doOpenTransaction(recipient, futureSender);
+        } else if (message instanceof ReadRequest) {
 
             final ReadRequest readRequest = (ReadRequest) message;
             operationsProcessor.doRead(readRequest.getStore(), readRequest.getPath(), recipient, futureSender);
index 356b3bf705d7decb20887922211cf679ae059145..973cc0576715843894a72cb2fe84cabe5c56a9c2 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.netconf.topology.singleton.impl.tx;
 
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
@@ -58,6 +59,14 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
         readTx = delegateBroker.newReadOnlyTransaction();
     }
 
+    @Override
+    public void openTransaction() {
+        // TODO We don't have to do anything here since
+        // NetconfProxyDOMTransactions and RemoteOperationTxProcessor do all
+        // the work regarding opening transactions. But maybe we should check
+        // for open transaction here instead in RemoteOperationTxProcessor
+    }
+
     @Override
     public Future<Optional<NormalizedNodeMessage>> read(final LogicalDatastoreType store,
                                                         final YangInstanceIdentifier path) {
index cca67466dd0890fab597897027fb6baf6f749d58..9b2adf2efa102bbf884c388ce95f82b0a7865e77 100644 (file)
@@ -13,6 +13,7 @@ import akka.actor.ActorSystem;
 import akka.dispatch.OnComplete;
 import akka.pattern.Patterns;
 import com.google.common.base.Optional;
+import com.google.common.base.Throwables;
 import org.opendaylight.controller.config.util.xml.DocumentedException;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
@@ -24,6 +25,7 @@ import org.opendaylight.netconf.topology.singleton.messages.transactions.DeleteR
 import org.opendaylight.netconf.topology.singleton.messages.transactions.EmptyReadResponse;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.ExistsRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.MergeRequest;
+import org.opendaylight.netconf.topology.singleton.messages.transactions.OpenTransaction;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.PutRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.ReadRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.SubmitFailedReply;
@@ -52,6 +54,24 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction {
         this.masterContextRef = masterContextRef;
     }
 
+    @Override
+    public void openTransaction() {
+        // TODO we can do some checking for already opened transaction also
+        // here in this class. We can track open transaction at least for this
+        // node.
+        LOG.debug("{}: Requesting leader {} to open new transaction", id, masterContextRef);
+        final Future<Object> openTxFuture =
+                Patterns.ask(masterContextRef, new OpenTransaction(), NetconfTopologyUtils.TIMEOUT);
+        try {
+            // we have to wait here so we can see if tx can be opened
+            Await.result(openTxFuture, NetconfTopologyUtils.TIMEOUT.duration());
+            LOG.debug("{}: New transaction opened successfully", id);
+        } catch (final Exception e) {
+            LOG.error("{}: Failed to open new transaction", id, e);
+            Throwables.propagate(e);
+        }
+    }
+
     @Override
     public Future<Optional<NormalizedNodeMessage>> read(final LogicalDatastoreType store,
                                                         final YangInstanceIdentifier path) {
index f938748cbfacda14e00829ae3f484e52a036b7c4..422cf7aaa954bfcd8745f7138dd9f3af1e8c9dd5 100644 (file)
@@ -45,6 +45,8 @@ public class NetconfWriteOnlyTransaction implements DOMDataWriteTransaction {
         this.id = id;
         this.delegate = delegate;
         this.actorSystem = actorSystem;
+
+        this.delegate.openTransaction();
     }
 
     @Override
diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/OpenTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/OpenTransaction.java
new file mode 100644 (file)
index 0000000..87622ca
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2017 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.topology.singleton.messages.transactions;
+
+/**
+ * A message sent to MountPoint leader to open new transaction
+ */
+public class OpenTransaction implements TransactionRequest {
+    private static final long serialVersionUID = 1L;
+}
index 5007657c8a97e282c5cefeab959c6e31ccec6886..c8cd51874610591bd5d024611d017f20dad2c451 100644 (file)
@@ -41,7 +41,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
@@ -148,21 +147,28 @@ public class WriteOnlyTransactionTest {
         // Test of invoking put on master through slave proxy
 
         doNothing().when(writeTx).put(storeType, instanceIdentifier, testNode);
-        slaveDataBroker.newWriteOnlyTransaction().put(storeType, instanceIdentifier, testNode);
+
+        DOMDataWriteTransaction wTx = slaveDataBroker.newWriteOnlyTransaction();
+        wTx.put(storeType, instanceIdentifier, testNode);
 
         verify(writeTx, times(1)).put(storeType, instanceIdentifier, testNode);
 
+        wTx.cancel();
         // Test of invoking merge on master through slave proxy
 
         doNothing().when(writeTx).merge(storeType, instanceIdentifier, testNode);
-        slaveDataBroker.newWriteOnlyTransaction().merge(storeType, instanceIdentifier, testNode);
+        wTx = slaveDataBroker.newWriteOnlyTransaction();
+        wTx.merge(storeType, instanceIdentifier, testNode);
 
         verify(writeTx, times(1)).merge(storeType, instanceIdentifier, testNode);
 
+        wTx.cancel();
         // Test of invoking delete on master through slave proxy
 
         doNothing().when(writeTx).delete(storeType, instanceIdentifier);
-        slaveDataBroker.newWriteOnlyTransaction().delete(storeType, instanceIdentifier);
+        wTx = slaveDataBroker.newWriteOnlyTransaction();
+        wTx.delete(storeType, instanceIdentifier);
+        wTx.cancel();
 
         verify(writeTx, times(1)).delete(storeType, instanceIdentifier);
 
@@ -177,33 +183,33 @@ public class WriteOnlyTransactionTest {
 
         // Without Tx
 
+        DOMDataWriteTransaction wTx = slaveDataBroker.newWriteOnlyTransaction();
         final CheckedFuture<Void,TransactionCommitFailedException> resultSubmit = Futures.immediateCheckedFuture(null);
         doReturn(resultSubmit).when(writeTx).submit();
 
-        final CheckedFuture<Void, TransactionCommitFailedException> resultSubmitResponse =
-                slaveDataBroker.newWriteOnlyTransaction().submit();
+        final CheckedFuture<Void, TransactionCommitFailedException> resultSubmitResponse = wTx.submit();
 
-        final Object result= resultSubmitResponse.checkedGet(TIMEOUT_SEC, TimeUnit.SECONDS);
+        final Object result = resultSubmitResponse.checkedGet(TIMEOUT_SEC, TimeUnit.SECONDS);
 
         assertNull(result);
 
         // With Tx
-
+        wTx = slaveDataBroker.newWriteOnlyTransaction();
         doNothing().when(writeTx).delete(any(), any());
-        slaveDataBroker.newWriteOnlyTransaction().delete(LogicalDatastoreType.CONFIGURATION,
+        wTx.delete(LogicalDatastoreType.CONFIGURATION,
                 YangInstanceIdentifier.EMPTY);
 
         final CheckedFuture<Void,TransactionCommitFailedException> resultSubmitTx = Futures.immediateCheckedFuture(null);
         doReturn(resultSubmitTx).when(writeTx).submit();
 
-        final CheckedFuture<Void, TransactionCommitFailedException> resultSubmitTxResponse =
-                slaveDataBroker.newWriteOnlyTransaction().submit();
+        final CheckedFuture<Void, TransactionCommitFailedException> resultSubmitTxResponse = wTx.submit();
 
         final Object resultTx = resultSubmitTxResponse.checkedGet(TIMEOUT_SEC, TimeUnit.SECONDS);
 
         assertNull(resultTx);
 
-        slaveDataBroker.newWriteOnlyTransaction().delete(LogicalDatastoreType.CONFIGURATION,
+        wTx = slaveDataBroker.newWriteOnlyTransaction();
+        wTx.delete(LogicalDatastoreType.CONFIGURATION,
                 YangInstanceIdentifier.EMPTY);
 
         final TransactionCommitFailedException throwable = new TransactionCommitFailedException("Fail", null);
@@ -213,7 +219,7 @@ public class WriteOnlyTransactionTest {
         doReturn(resultThrowable).when(writeTx).submit();
 
         final CheckedFuture<Void, TransactionCommitFailedException> resultThrowableResponse =
-                slaveDataBroker.newWriteOnlyTransaction().submit();
+                wTx.submit();
 
         exception.expect(TransactionCommitFailedException.class);
         resultThrowableResponse.checkedGet(TIMEOUT_SEC, TimeUnit.SECONDS);
@@ -228,23 +234,24 @@ public class WriteOnlyTransactionTest {
 
         // Without Tx
 
-        final Boolean resultFalseNoTx = slaveDataBroker.newWriteOnlyTransaction().cancel();
+        DOMDataWriteTransaction wTx = slaveDataBroker.newWriteOnlyTransaction();
+        final Boolean resultFalseNoTx = wTx.cancel();
         assertEquals(false, resultFalseNoTx);
 
         // With Tx, readWriteTx test
 
+        wTx = slaveDataBroker.newWriteOnlyTransaction();
         doNothing().when(writeTx).delete(any(), any());
-        slaveDataBroker.newReadWriteTransaction().delete(LogicalDatastoreType.CONFIGURATION,
+        wTx.delete(LogicalDatastoreType.CONFIGURATION,
                 YangInstanceIdentifier.EMPTY);
 
         doReturn(true).when(writeTx).cancel();
-
-        final Boolean resultTrue = slaveDataBroker.newWriteOnlyTransaction().cancel();
+        final Boolean resultTrue = wTx.cancel();
         assertEquals(true, resultTrue);
 
         doReturn(false).when(writeTx).cancel();
 
-        final Boolean resultFalse = slaveDataBroker.newWriteOnlyTransaction().cancel();
+        final Boolean resultFalse = wTx.cancel();
         assertEquals(false, resultFalse);
 
     }
index 336589de405bca783c171a5c11da49898f5eaf9e..082d868fb177d8aa315f0bfd335b23ac6c68b52f 100644 (file)
@@ -13,7 +13,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.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.Identifier;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
index 73ce520d2b8774013082c389abb9ff49085473b2..aa570952d6798bd021a679dbb21506097f88e88a 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.util.messages;
 
 import com.google.common.base.Optional;
-import java.io.IOException;
 import java.util.Map;
 import org.opendaylight.controller.config.util.xml.DocumentedException;
 import org.opendaylight.controller.config.util.xml.XmlElement;
@@ -22,7 +21,6 @@ import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
 
 /**
  * See <a href="http://tools.ietf.org/html/rfc6241#section-6">rfc6241</a> for details.
index 72106403225d806818188ba9677ec77235794a85..b94381cc0de2da5be58850f3e0153e0f42595abe 100644 (file)
@@ -18,7 +18,6 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
index c80f388411e0edc20fa22b25938298e8407b7ec9..448f7f26e0ae4edc7d57b2dd8dc3bd362601b1c3 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.netconf.util.osgi;
 
-import io.netty.channel.local.LocalAddress;
 import java.net.InetSocketAddress;
 import java.util.Dictionary;
 import java.util.Hashtable;
index 54c413555e61577ca3e03c97c20914ea48619f67..93559339f296baf71228e715f867b02046c9cebb 100644 (file)
@@ -9,11 +9,7 @@
 package org.opendaylight.netconf.sal.connect.api;
 
 import java.util.Set;
-import org.opendaylight.netconf.sal.connect.netconf.NetconfStateSchemas;
-import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider;
 
 public interface NetconfDeviceSchemas {
 
index 278771a5ba880a97ec4e3c0eaaa2da7bdb841be4..3fe01bbbfeb8992b14212289a7847375959e7fc9 100644 (file)
@@ -8,10 +8,8 @@
 package org.opendaylight.netconf.sal.connect.netconf.sal;
 
 import com.google.common.base.Preconditions;
-
 import java.util.Collection;
 import java.util.Collections;
-
 import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
index 68d20c7e42159b2a1b13d844f672c4f953c58bd7..f1ec789342d27eef9b91f570460c49b20bbd92ad 100644 (file)
@@ -31,8 +31,6 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Invokes RPC by sending netconf message via listener. Also transforms result from NetconfMessage to CompositeNode.
index 56fa78fe12faecda5d43e941c8fcc26cf98fb716..a420c3cdffce48f885db3d1c5b65a771b6538839 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.concurrent.ExecutionException;
 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;
@@ -77,12 +76,9 @@ public final class ReadOnlyTx implements DOMDataReadOnlyTransaction {
     @Override
     public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
         final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> data = read(store, path);
-
-        try {
-            return Futures.immediateCheckedFuture(data.get().isPresent());
-        } catch (InterruptedException | ExecutionException e) {
-            return Futures.immediateFailedCheckedFuture(new ReadFailedException("Exists failed",e));
-        }
+        final ListenableFuture<Boolean> result =
+                Futures.transform(data, (Optional<NormalizedNode<?, ?>> a) -> a != null && a.isPresent());
+        return MappingCheckedFuture.create(result, ReadFailedException.MAPPER);
     }
 
     @Override
index de2f92236ed730ed5ae87a983083ab583ba5ba41..b063cba63ac8603861b9a387ff79dd5a42b43bf6 100644 (file)
@@ -10,9 +10,7 @@ package org.opendaylight.netconf.sal.connect.netconf.sal.tx;
 
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.concurrent.ExecutionException;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
@@ -73,14 +71,7 @@ public class ReadWriteTx implements DOMDataReadWriteTransaction {
     @Override public CheckedFuture<Boolean, ReadFailedException> exists(
         final LogicalDatastoreType store,
         final YangInstanceIdentifier path) {
-        final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException>
-            data = read(store, path);
-
-        try {
-            return Futures.immediateCheckedFuture(data.get().isPresent());
-        } catch (InterruptedException | ExecutionException e) {
-            return Futures.immediateFailedCheckedFuture(new ReadFailedException("Exists failed",e));
-        }
+        return delegateReadTx.exists(store, path);
     }
 
     @Override
index 0abd74409709240a7b9ab13620e9b484b096b1b2..45b5521b05e1a6d65993c1997871ff9eec426d87 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.netconf.sal.connect.netconf.schema.mapping;
 
 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.IETF_NETCONF_NOTIFICATIONS;
 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_URI;
-import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.stripNotification;
 import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toPath;
 
 import com.google.common.base.Function;
index 7dd8064aff96941d18e74483b09e1cc4379d49b5..fbe71266239acb72ff686544161cf326718ca18c 100644 (file)
@@ -14,7 +14,6 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
 import com.google.common.collect.Lists;
-import java.lang.reflect.Field;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.Collection;
index bf18b6f30277059a1012baa336ad51221209092d..688194427948a05c66289b44b738a39fd6846690 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.sal.connect.netconf.listener;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Matchers.same;
@@ -24,6 +23,7 @@ import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.verify;
 import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0;
+
 import com.google.common.base.CharMatcher;
 import com.google.common.base.Strings;
 import com.google.common.collect.Sets;
index 81e09708f3addcb6daaf89a913ea2ee6c288e8c4..99ba1d0b34fa94e0cec47ebdc2cd11e9921c2b4c 100644 (file)
@@ -16,12 +16,12 @@ import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
+import com.google.common.util.concurrent.Futures;
 import java.net.InetSocketAddress;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -46,8 +46,6 @@ import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
-import com.google.common.util.concurrent.Futures;
-
 public class KeepaliveSalFacadeTest {
 
     private static final RemoteDeviceId REMOTE_DEVICE_ID = new RemoteDeviceId("test", new InetSocketAddress("localhost", 22));
index 748c210e53822fe4079857515cc7478bb4509b7f..795af83945ca2b8b7f86f56a9cf32dc647355831 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.sal.connect.netconf.sal.tx;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import org.junit.Assert;
@@ -26,7 +25,6 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 public class ReadWriteTxTest {
     @Mock
@@ -78,9 +76,9 @@ public class ReadWriteTxTest {
     @Test
     public void exists() throws Exception {
         final YangInstanceIdentifier id = TxTestUtils.getContainerId();
-        final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> resultFuture =
-                Futures.immediateCheckedFuture(Optional.of(TxTestUtils.getContainerNode()));
-        when(delegateReadTx.read(LogicalDatastoreType.CONFIGURATION, id)).thenReturn(resultFuture);
+        final CheckedFuture<Boolean, ReadFailedException> resultFuture =
+                Futures.immediateCheckedFuture(true);
+        when(delegateReadTx.exists(LogicalDatastoreType.CONFIGURATION, id)).thenReturn(resultFuture);
         final CheckedFuture<Boolean, ReadFailedException> exists = tx.exists(LogicalDatastoreType.CONFIGURATION, id);
         Assert.assertTrue(exists.get());
     }
index 6d9a8d1eb89d2f873f7052312efefc2df8587781..6d65959a7d26d14bb670c7e43697634432be17bc 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.netconf.sal.connect.netconf.schema;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.verify;
+
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
index 53548529c0a2a4034f95e7654a256231bf60bbcb..65f694c0c90bc440ce45a8e1d6e4566b5b6c5193 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.netconf.cli.reader.impl;
 
 import static org.opendaylight.netconf.cli.io.IOUtil.isSkipInput;
 import static org.opendaylight.netconf.cli.io.IOUtil.listType;
+
 import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.common.collect.BiMap;
index e2799d86614888bb2668117e46026d8b5d2c717b..3cf3653822db0aa2797bcdb1a55374d9ff05e71a 100644 (file)
@@ -9,15 +9,21 @@
 
 package org.opendaylight.netconf.test.tool;
 
-import com.ning.http.client.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
+import com.ning.http.client.AsyncCompletionHandler;
+import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
+import com.ning.http.client.HttpResponseStatus;
+import com.ning.http.client.ListenableFuture;
+import com.ning.http.client.Realm;
+import com.ning.http.client.Request;
+import com.ning.http.client.Response;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Semaphore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class Execution implements Callable<Void> {
 
index befa1dec4dadb88332cde04809a327c945af95fe..6035656c0a1baf6294b82dfa8087ab27fba0a54d 100644 (file)
@@ -19,7 +19,6 @@ import com.google.common.io.CharStreams;
 import com.google.common.io.Files;
 import java.io.File;
 import java.io.FileFilter;
-import java.io.FileInputStream;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
index 555f6833b2b38eb10a96c1d2bc7e6c7225fa5361..4ded4bb52e311e21bb77d84b86d8ffd5d87e2822 100644 (file)
@@ -9,10 +9,6 @@
 package org.opendaylight.netconf.test.tool;
 
 import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.util.ContextInitializer;
-import ch.qos.logback.core.joran.spi.JoranException;
-import ch.qos.logback.core.util.StatusPrinter;
 import com.google.common.base.Stopwatch;
 import com.google.common.io.CharStreams;
 import com.ning.http.client.AsyncHttpClient;
index 171b0b5af971b8e5716fdb83e908743d0b7d608c..23bc6a0ca020a1be95ea37a8b377d8187da32c8b 100644 (file)
@@ -15,7 +15,6 @@ import java.util.Map;
 import java.util.Set;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactory;
-import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactoryBuilder;
 import org.opendaylight.netconf.impl.SessionIdProvider;
 import org.opendaylight.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
index df0a9eeb1bb155114e8e9f07a51f7871628b0d35..51976445c2c3cba5feb6189d9b9189364c391f00 100644 (file)
@@ -9,12 +9,10 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-
 import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
-
 import org.opendaylight.controller.config.util.xml.DocumentedException;
 import org.opendaylight.controller.config.util.xml.XmlElement;
 import org.opendaylight.controller.config.util.xml.XmlUtil;
index 6a116451707c4a6b3c754feadf19b91d644bbf07..cafcd116234467bc5b9875dfb143dbe58841d76d 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Collections;
 import java.util.Set;
 import javax.ws.rs.core.Application;
 import org.opendaylight.yanglib.api.YangLibRestAppService;
-import org.opendaylight.yanglib.api.YangLibService;
 import org.osgi.framework.FrameworkUtil;
 
 public class YangLibRestApp extends Application implements YangLibRestAppService {
index 71b19176c530ef1b37ec24392bd1e9e0bf28772c..1bb3def0a5ca87d60b2c127b60f295f0bc835fb7 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
index 9bac961c2f0d27ac4cc10f393ce82d26306dda82..3b42ce6763e9fde6746bfe200b3d46f2b33bd15b 100644 (file)
@@ -16,7 +16,6 @@ import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 import java.util.Set;
-import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
index 21d8acb93044a5e65e9a9914ed94358abc4e3954..13b0b67db93587fa1b870bbe0c3bdbb66665b362 100644 (file)
@@ -141,12 +141,13 @@ public class ServicesWrapperImpl implements BaseServicesWrapper, TransactionServ
             final RpcServiceHandler rpcServiceHandler, final NotificationServiceHandler notificationServiceHandler) {
         this.delegRestOpsService = new RestconfOperationsServiceImpl(schemaCtxHandler, domMountPointServiceHandler);
         this.delegRestSchService = new RestconfSchemaServiceImpl(schemaCtxHandler, domMountPointServiceHandler);
+        this.delegRestconfSubscrService = new RestconfStreamsSubscriptionServiceImpl(domDataBrokerHandler,
+                notificationServiceHandler, schemaCtxHandler, transactionChainHandler);
         this.delegRestconfDataService =
-                new RestconfDataServiceImpl(schemaCtxHandler, transactionChainHandler, domMountPointServiceHandler);
+                new RestconfDataServiceImpl(schemaCtxHandler, transactionChainHandler, domMountPointServiceHandler,
+                        this.delegRestconfSubscrService);
         this.delegRestconfInvokeOpsService =
                 new RestconfInvokeOperationsServiceImpl(rpcServiceHandler, schemaCtxHandler);
-        this.delegRestconfSubscrService = new RestconfStreamsSubscriptionServiceImpl(domDataBrokerHandler,
-                notificationServiceHandler, schemaCtxHandler, transactionChainHandler);
         this.delegRestService = new RestconfImpl(schemaCtxHandler);
     }
 }
index a4d63a23ed060a1c5a87b9f5e23478d219ec8c33..33fc7baf1b6cc26b8c2b7342b6286537892b5ba7 100644 (file)
@@ -7,6 +7,11 @@
  */
 package org.opendaylight.restconf.restful.services.impl;
 
+import static org.opendaylight.restconf.restful.utils.RestconfStreamsConstants.CREATE_NOTIFICATION_STREAM;
+import static org.opendaylight.restconf.restful.utils.RestconfStreamsConstants.STREAM_ACCESS_PATH_PART;
+import static org.opendaylight.restconf.restful.utils.RestconfStreamsConstants.STREAM_LOCATION_PATH_PART;
+import static org.opendaylight.restconf.restful.utils.RestconfStreamsConstants.STREAM_PATH;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import java.text.SimpleDateFormat;
@@ -33,6 +38,7 @@ import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
 import org.opendaylight.restconf.handlers.SchemaContextHandler;
 import org.opendaylight.restconf.handlers.TransactionChainHandler;
 import org.opendaylight.restconf.restful.services.api.RestconfDataService;
+import org.opendaylight.restconf.restful.services.api.RestconfStreamsSubscriptionService;
 import org.opendaylight.restconf.restful.transaction.TransactionVarsWrapper;
 import org.opendaylight.restconf.restful.utils.DeleteDataTransactionUtil;
 import org.opendaylight.restconf.restful.utils.PatchDataTransactionUtil;
@@ -40,6 +46,7 @@ import org.opendaylight.restconf.restful.utils.PostDataTransactionUtil;
 import org.opendaylight.restconf.restful.utils.PutDataTransactionUtil;
 import org.opendaylight.restconf.restful.utils.ReadDataTransactionUtil;
 import org.opendaylight.restconf.restful.utils.RestconfDataServiceConstant;
+import org.opendaylight.restconf.utils.RestconfConstants;
 import org.opendaylight.restconf.utils.parser.ParserIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
@@ -57,12 +64,16 @@ public class RestconfDataServiceImpl implements RestconfDataService {
     private final TransactionChainHandler transactionChainHandler;
     private final DOMMountPointServiceHandler mountPointServiceHandler;
 
+    private final RestconfStreamsSubscriptionService delegRestconfSubscrService;
+
     public RestconfDataServiceImpl(final SchemaContextHandler schemaContextHandler,
                                    final TransactionChainHandler transactionChainHandler,
-                                   final DOMMountPointServiceHandler mountPointServiceHandler) {
+            final DOMMountPointServiceHandler mountPointServiceHandler,
+            final RestconfStreamsSubscriptionService delegRestconfSubscrService) {
         this.schemaContextHandler = schemaContextHandler;
         this.transactionChainHandler = transactionChainHandler;
         this.mountPointServiceHandler = mountPointServiceHandler;
+        this.delegRestconfSubscrService = delegRestconfSubscrService;
     }
 
     @Override
@@ -116,7 +127,16 @@ public class RestconfDataServiceImpl implements RestconfDataService {
         final TransactionVarsWrapper transactionNode = new TransactionVarsWrapper(
                 instanceIdentifier, mountPoint, transactionChain);
         final NormalizedNode<?, ?> node =
-                ReadDataTransactionUtil.readData(parameters.getContent(), transactionNode, withDefa);
+                ReadDataTransactionUtil.readData(identifier, parameters.getContent(), transactionNode, withDefa,
+                        schemaContextRef, uriInfo);
+        if (identifier.contains(STREAM_PATH) && identifier.contains(STREAM_ACCESS_PATH_PART)
+                && identifier.contains(STREAM_LOCATION_PATH_PART)) {
+            final String value = (String) node.getValue();
+            final String streamName = value.substring(
+                    value.indexOf(CREATE_NOTIFICATION_STREAM.toString() + RestconfConstants.SLASH),
+                    value.length());
+            this.delegRestconfSubscrService.subscribeToStream(streamName, uriInfo);
+        }
         if (node == null) {
             throw new RestconfDocumentedException(
                     "Request could not be completed because the relevant data model content does not exist",
index f885e78c2638762288a218a9cf02c57460532aee..bde63f505e9ca6abe5368c3612dbbb83b17836ab 100644 (file)
@@ -56,8 +56,6 @@ public class RestconfInvokeOperationsServiceImpl implements RestconfInvokeOperat
             if (namespace.toString().equals(RestconfStreamsConstants.SAL_REMOTE_NAMESPACE)) {
                 if (identifier.contains(RestconfStreamsConstants.CREATE_DATA_SUBSCR)) {
                     response = CreateStreamUtil.createDataChangeNotifiStream(payload, refSchemaCtx);
-                } else if (identifier.contains(RestconfStreamsConstants.CREATE_NOTIFICATION_STREAM)) {
-                    response = CreateStreamUtil.createYangNotifiStream(payload, refSchemaCtx);
                 } else {
                     throw new RestconfDocumentedException("Not supported operation", ErrorType.RPC,
                             ErrorTag.OPERATION_NOT_SUPPORTED);
index a6e76b56b472d6b4bb2fdd7acb2b0d29295acfad..19afc3eff81fd39de4946cf31728ed85b914d3c1 100644 (file)
@@ -11,8 +11,6 @@ import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -22,6 +20,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
+import org.opendaylight.netconf.sal.streams.listeners.NotificationListenerAdapter;
 import org.opendaylight.netconf.sal.streams.listeners.Notificator;
 import org.opendaylight.restconf.common.references.SchemaContextRef;
 import org.opendaylight.restconf.utils.parser.ParserIdentifier;
@@ -33,8 +32,6 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
 import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
 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.LeafSetEntryNode;
-import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.Module;
@@ -186,67 +183,46 @@ public final class CreateStreamUtil {
     /**
      * Create stream with POST operation via RPC
      *
-     * @param payload
+     * @param notificatinoDefinition
      *            - input of RPC
      * @param refSchemaCtx
      *            - schemaContext
+     * @param outputType
      * @return {@link DOMRpcResult}
      */
-    public static DOMRpcResult createYangNotifiStream(final NormalizedNodeContext payload,
-            final SchemaContextRef refSchemaCtx) {
-        final ContainerNode data = (ContainerNode) payload.getData();
-        LeafSetNode leafSet = null;
-        String outputType = "XML";
-        for (final DataContainerChild<? extends PathArgument, ?> dataChild : data.getValue()) {
-            if (dataChild instanceof LeafSetNode) {
-                leafSet = (LeafSetNode) dataChild;
-            } else if (dataChild instanceof AugmentationNode) {
-                outputType = (String) (((AugmentationNode) dataChild).getValue()).iterator().next().getValue();
-            }
-        }
-
-        final Collection<LeafSetEntryNode> entryNodes = leafSet.getValue();
+    public static List<NotificationListenerAdapter> createYangNotifiStream(
+            final NotificationDefinition notificatinoDefinition, final SchemaContextRef refSchemaCtx,
+            final String outputType) {
         final List<SchemaPath> paths = new ArrayList<>();
         String streamName = RestconfStreamsConstants.CREATE_NOTIFICATION_STREAM + "/";
-
-        final Iterator<LeafSetEntryNode> iterator = entryNodes.iterator();
-        while (iterator.hasNext()) {
-            final QName valueQName = QName.create((String) iterator.next().getValue());
-            final Module module = refSchemaCtx.findModuleByNamespaceAndRevision(valueQName.getModule().getNamespace(),
-                    valueQName.getModule().getRevision());
-            Preconditions.checkNotNull(module,
-                    "Module for namespace " + valueQName.getModule().getNamespace() + " does not exist");
-            NotificationDefinition notifiDef = null;
-            for (final NotificationDefinition notification : module.getNotifications()) {
-                if (notification.getQName().equals(valueQName)) {
-                    notifiDef = notification;
-                    break;
-                }
-            }
-            final String moduleName = module.getName();
-            Preconditions.checkNotNull(notifiDef,
-                    "Notification " + valueQName + "doesn't exist in module " + moduleName);
-            paths.add(notifiDef.getPath());
-            streamName = streamName + moduleName + ":" + valueQName.getLocalName();
-            if (iterator.hasNext()) {
-                streamName = streamName + ",";
+        final QName notificatinoDefinitionQName = notificatinoDefinition.getQName();
+        final Module module =
+                refSchemaCtx.findModuleByNamespaceAndRevision(notificatinoDefinitionQName.getModule().getNamespace(),
+                        notificatinoDefinitionQName.getModule().getRevision());
+        Preconditions.checkNotNull(module,
+                "Module for namespace " + notificatinoDefinitionQName.getModule().getNamespace() + " does not exist");
+        NotificationDefinition notifiDef = null;
+        for (final NotificationDefinition notification : module.getNotifications()) {
+            if (notification.getQName().equals(notificatinoDefinitionQName)) {
+                notifiDef = notification;
+                break;
             }
         }
+        final String moduleName = module.getName();
+        Preconditions.checkNotNull(notifiDef,
+                "Notification " + notificatinoDefinitionQName + "doesn't exist in module " + moduleName);
+        paths.add(notifiDef.getPath());
+        streamName = streamName + moduleName + ":" + notificatinoDefinitionQName.getLocalName();
         if (outputType.equals("JSON")) {
             streamName = streamName + "/JSON";
         }
-        final QName rpcQName = payload.getInstanceIdentifierContext().getSchemaNode().getQName();
-        final QName outputQname = QName.create(rpcQName, "output");
-        final QName streamNameQname = QName.create(rpcQName, "notification-stream-identifier");
-
-        final ContainerNode output =
-                ImmutableContainerNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(outputQname))
-                        .withChild(ImmutableNodes.leafNode(streamNameQname, streamName)).build();
 
         if (!Notificator.existNotificationListenerFor(streamName)) {
-            Notificator.createNotificationListener(paths, streamName, outputType);
+            return Notificator.createNotificationListener(paths, streamName, outputType);
+        } else {
+            final List<NotificationListenerAdapter> notificationListenerFor =
+                    Notificator.getNotificationListenerFor(streamName);
+            return SubscribeToStreamUtil.pickSpecificListenerByOutput(notificationListenerFor, outputType);
         }
-
-        return new DefaultDOMRpcResult(output);
     }
 }
index 56cb54627821fdf4d1aafffb0d69a57652dfc7c7..c1c9d9161cb16e799f434dbbcec83f7a96c49b4b 100644 (file)
@@ -7,9 +7,13 @@
  */
 package org.opendaylight.restconf.restful.utils;
 
+import static org.opendaylight.restconf.restful.utils.RestconfStreamsConstants.STREAMS_PATH;
+import static org.opendaylight.restconf.restful.utils.RestconfStreamsConstants.STREAM_PATH_PART;
+
 import com.google.common.base.Optional;
 import com.google.common.primitives.Ints;
 import com.google.common.util.concurrent.CheckedFuture;
+import java.net.URI;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -21,14 +25,19 @@ import javax.annotation.Nullable;
 import javax.ws.rs.core.UriInfo;
 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.netconf.sal.restconf.impl.ControllerContext;
 import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
 import org.opendaylight.netconf.sal.restconf.impl.WriterParameters;
 import org.opendaylight.netconf.sal.restconf.impl.WriterParameters.WriterParametersBuilder;
+import org.opendaylight.netconf.sal.streams.listeners.NotificationListenerAdapter;
+import org.opendaylight.restconf.common.references.SchemaContextRef;
 import org.opendaylight.restconf.restful.transaction.TransactionVarsWrapper;
+import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeUtil;
 import org.opendaylight.restconf.utils.parser.ParserFieldsParameter;
+import org.opendaylight.yang.gen.v1.urn.sal.restconf.event.subscription.rev140708.NotificationOutputTypeGrouping.NotificationOutputType;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -56,6 +65,7 @@ import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
@@ -614,4 +624,56 @@ public final class ReadDataTransactionUtil {
         configMap.entrySet().stream().filter(x -> stateMap.containsKey(x.getKey())).forEach(
                 y -> builder.addChild((T) prepareData(y.getValue(), stateMap.get(y.getKey()))));
     }
+
+    /**
+     * Read specific type of data from data store via transaction and if identifier read data from
+     * streams then put streams from actual schema context to datastore.
+     *
+     * @param identifier
+     *            - identifier of data to read
+     * @param content
+     *            - type of data to read (config, state, all)
+     * @param transactionNode
+     *            - {@link TransactionVarsWrapper} - wrapper for variables
+     * @param withDefa
+     *            - vaule of with-defaults parameter
+     * @param schemaContextRef
+     *            - schema context
+     * @param uriInfo
+     *            - uri info
+     * @return {@link NormalizedNode}
+     */
+    public static NormalizedNode<?, ?> readData(final String identifier, final String content,
+            final TransactionVarsWrapper transactionNode, final String withDefa,
+            final SchemaContextRef schemaContextRef, final UriInfo uriInfo) {
+        if (identifier.contains(STREAMS_PATH) && !identifier.contains(STREAM_PATH_PART)) {
+            final DOMDataReadWriteTransaction wTx = transactionNode.getTransactionChain().newReadWriteTransaction();
+            final SchemaContext schemaContext = schemaContextRef.get();
+            final boolean exist = SubscribeToStreamUtil.checkExist(schemaContext, wTx);
+
+            for (final NotificationDefinition notificationDefinition : schemaContextRef.get().getNotifications()) {
+                final List<NotificationListenerAdapter> notifiStreamXML =
+                        CreateStreamUtil.createYangNotifiStream(notificationDefinition, schemaContextRef,
+                                NotificationOutputType.XML.getName());
+                final List<NotificationListenerAdapter> notifiStreamJSON =
+                        CreateStreamUtil.createYangNotifiStream(notificationDefinition, schemaContextRef,
+                                NotificationOutputType.JSON.getName());
+                notifiStreamJSON.addAll(notifiStreamXML);
+
+                for (final NotificationListenerAdapter listener : notifiStreamJSON) {
+                    final URI uri = SubscribeToStreamUtil.prepareUriByStreamName(uriInfo, listener.getStreamName());
+                    final NormalizedNode mapToStreams =
+                            RestconfMappingNodeUtil.mapYangNotificationStreamByIetfRestconfMonitoring(
+                                    listener.getSchemaPath().getLastComponent(), schemaContext.getNotifications(),
+                                    null, listener.getOutputType(), uri,
+                                    SubscribeToStreamUtil.getMonitoringModule(schemaContext), exist);
+                    SubscribeToStreamUtil.writeDataToDS(schemaContext,
+                            listener.getSchemaPath().getLastComponent().getLocalName(), wTx, exist,
+                            mapToStreams);
+                }
+            }
+            SubscribeToStreamUtil.submitData(wTx);
+        }
+        return readData(content, transactionNode, withDefa);
+    }
 }
index 09da9e8983a61a5767f7c0920e9b914b1c680eaf..252ec781ba7b96e31529724123456b159d62962d 100644 (file)
@@ -65,6 +65,12 @@ public final class RestconfStreamsConstants {
     public static final CharSequence NOTIFICATION_STREAM = "notification-stream";
     public static final CharSequence CREATE_NOTIFICATION_STREAM = "create-" + NOTIFICATION_STREAM;
 
+    public static final String STREAMS_PATH = "ietf-restconf-monitoring:restconf-state/streams";
+    public static final String STREAM_PATH_PART = "/stream=";
+    public static final String STREAM_PATH = STREAMS_PATH + STREAM_PATH_PART;
+    public static final String STREAM_ACCESS_PATH_PART = "/access=";
+    public static final String STREAM_LOCATION_PATH_PART = "/location";
+
     static {
         Date eventSubscriptionAugRevision;
         try {
index fddbad9ee1ca8d1811217914eee741e07d9c5ca9..73ef1a91dee293fab86ad8887583c4720586b1de 100644 (file)
@@ -46,6 +46,7 @@ import org.opendaylight.restconf.restful.services.impl.RestconfStreamsSubscripti
 import org.opendaylight.restconf.utils.RestconfConstants;
 import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.sal.restconf.event.subscription.rev140708.NotificationOutputTypeGrouping.NotificationOutputType;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -95,7 +96,12 @@ public final class SubscribeToStreamUtil {
         if (Strings.isNullOrEmpty(streamName)) {
             throw new RestconfDocumentedException("Stream name is empty.", ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
-        final List<NotificationListenerAdapter> listeners = Notificator.getNotificationListenerFor(streamName);
+        List<NotificationListenerAdapter> listeners = Notificator.getNotificationListenerFor(streamName);
+        if (identifier.contains(RestconfConstants.SLASH + NotificationOutputType.JSON.getName())) {
+            listeners = pickSpecificListenerByOutput(listeners, NotificationOutputType.JSON.getName());
+        } else {
+            listeners = pickSpecificListenerByOutput(listeners, NotificationOutputType.XML.getName());
+        }
         if ((listeners == null) || listeners.isEmpty()) {
             throw new RestconfDocumentedException("Stream was not found.", ErrorType.PROTOCOL,
                     ErrorTag.UNKNOWN_ELEMENT);
@@ -124,6 +130,18 @@ public final class SubscribeToStreamUtil {
         return uri;
     }
 
+    static List<NotificationListenerAdapter>
+            pickSpecificListenerByOutput(final List<NotificationListenerAdapter> listeners, final String outputType) {
+        for (final NotificationListenerAdapter notificationListenerAdapter : listeners) {
+            if (notificationListenerAdapter.getOutputType().equals(outputType)) {
+                final List<NotificationListenerAdapter> list = new ArrayList<>();
+                list.add(notificationListenerAdapter);
+                return list;
+            }
+        }
+        return listeners;
+    }
+
     /**
      * Prepare InstanceIdentifierContext for Location leaf
      *
@@ -250,7 +268,7 @@ public final class SubscribeToStreamUtil {
     }
 
     @SuppressWarnings("rawtypes")
-    private static void writeDataToDS(final SchemaContext schemaContext, final String name,
+    static void writeDataToDS(final SchemaContext schemaContext, final String name,
             final DOMDataReadWriteTransaction wTx, final boolean exist, final NormalizedNode mapToStreams) {
         String pathId = "";
         if (exist) {
@@ -262,7 +280,7 @@ public final class SubscribeToStreamUtil {
                 mapToStreams);
     }
 
-    private static void submitData(final DOMDataReadWriteTransaction wTx) {
+    static void submitData(final DOMDataReadWriteTransaction wTx) {
         try {
             wTx.submit().checkedGet();
         } catch (final TransactionCommitFailedException e) {
@@ -289,7 +307,7 @@ public final class SubscribeToStreamUtil {
         return result;
     }
 
-    private static URI prepareUriByStreamName(final UriInfo uriInfo, final String streamName) {
+    static URI prepareUriByStreamName(final UriInfo uriInfo, final String streamName) {
         final int port = SubscribeToStreamUtil.prepareNotificationPort();
 
         final UriBuilder uriBuilder = uriInfo.getAbsolutePathBuilder();
@@ -342,7 +360,7 @@ public final class SubscribeToStreamUtil {
         return port;
     }
 
-    private static boolean checkExist(final SchemaContext schemaContext, final DOMDataReadWriteTransaction wTx) {
+    static boolean checkExist(final SchemaContext schemaContext, final DOMDataReadWriteTransaction wTx) {
         boolean exist;
         try {
             exist = wTx.exists(LogicalDatastoreType.OPERATIONAL,
index a5146d8500114802653884f59d0cfedeab7fd94a..a0cbaaab742b1972f6dc7859e26be2b8016454d7 100644 (file)
@@ -494,9 +494,11 @@ public final class RestconfMappingNodeUtil {
                 }
                 prepareLeafAndFillEntryBuilder(streamEntry,
                         listSchema.getDataChildByName(MonitoringModule.LEAF_REPLAY_SUPP_STREAM_QNAME), true);
-                prepareLeafAndFillEntryBuilder(streamEntry,
+                if (start != null) {
+                    prepareLeafAndFillEntryBuilder(streamEntry,
                         listSchema.getDataChildByName(MonitoringModule.LEAF_START_TIME_STREAM_QNAME),
                         new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'XXX").format(start));
+                }
                 prepareListAndFillEntryBuilder(streamEntry,
                         (ListSchemaNode) listSchema.getDataChildByName(MonitoringModule.LIST_ACCESS_STREAM_QNAME),
                         outputType, uri);
index 0ed61c60b602b8b130264f8bfc8bffca63e778d6..95358244bb28afce2d1ac2d531d2ca3c6c65c155 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.restconf.utils.parser;
 
+import com.google.common.base.Optional;
+import com.google.common.base.Splitter;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 import java.text.ParseException;
 import java.util.Date;
 import java.util.Iterator;
@@ -31,10 +35,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import com.google.common.base.Optional;
-import com.google.common.base.Splitter;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
 
 /**
  * Util class for parsing identifier
index 22c667b35e450753289ec52c255d607da0a921e0..a366ce29b0329cdc26cb809e860bd155befd4d03 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.controller.sal.rest.impl.test.providers;
 import static org.junit.Assert.assertNotNull;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+
 import java.lang.reflect.Field;
 import java.net.URI;
 import java.util.Collections;
index 7969ffcf803eee9bc5cbed507ac9d9851e6bb139..1727f4334ea2adb10eb24c1d55874584708ff8c2 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
+
 import com.google.common.collect.Maps;
 import com.google.gson.stream.JsonReader;
 import com.google.gson.stream.JsonToken;
index a12ab5e1e66a63ba2fdd6bf803f6d37748d7a675..110d78cab982f660a51aab6da88c2f91027acf1c 100644 (file)
@@ -13,6 +13,7 @@ import static org.junit.Assert.fail;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+
 import com.google.common.collect.Iterables;
 import com.google.common.util.concurrent.CheckedFuture;
 import java.io.FileNotFoundException;
index d44cb15945c1efd9c52e046cf2f365ce8a61c1e4..fa3d6d03772b5707027044774809f8e4dd6c7672 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.sal.restconf.impl.json.to.nn.test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+
 import java.io.InputStream;
 import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
index 3672a3c13003e7f750d4bdf9b952b761fc4fbf8b..e68c7abaa32ef8c672974c7b7facf7159b49f677 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+
 import java.io.IOException;
 import java.io.InputStream;
 import javax.ws.rs.WebApplicationException;
index 1949f0c2c7c952429693c0e034586feb979d3163..b49ed62fc1f0fe7358f74f9c70ffd8b072057e04 100644 (file)
@@ -9,14 +9,15 @@
 package org.opendaylight.controller.sal.restconf.impl.nn.to.json.test;
 
 import static org.junit.Assert.assertTrue;
+
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter;
 import org.opendaylight.controller.sal.rest.impl.test.providers.AbstractBodyReaderTest;
+import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter;
 import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
index 62d295cf9e4e910ecae4d620c404295ff8bfdafa..a2c40fee9b5b3c7a1bef6aeec4714afddf2a92c4 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.sal.restconf.impl.nn.to.json.test;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+
 import com.google.common.util.concurrent.UncheckedExecutionException;
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
index 57708e30b0c991fd626cfa2d178a1e6be372f241..74986845e826744a229c7d54e34e1ed63047050e 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.sal.restconf.impl.nn.to.json.test;
 
 import static org.junit.Assert.assertTrue;
+
 import com.google.common.base.Preconditions;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -17,8 +18,8 @@ import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter;
 import org.opendaylight.controller.sal.rest.impl.test.providers.AbstractBodyReaderTest;
+import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter;
 import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
index 2027566f49aa89c5b45ac9eda6e5ad6654fb117d..113b50ec19aa9eef5fec44fb9c6644ef9dc01e53 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.sal.restconf.impl.nn.to.xml.test;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+
 import com.google.common.collect.Iterables;
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
@@ -17,8 +18,8 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
 import org.opendaylight.controller.sal.rest.impl.test.providers.AbstractBodyReaderTest;
+import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
 import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
 import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
 import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
index ec3ae36b9952052ad2ca1478407df3793d6bf64b..d0f0ee0782078a8d52b472246829113f3ef317f7 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.sal.restconf.impl.nn.to.xml.test;
 
 import static org.junit.Assert.assertTrue;
+
 import com.google.common.collect.Iterables;
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
@@ -15,8 +16,8 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
 import org.opendaylight.controller.sal.rest.impl.test.providers.AbstractBodyReaderTest;
+import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
 import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
 import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
 import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
index 15ee4b92539468bd56dd1c259310006ad4243ba4..cc3d3d1997607f101f12223ee1cbfba2e2176bae 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.sal.restconf.impl.nn.to.xml.test;
 
 import static org.junit.Assert.assertTrue;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Iterables;
 import java.io.ByteArrayOutputStream;
@@ -19,8 +20,8 @@ import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
 import org.opendaylight.controller.sal.rest.impl.test.providers.AbstractBodyReaderTest;
+import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
 import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
 import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
 import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
index 8a11fa9c12bf0a3a78786d672e3f4d6a27e6731b..e53ba7ffa99b95574da3bd334fafca999387de84 100644 (file)
@@ -22,6 +22,7 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.CheckedFuture;
index 81d3570d14bc8323688c43c47b7add6811174008..968256266f035d17390cad02ea1692f4ec1b2e9f 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.sal.restconf.impl.test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+
 import java.io.FileNotFoundException;
 import org.junit.BeforeClass;
 import org.junit.Test;
index 7a4d40ab8ebb364e7bc4c2b272ee3503e5c9c5e1..8f26109ad6507c3086d1f11886a25a434c6157fd 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.sal.restconf.impl.test;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+
 import java.io.ByteArrayInputStream;
 import java.io.FileNotFoundException;
 import java.net.URI;
index fb6c7a5b0c2974b7fd2626dc3866876688299c42..92bb4617d93e9b2c98bae46595adb168f023d364 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.controller.sal.restconf.impl.test;
 
 import static org.junit.Assert.assertTrue;
+
 import java.io.FileNotFoundException;
 import javax.ws.rs.client.Entity;
 import javax.ws.rs.core.Application;
index 1e820f3df97f3e1dc1b76a95ff830a586e5191c1..026403c26e0d318123eaac04513d03d9564e35aa 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.sal.restconf.impl.test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.HashMap;
index 67a837d50206e9c566407f8101eed86cddc34507..fea433254a89b8e255cda6eb6b5656daeafa54b1 100644 (file)
@@ -18,6 +18,7 @@ import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
+
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
index 4cd5aea672639165caa16933d64e06a5d9115edf..de45c8897d6c3362914474e81da1eae63dad0414 100644 (file)
@@ -15,6 +15,7 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static org.opendaylight.controller.sal.restconf.impl.test.RestOperationUtils.JSON;
 import static org.opendaylight.controller.sal.restconf.impl.test.RestOperationUtils.XML;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
index c448dfe51cdc972c870e25cef9da67d923746113..b14ec16560ebfa8695f7683e53d47f3eddddb82d 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.sal.restconf.impl.test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.mockito.Mockito.mock;
+
 import org.junit.Test;
 import org.opendaylight.netconf.sal.restconf.impl.RestCodec;
 import org.opendaylight.yangtools.concepts.Codec;
index a341ec9121c912419e33875498882cdf2fb38fe6..075565caf849d63f00d1feac8979195e51f6861d 100644 (file)
@@ -13,6 +13,7 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import java.io.FileNotFoundException;
index a6ad25a2dfd26765f6ec04c65a7dff9269119e01..af39c4057e7f6ec46ac71d57890fe597c24660a5 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.sal.restconf.impl.test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+
 import java.io.FileNotFoundException;
 import org.junit.BeforeClass;
 import org.junit.Rule;
index 1bcfa8fae05d269363f3604bfb8903513ac4c593..a7b315199e09307e73266f0f9c2e14ea993b1f55 100644 (file)
@@ -18,6 +18,7 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Maps;
index ca3fb86c748083d8840873901657ea769bcf097a..cccf61e955584dbce880fc0a4480a2b07e12c3b1 100644 (file)
@@ -14,6 +14,7 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static org.opendaylight.controller.sal.restconf.impl.test.RestOperationUtils.XML;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.CheckedFuture;
index 3eafe2f4075f2720a494da5cd083974d3d5f495b..eefdc9ced0b3701a8248fb874fb54dcbf883dd0b 100644 (file)
@@ -13,6 +13,7 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
index a40da957936e4a1c714bba211dfd06bba5031be8..9281c9d20b8f24786b81a8ced9bad25c99a450f9 100644 (file)
@@ -18,6 +18,7 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.when;
+
 import com.google.common.collect.Maps;
 import com.google.common.io.ByteStreams;
 import com.google.gson.JsonArray;
index dc7e2e9e9fc7038d45b0db93bc2cd075080f3ca4..7e52869165663697c64e6b194b2dcecbd5bedebd 100644 (file)
@@ -16,6 +16,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
index 0575a0ab9e68112d242f1f6c6fbc264a2d161e59..49eff509c0962f828ccb53145bf6101a28ac550e 100644 (file)
@@ -13,6 +13,7 @@ import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 import static org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil.getRevisionFormat;
+
 import com.google.common.base.Preconditions;
 import java.io.FileNotFoundException;
 import java.text.ParseException;
index be57caafad48924edad40980abc2c83a45f4fc46..0db4ac60c26fb1567b6d4a098a10728a4524de2c 100644 (file)
@@ -13,6 +13,7 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
index ae3c67fe9168a88848b61682e4e311909821183f..6688ade142eaadf7dc7adbf07e6a1cfe4b75faef 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.sal.restconf.impl.test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+
 import java.io.FileNotFoundException;
 import java.util.Set;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
index ac2acdea691799c68401de629af6a99cdcc135e9..4bb99597f9eb108cd32c96cc15741458f0fc19df 100644 (file)
@@ -11,6 +11,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
+
 import java.io.FileNotFoundException;
 import java.io.UnsupportedEncodingException;
 import java.net.URI;
index 12d623b0530a550224284c208cf3c9eb32efffe9..a2d794aa14609dcecd348b2e00fe487cfacf6fdf 100644 (file)
@@ -11,6 +11,7 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
index 99e598315da339dcf6fa42555b7afc3b170c1544..357c9490f32a8e2103316460976f9c7e9770bc4f 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.restconf.restful.services.impl;
 
 import static org.junit.Assert.assertEquals;
@@ -57,6 +56,7 @@ import org.opendaylight.restconf.common.references.SchemaContextRef;
 import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
 import org.opendaylight.restconf.handlers.SchemaContextHandler;
 import org.opendaylight.restconf.handlers.TransactionChainHandler;
+import org.opendaylight.restconf.restful.services.api.RestconfStreamsSubscriptionService;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -110,6 +110,8 @@ public class RestconfDataServiceImplTest {
     private DOMDataBroker mountDataBroker;
     @Mock
     private DOMTransactionChain transactionChain;
+    @Mock
+    private RestconfStreamsSubscriptionService delegRestconfSubscrService;
 
     @Before
     public void setUp() throws Exception {
@@ -183,7 +185,8 @@ public class RestconfDataServiceImplTest {
         final SchemaContextHandler schemaContextHandler = new SchemaContextHandler(txHandler);
 
         schemaContextHandler.onGlobalContextUpdated(this.contextRef.get());
-        this.dataService = new RestconfDataServiceImpl(schemaContextHandler, this.transactionChainHandler, this.mountPointServiceHandler);
+        this.dataService = new RestconfDataServiceImpl(schemaContextHandler, this.transactionChainHandler,
+                this.mountPointServiceHandler, this.delegRestconfSubscrService);
         doReturn(this.domTransactionChain).when(this.transactionChainHandler).get();
         doReturn(this.read).when(this.domTransactionChain).newReadOnlyTransaction();
         doReturn(this.readWrite).when(this.domTransactionChain).newReadWriteTransaction();
index 8f8933f65f38b2d5a7508162df2d85eeeaf2433c..d6c5dc2927aa016687dae7f16eacc3e4fbaedd57 100644 (file)
@@ -21,7 +21,6 @@ import java.util.List;
 import org.junit.Test;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
-import org.opendaylight.restconf.utils.validation.RestconfValidation;
 
 /**
  * Unit test for {@link RestconfValidation}
index 62069da0494b2b2b49241c22b96862ec466dc89f..67989d276a4b18980a05656896f691b983eb5a8f 100644 (file)
@@ -8,6 +8,8 @@
 package org.opendaylight.netconf.sal.restconf.broker;
 
 
+import static com.google.common.base.Preconditions.checkState;
+
 import com.google.common.collect.ImmutableClassToInstanceMap;
 import org.opendaylight.controller.md.sal.binding.util.BindingContextUtils;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
@@ -22,7 +24,6 @@ import org.opendaylight.yangtools.restconf.client.api.RestconfClientContext;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import static com.google.common.base.Preconditions.checkState;
 
 public class SalRemoteServiceBroker implements BindingAwareBroker,AutoCloseable {
 
index aeb73f7e5d80b83ea4d37b61011cd22a9075b042..49f9af990b23baec39b7f4f43717c4f8737bc800 100644 (file)
@@ -12,9 +12,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-
 import javax.annotation.concurrent.ThreadSafe;
-
 import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.DataChangedNotification;
 import org.opendaylight.yangtools.yang.binding.DataObject;
index 8a0ef04d46946a5c4ec5967e62375ced5263e5a4..b728945cba15a3169ca24a06d5479a3fb5f7e40c 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.netconf.sal.restconf.broker.impl;
 
+import com.google.common.base.Optional;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
@@ -32,8 +32,6 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Optional;
-
 public class DataBrokerServiceImpl implements DataBrokerService  {
 
     private static final Logger logger = LoggerFactory.getLogger(DataBrokerServiceImpl.class.toString());
index 327d7c0f02774e9beb7a24c1124bdf21280eff47..a2f32f8b881bd3828f7bf96d511f8cbe789f0ec4 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netconf.sal.restconf.broker.impl;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-
 import org.opendaylight.controller.sal.binding.api.NotificationListener;
 import org.opendaylight.controller.sal.binding.api.NotificationService;
 import org.opendaylight.netconf.sal.restconf.broker.listeners.RemoteNotificationListener;
index 2454eb8ad3905e45a99dbe353f6142594eccb9b7..e6f5f76627cbd6fd280c8b48877c8db400076caa 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.netconf.sal.restconf.broker.transactions;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.Future;
-
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;