netconf.git
9 years agoMigrate to MoreObjects
Robert Varga [Sat, 6 Jun 2015 19:45:12 +0000 (21:45 +0200)]
Migrate to MoreObjects

Objects is overloaded with JDK7, use the MoreObjects class.

Change-Id: I73f9ba24e990df8160b45b6fb0763a1b2ac231d6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix various netconf warnings
Robert Varga [Sat, 6 Jun 2015 19:43:10 +0000 (21:43 +0200)]
Fix various netconf warnings

Overridden version, potentially static methods.

Change-Id: I54af7e8b48335b4b81594d4deeb0f75e21dbc932
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 2660b697228bb3e708a556b53e06a89d5ea00440)

9 years agoBug 3039 - PUT augmentNode like last path element
Vaclav Demcak [Thu, 4 Jun 2015 16:13:48 +0000 (18:13 +0200)]
Bug 3039 - PUT augmentNode like last path element

* fixed JsonNormalizedNodeBodyReader error when PUT operation was used
and data were wrapped in augmentation or choice nodes
* fixed bug that allowed XmlNormalizedNodeBodyReader to parse PUT with
incorrect data (when PUT request was written as POST)

note: testet manualy describled scenario + CSIT OFP_test_suite

Change-Id: Ia25b6b45a1154866dea29c763be67cdb17fa0ce1
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
9 years agoBug 568 - Websockets: Test & fix data change notifications
Jan Hajnar [Tue, 2 Jun 2015 09:01:21 +0000 (11:01 +0200)]
Bug 568 - Websockets: Test & fix data change notifications

* changed WebSocketClient input parameter to accept "ws" protocol
instead of "http"

Change-Id: I2e1673707ca5231552195049024ebcb5e4964908
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit c0b35fcde6bd4dfda88eb8ee507bf20c77644aa3)

9 years agoBug 2358 - Decrease Technical Debt
Jakub Toth [Thu, 4 Jun 2015 08:48:47 +0000 (10:48 +0200)]
Bug 2358 - Decrease Technical Debt

fix compilation eclipse ID error

Change-Id: I39398878338a9c02d6cc8219aa76d1c9e15c8e10
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit d7b5e0619787f99844e19b9ef36f0a1793044f33)

9 years agoBug 2358 - Resources for tests nn to xml
Jakub Toth [Mon, 1 Jun 2015 07:19:22 +0000 (09:19 +0200)]
Bug 2358 - Resources for tests nn to xml

Tests of codecs are included in codecs yangtools yang-data-codec-gson and
yang-data-impl but we test codec on input data and also with presentation of Rest path.

* fix and add yang files for tests
* fix xmls files
* rename base folder of cnsn-to-xml to nn-to-xml

Change-Id: I6ad16f4e12c5f79089eda824d7b4879cdff14e6f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit cfdf1580b9a00e592ef79dc682ca234a97705413)

9 years agoBug 3104 - fixed XmlNormalizedNodeBodyReader
Vaclav Demcak [Fri, 29 May 2015 09:53:14 +0000 (11:53 +0200)]
Bug 3104 - fixed XmlNormalizedNodeBodyReader

Note: add missing key is relevant only for a POST scenario.

Change-Id: Ibe97f83de4411c0fa5e28ced192f69aa65454027
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
(cherry picked from commit 37aa81d301af72a6ea4ddf5e51c3f26f53c66a3d)

9 years agoBug 3104 - fixed XmlNormalizedNodeBodyReader bug when data started at
Jan Hajnar [Thu, 28 May 2015 09:41:35 +0000 (11:41 +0200)]
Bug 3104 - fixed XmlNormalizedNodeBodyReader bug when data started at
MapEntryNode

Change-Id: I7b19e514846ecfe7a9a29254b6fade8c876247e5
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit f957b6bf9f120d6648b02b9a7624d43db9de7b7d)

9 years agoBug 2358 - Resources for tests nn to json
ary [Thu, 7 May 2015 07:56:59 +0000 (09:56 +0200)]
Bug 2358 - Resources for tests nn to json

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl
but we test codec on input data and also with presentation of Rest path.

* fix and add yang files for tests
* fix json and xml files
* rename base folder of csns-to-json to nn-to-json

Change-Id: Id1c88f069d259536d34438d7b68666dd3010adc4
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit b0e9c2a7deb5a49e7f964ec1eee06198c0c15f5a)

9 years agoBug 3017 - Error messages and logs missing for this or other RPC failures
Vaclav Demcak [Wed, 6 May 2015 13:10:14 +0000 (15:10 +0200)]
Bug 3017 - Error messages and logs missing for this or other RPC failures

Note: Restconf doesn't contain logs for more functionality (not only RPC)
so this patch adds better logging for Restconf (BrokerFacade and RestconfImpl).
Administrators are not able to pair user's reports and karaf log without better
logging information and it would help for better problem identify (e.g. bug 3080).

* BrokerFacade - add Logging for lev info for all extra state
* RestconfImpl - add Logging for lev warn for unexpected error state
               - add Logging for lev debug for another extra state

Change-Id: I452dddd4fb9d75a7754be0bc1d92518dcb1eb786
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
(cherry picked from commit f0d174b75247700587557ea548c5638e12287fd1)

9 years agoBug 3104 - Sal Rest Connector: Data already exists for path when adding
Jan Hajnar [Mon, 4 May 2015 14:57:49 +0000 (16:57 +0200)]
Bug 3104 - Sal Rest Connector: Data already exists for path when adding
new item to list in augmentation

* changed XmlNormalizedNodeBodyReader and JsonNormalizedNodeBodyReader
to return YangInstanceIdentifier pointing to root of payload data.
* changed BrokerFacade datastore functions for PUT and POST to use
returned path from reader without modifications
* modified rest connector tests according to new behavior and added
tests for POST when payload is from augment/choice

Change-Id: Iac6a9853ea4c4529d2f484c464bd27123f4fafa2
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit 3d4dc18c01ebca47030284dde81988a44424d821)

9 years agoBug 2358 - Changed modifier of method in AbstractBodyReaderTest to protected
ary [Wed, 29 Apr 2015 10:00:31 +0000 (12:00 +0200)]
Bug 2358 - Changed modifier of method in AbstractBodyReaderTest to protected

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but we test codec on input data and also with presentation of Rest path.

* changed modifier of method getMediaType() to protected
* fix tests with method getMediaType()
* remove additional assertions

Change-Id: I211c2dc43690b663cada31deb3942e10fcc95366
Signed-off-by: ary <jatoth@cisco.com>
(cherry picked from commit 90aed8ac03ee3496178bdc3ec4b46f5c98dd78fc)

9 years agoBUG-3335 Disable keepalives in netconf testtool
Maros Marsalek [Mon, 25 May 2015 10:37:34 +0000 (12:37 +0200)]
BUG-3335 Disable keepalives in netconf testtool

Change-Id: I607cd0b11555847a30ca57f339bb7d24fc79368e
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit 1e15cd54715a29f17adb847664500a16470cd6a5)

9 years agoTake advantage of YangInstanceIdentifier methods
Robert Varga [Fri, 22 May 2015 16:14:47 +0000 (18:14 +0200)]
Take advantage of YangInstanceIdentifier methods

YangInstanceIdentifier provides new, fast methods to acquire parent,
check if it empty and size of path arguments. Take advantage of them.

Change-Id: I527ff8cefb2799cb188ffe294c69e3b81a0d6909
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit ad7a6537b709a72e763835cae683b8cc12401ce1)

9 years agoBUG-2150 Report errors for semantic issues with config snapshots
Maros Marsalek [Fri, 29 May 2015 12:39:06 +0000 (14:39 +0200)]
BUG-2150 Report errors for semantic issues with config snapshots

Change-Id: Ie8cf61e71649f64147a3cff6f92ae67b26454cb9
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit 2763c33336189a88b1c7ae1cc1c5311709610ee2)

9 years agoBug 2521 - Wrong return status code for non-existing mount-point
Vaclav Demcak [Tue, 2 Jun 2015 13:14:48 +0000 (15:14 +0200)]
Bug 2521 - Wrong return status code for non-existing mount-point

Note: MountpointService returns Optional object without mountpoint,
so this is the point where we would like to see error code 404.

Change-Id: Id7902e5c80786275c82e279ae0433a011fa486fc
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
(cherry picked from commit 097cf9e9d96e6ad94ab91728ab84c49b0eba5f61)

9 years agoFix duplicate dependency declarations
Robert Varga [Sun, 31 May 2015 23:16:59 +0000 (01:16 +0200)]
Fix duplicate dependency declarations

Dumplicate dependencies trigger a maven warning, remove them.

Change-Id: I9eeff5900650e8781bc883f1dea2cc930403123a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoHttp client for testing restconf
Tomas Cere [Thu, 14 May 2015 15:31:09 +0000 (17:31 +0200)]
Http client for testing restconf

use --help to find out all suported args.

Change-Id: Ib9cae0479d672d4432bbc0fe87dc98a32f524784
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoFix Subtree filter failing prefix lookup in element.
Tomas Cere [Wed, 20 May 2015 11:45:36 +0000 (13:45 +0200)]
Fix Subtree filter failing prefix lookup in element.

If element is f.ex a mac adress subtree filter would
try to match a nonexisting prefix.

Change-Id: Id23d78f6c7312f7c7b0b4f92f1cd99d97932de7f
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoBUG 3555: disable RC4 in mina-sshd
Tomas Cere [Wed, 3 Jun 2015 14:57:31 +0000 (16:57 +0200)]
BUG 3555: disable RC4 in mina-sshd

There are various security problems with RC4, this removes
RC4 from the ciphers used in the netconf ssh server.

Change-Id: I8973daf2dfb3670f0c77ffc9099eab2cc2a6cd05
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit 598345a6d62c4f0a2cfb55bfbc22b6ddd9c9bab7)

9 years agoBUG-3436 Fix UNION type leaves resolution in config subsystem
Maros Marsalek [Mon, 1 Jun 2015 11:47:37 +0000 (13:47 +0200)]
BUG-3436 Fix UNION type leaves resolution in config subsystem

The descriptions for comoposite open types were not included in a reconstructed
open type, which affected resolution of subsequent composite attributes with
leaves of type union. Union leaves rely on description in order to find the
artificial JMX attribute in order to pass union value as string.

Change-Id: If6222e25840cb854e565ae476509d21ebc19ab3c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit 10438f09cbbeb252e58a7fb381e9dd723cc14e2e)

9 years agoBug 3427 - Websockets: Cannot create stream if path contains predicates
Jan Hajnar [Thu, 28 May 2015 21:28:46 +0000 (23:28 +0200)]
Bug 3427 - Websockets: Cannot create stream if path contains predicates
or if target is a leaf

* fixed registration of path containing nodes with predicates
* added abillity to listen on leaves

Change-Id: I2e74aa6bbc50137187a5f7ece8de6ca288a1ebbf
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit 2a5c10374e32ca292466c3a43a120bfc2df0de90)

9 years agoSet revision of inet-types in ietf-netconf-monitoring
Maros Marsalek [Mon, 25 May 2015 13:21:36 +0000 (15:21 +0200)]
Set revision of inet-types in ietf-netconf-monitoring

If users introduce new version of inet types into ODL, netconf-monitoring model
fails to load proper class.

Change-Id: I392f160a2fb2cd9ddea3c331b5715fb0694ba391
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit 8a5dee49cac5e8560494e533b18c1fe7c4aff2a6)

9 years agoBUG 2610: Delete config:service instance via restconf
Tomas Cere [Thu, 28 May 2015 07:56:12 +0000 (09:56 +0200)]
BUG 2610: Delete config:service instance via restconf

Adds support for removing service instances to config subsystem.

Change-Id: I92211a67d1e74ca4421bd0158f2c3600fabc18cc
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoBug 3414 - exposed location header in CORS setings
Jan Hajnar [Thu, 28 May 2015 14:22:36 +0000 (16:22 +0200)]
Bug 3414 - exposed location header in CORS setings

Change-Id: I74e5f363cb931b2b8a792447b5d5d2fa6e0aa5aa
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit c515ff7c42b487ac5baeb6e3361b6457d1c4b096)

9 years agoBUG 2596: Use base service name in service serialization.
Tomas Cere [Mon, 1 Jun 2015 14:58:20 +0000 (16:58 +0200)]
BUG 2596: Use base service name in service serialization.

Serialization of config was incorrectly using derived service name
instead of the name that was configured in xml.

Change-Id: Idf455f62b1ade06a3e52e4936227f485f74c8ef3
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoBUG-2453 Enable nested enums in configuration
Maros Marsalek [Tue, 26 May 2015 15:18:30 +0000 (17:18 +0200)]
BUG-2453 Enable nested enums in configuration

Nested enums could not be pushed due to an open type issue. Enums had a
composite open type, where the class name of the enum was stored. JMX was
not happy with this open type and expected a SimpleType.STRING.

After the enum is resolved, the open type is changed to SimpleType.

Change-Id: Ifce5bec70c8c3973f560260e93fadba2bd1119fa
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit 7d4251f30d145d8b402e206a11fb4a2ff90ac351)

9 years agoBUG-2976: Resolve clash between current and feature cfg pusher
Maros Marsalek [Mon, 18 May 2015 14:11:57 +0000 (16:11 +0200)]
BUG-2976: Resolve clash between current and feature cfg pusher

Current config pusher now stores list of features present in karaf with the
config snapshot itself. Feature pusher now looks at the list and ignores
features listed in current config in the initial push.

A WARN log message is emitted for each ignored config file + feature.

Change-Id: I6e71e692e56d5219cf02cd704dd78215f4a7f5a2
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit fa8b972c6da7e3a24af396ea4bebe6d06f6a8d89)

9 years agoBUG-1135 Improve error reporting in config pusher
Maros Marsalek [Wed, 20 May 2015 09:05:56 +0000 (11:05 +0200)]
BUG-1135 Improve error reporting in config pusher

Change-Id: I78e9550bf78cf5c5b3d929827f379e9009a4468f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoFix deadlock in AsyncSshHandlerWriter
Tomas Cere [Mon, 25 May 2015 13:07:19 +0000 (15:07 +0200)]
Fix deadlock in AsyncSshHandlerWriter

Ssh window resize would call write twice, while a write pending was in progress
causing a deadlock because the underlying channelSession was already locked.

Change-Id: I3a1498084327f12b2010744e570644259532b975
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoBUG-2453 (De)Serialize enum values as defined in yang
Maros Marsalek [Mon, 11 May 2015 14:53:19 +0000 (16:53 +0200)]
BUG-2453 (De)Serialize enum values as defined in yang

Netconf endpoint for config subsystem did not (de)serialize enum values properly
It assumed the enum constants are identical in yang and in generated binding

Change-Id: If46c770a49653348201cd5d5c9303b5207048252
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoFix intermittent ConfigPersisterTest failure
Tom Pantelis [Fri, 15 May 2015 17:21:13 +0000 (13:21 -0400)]
Fix intermittent ConfigPersisterTest failure

testSuccessConflictingVersionException fails intermittently on Jenkins
with different errors. I think the problem is that it sets up the
"workingService" which the ConfigPusher is accessing createService on
another thread. In reading Mockito FAQs, you may get strange intermittent
results with multi-threading wrt to stubbing. Mocks can be accessed from
multiple threads but it's recommended that you setup all the stubbed
methods ahead of time. So I changed
testSuccessConflictingVersionException to do so.

After the fix, I ran the ConfigPersisterTest 550 times w/o failure.

Change-Id: Ia22936cfad82416e317935bd40b0eb3ccbdb232c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit e60d699bfe040f3ce570b4e634b0612eadeaca45)

9 years agoBug 3216 - Restconf GET operations functionality are not supported yet
Vaclav Demcak [Tue, 12 May 2015 08:56:04 +0000 (10:56 +0200)]
Bug 3216 - Restconf GET operations functionality are not supported yet

* missing list of all operations for all modules or for some module

Change-Id: I937890b83fe2bf3198278123373c5d3bad0aa927
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
(cherry picked from commit a59286ee063c90817958e9cef4836e15aec3c7a6)

9 years agoBUG-2838: Trim leading whitespaces from incoming NETCONF messages.
Gwenael Lambrouin [Thu, 21 May 2015 13:32:35 +0000 (15:32 +0200)]
BUG-2838: Trim leading whitespaces from incoming NETCONF messages.

Some network devices (such as Cisco routers) send RPC replies with a leading
newline before the XML declaration. The OpenDaylight controller does not accept
those replies: the XML parsing fails.

This patch fixes the NETCONF messages before they are sent to the XML parser:
it removes all the spurious characters at the beginning of the messages.

Change-Id: Ibc6eb6dc5bad6252a3c9bed73d3db83814aff501
Signed-off-by: Gwenael Lambrouin <gwenael.lambrouin@b-com.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoRename stress-client classifier in netconf-testtool
Maros Marsalek [Mon, 18 May 2015 11:41:17 +0000 (13:41 +0200)]
Rename stress-client classifier in netconf-testtool

2 shaded jars with same classifier overwrite each other in nexus

Change-Id: If08d83ccda4c716ef12818fd8eb0da2ae37706b9
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG-3301 Extract additional header properly on each OS
Maros Marsalek [Thu, 21 May 2015 13:21:10 +0000 (15:21 +0200)]
BUG-3301 Extract additional header properly on each OS

On Windows, the additional header in hello netconf message was no fully
extracted and it left \n byte in front on netconf xml hello message. This
is not allowed as long as the <?xml ... > declaration is present.

Change-Id: I611a5c689e86fb45065e6a9cd3b14cd5718af54f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG-2961 Disable auth and idle timeout for netconf connector
Maros Marsalek [Tue, 19 May 2015 14:06:15 +0000 (16:06 +0200)]
BUG-2961 Disable auth and idle timeout for netconf connector

The timeouts appeared in the mina SSHD lib in version 14 and are not suitable
for netconf connector.

Change-Id: I05f0feb58ef30d12a29eefa53ec5ccf300cb3123
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoDisable failing config persister test
Maros Marsalek [Fri, 15 May 2015 14:36:03 +0000 (16:36 +0200)]
Disable failing config persister test

The test needs to be redesigned. BundleContext and Concurrency need to be
removed from the test to make it more stable and readable.

Looks like the failure reported by mockito is caused by "wrongly written
multi-threaded tests".

Change-Id: I85a04194573c500ce9c4c4a8cfc4960e66203545
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoLog NetconfServer authentication fail when authProvider is missing.
Tomas Cere [Mon, 11 May 2015 15:11:59 +0000 (17:11 +0200)]
Log NetconfServer authentication fail when authProvider is missing.

Change-Id: I43fef075fdf43624f1b83ddec16d77c129f98964
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoUse callbacks while parsing to NormalizedNodes.
Tomas Cere [Tue, 28 Apr 2015 12:45:42 +0000 (14:45 +0200)]
Use callbacks while parsing to NormalizedNodes.

Implemented custom parsing strategies that handle netconf operations
and manipulation of the data tree in NetconfMDSal.

Change-Id: I99d7f049710393743714d90ac3123041e87040cd
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG 3213: Add missing netconf-tcp dependency to mdsal-netconf-connector
Tomas Cere [Thu, 14 May 2015 10:32:02 +0000 (12:32 +0200)]
BUG 3213: Add missing netconf-tcp dependency to mdsal-netconf-connector

Change-Id: I6d9839e24e994d28f0059c7dfbd2a9e3ab4b4c05
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agohotfix Bug 3226 - unable to configure flows
Vaclav Demcak [Fri, 15 May 2015 14:24:37 +0000 (16:24 +0200)]
hotfix Bug 3226 - unable to configure flows

* NormalizedNodeContainer has NodeIdentifierWithPredicates which
has to contain the map of all node keys
* (new codecs [xml,json] don't populate Attributes)

Change-Id: I5befc6d8ad5a63a04c11ad9102610be9508df672
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
(cherry picked from commit f00c40b510b85a0adbc407ba745a606bb4910a09)

9 years agoAdd AuthHandler to stresstool
Tomas Cere [Tue, 5 May 2015 09:21:18 +0000 (11:21 +0200)]
Add AuthHandler to stresstool

Stop bundling BouncyCastle into strestool uber-jar,
JCE certificate gets wiped this way and Oracle JDK refuses to use it.
Instead export them into target/lib dir and setup stresstool jar classpath to point to this directory.

Change-Id: I3c7ab9ea0f5faba2f02f4e0cfa21adda6bce2e4e
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoBug 2981 - POST mismatching IDs data vs URI possibility
Vaclav Demcak [Fri, 24 Apr 2015 13:14:27 +0000 (15:14 +0200)]
Bug 2981 - POST mismatching IDs data vs URI possibility

fix forgotten validation for check IDs from data and Uri

Change-Id: I465a3550399c5d2d4fcb546b608a9b47e3d97e63
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
9 years agoFix racecondition in AsyncSshHandlerWriter
Tomas Cere [Thu, 7 May 2015 11:39:51 +0000 (13:39 +0200)]
Fix racecondition in AsyncSshHandlerWriter

Fixed racecondition between releasing of netty ByteBuff and removing the msg from pendingWrites.

Change-Id: I40eff55d9c7858534d105a242d3ec6feb9d950d0
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoAdd NetconfXmlUnitRecursiveQualifier to netconf-util.
Tomas Cere [Mon, 11 May 2015 08:03:18 +0000 (10:03 +0200)]
Add NetconfXmlUnitRecursiveQualifier to netconf-util.

XmlUnit's RecursiveElementNameAndTextQualifier has trouble with non-trivial xml's and
element order in bigger depths.
This adds our own qualifier based on XmlUnit's implementation.

Change-Id: Ie89e84813e11cb2af7c9d3c0c6d80377816f79a7
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoMerge "BUG-3095 Add EventTime attribute to DOMNotification from netconf"
Tony Tkacik [Thu, 7 May 2015 10:26:05 +0000 (10:26 +0000)]
Merge "BUG-3095 Add EventTime attribute to DOMNotification from netconf"

9 years agoMerge "BUG 2954 : Thread local DocumentBuilder's for XmlUtil"
Tony Tkacik [Thu, 7 May 2015 09:28:02 +0000 (09:28 +0000)]
Merge "BUG 2954 : Thread local DocumentBuilder's for XmlUtil"

9 years agoMerge "Bug 2983 - POST operation to list only accepts data for keys"
Tony Tkacik [Thu, 7 May 2015 07:55:36 +0000 (07:55 +0000)]
Merge "Bug 2983 - POST operation to list only accepts data for keys"

9 years agoBUG-3095 Add EventTime attribute to DOMNotification from netconf
Maros Marsalek [Tue, 5 May 2015 16:47:37 +0000 (18:47 +0200)]
BUG-3095 Add EventTime attribute to DOMNotification from netconf

Introduced new interface DOMEvent and DOMNotifications from
sal-netconf-connector implement this interaface. The eventTime is parsed from
the the notification xml.

Change-Id: I833d86d91f752be55fef3e641a6c8654d2f65a28
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoCustom BufferedWriter implementation without newLine()
Maros Marsalek [Fri, 24 Apr 2015 09:02:45 +0000 (11:02 +0200)]
Custom BufferedWriter implementation without newLine()

This BufferedWriter does not provide newLine() method and does not read the
line.separator property via AccessController when its initialized. Whithout this
expensive call, its allocation is much faster. Used in netconf message encoder
to make the netconf serialization faster.

Change-Id: I88a65c7a82ff7c44b9ad3a3adfe7d7482a5fdc70
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBug 2983 - POST operation to list only accepts data for keys
Jan Hajnar [Thu, 23 Apr 2015 07:15:43 +0000 (09:15 +0200)]
Bug 2983 - POST operation to list only accepts data for keys

* added catch for ResultAlreadySetException in JsonNormalizedNodeBodyReader

Change-Id: I07d8b8b63e5c2de84b0ee7ec66013d38c58c7b49
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "Bug 3068 - checkRpcResponse - CancellationException"
Tony Tkacik [Mon, 4 May 2015 08:42:10 +0000 (08:42 +0000)]
Merge "Bug 3068 - checkRpcResponse - CancellationException"

9 years agoMerge "Make TCP netconf endpoint configurable"
Tony Tkacik [Mon, 4 May 2015 08:23:06 +0000 (08:23 +0000)]
Merge "Make TCP netconf endpoint configurable"

9 years agoMerge changes Ibe016728,Ic719c519,I87a81a54
Tony Tkacik [Mon, 4 May 2015 08:22:02 +0000 (08:22 +0000)]
Merge changes Ibe016728,Ic719c519,I87a81a54

* changes:
  Fix mac address generator in stress client
  Modify multiple physical address atributes in stress-client payload.
  Multiple clients for stresstool

9 years agoMerge "BUG 3066 : Optimistic lock failed, on NetconfStateUpdate"
Tony Tkacik [Mon, 4 May 2015 08:21:17 +0000 (08:21 +0000)]
Merge "BUG 3066 : Optimistic lock failed, on NetconfStateUpdate"

9 years agoMerge "Bug222:Comments incorporated for response based Restconf statistics"
Tony Tkacik [Mon, 4 May 2015 08:20:34 +0000 (08:20 +0000)]
Merge "Bug222:Comments incorporated for response based Restconf statistics"

9 years agoBug 3068 - checkRpcResponse - CancellationException
Jan Hajnar [Tue, 28 Apr 2015 11:14:46 +0000 (13:14 +0200)]
Bug 3068 - checkRpcResponse - CancellationException

* added catch for CancellationException in RestconfImpl

Change-Id: I3ebb2c4fd2a521ed0977075975a1302301b801fa
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBug 3010: Improve restconf error clarity.
Evan Zeller [Thu, 30 Apr 2015 21:59:25 +0000 (14:59 -0700)]
Bug 3010: Improve restconf error clarity.

Change-Id: Ib54e96f1a70a187d940f843ed624f4a0f3c4ead0
Signed-off-by: Evan Zeller <evanrzeller@gmail.com>
9 years agoMake TCP netconf endpoint configurable
Tomas Cere [Wed, 29 Apr 2015 11:43:01 +0000 (13:43 +0200)]
Make TCP netconf endpoint configurable

Allow users to configure netconf endpoint for md-sal to use pure TCP instead/or along with SSH.

Change-Id: I03d067322b0c02ba335d554da51c56db77c22bfb
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoMerge "Bug 2932: NPE on bundle activation"
Tony Tkacik [Wed, 29 Apr 2015 16:57:29 +0000 (16:57 +0000)]
Merge "Bug 2932: NPE on bundle activation"

9 years agoFix mac address generator in stress client
Maros Marsalek [Wed, 29 Apr 2015 14:45:58 +0000 (16:45 +0200)]
Fix mac address generator in stress client

Change-Id: Ibe016728fb2be3693c1b9f7899d0933932c37138
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoModify multiple physical address atributes in stress-client payload.
Maros Marsalek [Wed, 29 Apr 2015 14:39:45 +0000 (16:39 +0200)]
Modify multiple physical address atributes in stress-client payload.

Change-Id: Ic719c519eb0735d00014e51851dd958db5098ff0
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMultiple clients for stresstool
Maros Marsalek [Wed, 29 Apr 2015 14:37:04 +0000 (16:37 +0200)]
Multiple clients for stresstool

Added new parameter(--thread-amount) for stresstool that splits edits
between multiple threads.

Change-Id: I87a81a5442e32833c0c49dfd98b6475f8e699a2b
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBug222:Comments incorporated for response based Restconf statistics
bhavesh.kumar1 [Mon, 27 Apr 2015 04:18:44 +0000 (09:48 +0530)]
Bug222:Comments incorporated for response based Restconf statistics

Added response based restconf statistics which counts
the reponse of get, put, post and delete on the success and
failure response for config and operational datastore.

Change-Id: If423da08e2c5793e68398beb69575b7cf214f57e
Signed-off-by: bhavesh.kumar1 <bhavesh.kumar1@tcs.com>
9 years agoBUG 3066 : Optimistic lock failed, on NetconfStateUpdate
Tomas Cere [Tue, 28 Apr 2015 09:09:50 +0000 (11:09 +0200)]
BUG 3066 : Optimistic lock failed, on NetconfStateUpdate

Fixed race condition between commit of NetconfState and
opening of a new transaction in NetconfMonitoring state update.

Change-Id: I2f56a0e432e630e56a35409c56e4198a3e278594
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoAdd {PHYS_ADDR} attribute to netconf stress client tool
Tomas Cere [Mon, 27 Apr 2015 14:02:32 +0000 (16:02 +0200)]
Add {PHYS_ADDR} attribute to netconf stress client tool

{PHYS_ADDR} is a wildcard and will be replaced by a physical address based on
current edit indes. Suitable for testing edit-config performance with models
containing physical address.

Change-Id: I48a0a6eb2ccf903dadc02c87d9eb9dfcfe7bac07
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoFix checkstyle violations caused by checkstyle 6.1.1
Thanh Ha [Wed, 29 Apr 2015 02:25:15 +0000 (22:25 -0400)]
Fix checkstyle violations caused by checkstyle 6.1.1

Change-Id: I84f356707f97184ae8708e429c6b440db8bd632f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoMerge "Bug 2983: Added support for creation of multiple list entries"
Ed Warnicke [Mon, 27 Apr 2015 19:17:38 +0000 (19:17 +0000)]
Merge "Bug 2983: Added support for creation of multiple list entries"

9 years agoBug 2932: NPE on bundle activation
Marian Dubai [Wed, 22 Apr 2015 07:53:21 +0000 (09:53 +0200)]
Bug 2932: NPE on bundle activation

Error might occured when value containing YangStoreContext
is overwritten to null by refresh method, executed within another thread.
After fix, in case context is null, context is calculated again.

Change-Id: Icefe2a5970ec2ce0b67d5b3b386a35f781fc4156
Signed-off-by: Marian Dubai <mdubai@cisco.com>
9 years agoMerge "Bumped controller version by minor for next release cycle."
Tony Tkacik [Fri, 24 Apr 2015 22:09:43 +0000 (22:09 +0000)]
Merge "Bumped controller version by minor for next release cycle."

9 years agoBug 2983: Added support for creation of multiple list entries
Tony Tkacik [Fri, 24 Apr 2015 12:59:07 +0000 (14:59 +0200)]
Bug 2983: Added support for creation of multiple list entries

JSON payload for POST allows user to specify multiple list
entries to be created. This resulted in confusing behaviour
where only one entry was allowed.

Updated RESTCONF to allow multiple entry creation via POST
for lists only.

Change-Id: I7dc11098676d4e761e1b31a0504f3e5af75157f3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBumped controller version by minor for next release cycle.
Tony Tkacik [Thu, 23 Apr 2015 14:19:33 +0000 (14:19 +0000)]
Bumped controller version by minor for next release cycle.

Change-Id: I80ea0aecf42e5ee96dcebc68af1e872b1f10e7b5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Use ImmutableNodes.fromInstanceId in netconf"
Tony Tkacik [Fri, 24 Apr 2015 15:43:20 +0000 (15:43 +0000)]
Merge "Use ImmutableNodes.fromInstanceId in netconf"

9 years agoBUG 2954 : Thread local DocumentBuilder's for XmlUtil
Tomas Cere [Tue, 7 Apr 2015 13:49:33 +0000 (15:49 +0200)]
BUG 2954 : Thread local DocumentBuilder's for XmlUtil

Increases performance by reusing cached DocumentBuilder instances.

Change-Id: I5aab6b4caa960878b647e6868377d62dd6262cd9
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoMerge "Improve performance of XmlElement.getName"
Tony Tkacik [Fri, 24 Apr 2015 15:42:27 +0000 (15:42 +0000)]
Merge "Improve performance of XmlElement.getName"

9 years agoMerge "Stop SubtreeFitler from rereading reply even if no filter element is present."
Tony Tkacik [Fri, 24 Apr 2015 13:17:43 +0000 (13:17 +0000)]
Merge "Stop SubtreeFitler from rereading reply even if no filter element is present."

9 years agoMerge "Use ImmutableNodes.fromInstanceId in restconf"
Tony Tkacik [Fri, 24 Apr 2015 11:47:01 +0000 (11:47 +0000)]
Merge "Use ImmutableNodes.fromInstanceId in restconf"

9 years agoUse ImmutableNodes.fromInstanceId in netconf
Maros Marsalek [Wed, 22 Apr 2015 07:32:31 +0000 (09:32 +0200)]
Use ImmutableNodes.fromInstanceId in netconf

Build normalized node strcuture from Yang Instance Id using new utilities from
yang-data-impl.

Change-Id: I1862d17e2356b965d4875ce5e715891cf94b17fb
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Bug 3024 - Restconf PUT exception when top level node is from augmentation"
Tony Tkacik [Thu, 23 Apr 2015 21:15:25 +0000 (21:15 +0000)]
Merge "Bug 3024 - Restconf PUT exception when top level node is from augmentation"

9 years agoBug 3024 - Restconf PUT exception when top level node is from
Jan Hajnar [Tue, 21 Apr 2015 17:11:52 +0000 (19:11 +0200)]
Bug 3024 - Restconf PUT exception when top level node is from
augmentation

* added check for PUT into JsonNormalizedNodeBodyReader. If method is
PUT then data are unwraped from augmentations/choice nodes
* added wrapping of augmentation nodes when using XmlNormalizedNodeBodyReader
* commented out check for namespace in createConfigurationData (it should be
moved to parse stage)
* both XmlNormalizedNodeBodyReader and JsonNormalizedNodeBodyReader
should now produce the same normalized node data and paths for
equivalent XML and JSON input.

Change-Id: I21f4594d20170f33177cbae00791b81f6ae640b2
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoUse ImmutableNodes.fromInstanceId in restconf
Maros Marsalek [Wed, 22 Apr 2015 07:34:42 +0000 (09:34 +0200)]
Use ImmutableNodes.fromInstanceId in restconf

Build normalized node strcuture from Yang Instance Id using new utilities from
yang-data-impl.

Change-Id: Iee74bc0a7529b0fe7b901c04d2e26f9e2e60fac1
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoFix compile errors in NetconfDeviceSimulator
Tom Pantelis [Wed, 22 Apr 2015 17:44:27 +0000 (13:44 -0400)]
Fix compile errors in NetconfDeviceSimulator

Jenkins builds are failing due to compile errors in
NetconfDeviceSimulator apparently due to recent yangtools changes.

Change-Id: If48d23f8907f848def5f448bb95f10fd5486f89e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoStop SubtreeFitler from rereading reply even if no filter element is present.
Tomas Cere [Tue, 7 Apr 2015 09:49:40 +0000 (11:49 +0200)]
Stop SubtreeFitler from rereading reply even if no filter element is present.

Change-Id: Ib8c28e4289aa0d8b6c228c5daecec713c1c874f3
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoMerge "Improve xml lookup in edit-config rpc for md-sal"
Tony Tkacik [Tue, 21 Apr 2015 07:41:12 +0000 (07:41 +0000)]
Merge "Improve xml lookup in edit-config rpc for md-sal"

9 years agoMerge "Bug 2998 - RESTCONF not recogizing top-level input."
Tony Tkacik [Tue, 21 Apr 2015 07:40:38 +0000 (07:40 +0000)]
Merge "Bug 2998 - RESTCONF not recogizing top-level input."

9 years agoMerge "Netconf testtool stress client"
Tony Tkacik [Mon, 20 Apr 2015 15:23:49 +0000 (15:23 +0000)]
Merge "Netconf testtool stress client"

9 years agoNetconf testtool stress client
Maros Marsalek [Sat, 18 Apr 2015 17:44:46 +0000 (19:44 +0200)]
Netconf testtool stress client

Change-Id: I4bd351fe17e596e9153a48bf233432b8c8b19ea9
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Parse Xml Netconf msgs without defer-node-expansion option"
Tony Tkacik [Mon, 20 Apr 2015 08:28:55 +0000 (08:28 +0000)]
Merge "Parse Xml Netconf msgs without defer-node-expansion option"

9 years agoMerge "Fix compilation with JDK8"
Tony Tkacik [Mon, 20 Apr 2015 08:24:07 +0000 (08:24 +0000)]
Merge "Fix compilation with JDK8"

9 years agoBug 2998 - RESTCONF not recogizing top-level input.
Jan Hajnar [Fri, 17 Apr 2015 14:42:17 +0000 (16:42 +0200)]
Bug 2998 - RESTCONF not recogizing top-level input.

* added choice resolution when top level element is from case node.
Resolved choice is then fed into parser.

Change-Id: Iadea8cc3d190afb13fa2447edd05abd8708e591a
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoImprove xml lookup in edit-config rpc for md-sal
Maros Marsalek [Sat, 18 Apr 2015 21:10:38 +0000 (23:10 +0200)]
Improve xml lookup in edit-config rpc for md-sal

Lookup the attributes of rpc in xml payload directly to improve lookup
performance instead of using utility XmlElement class

Change-Id: I47e8f47f279ccbd271e5ed903a352ebbc307d0f9
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoImprove performance of XmlElement.getName
Maros Marsalek [Sat, 18 Apr 2015 18:41:15 +0000 (20:41 +0200)]
Improve performance of XmlElement.getName

getLocalName on a DOM element was called 3x instead of 1.

Change-Id: Ibc758bd440f601adc76d8f62972950d30906610b
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoParse Xml Netconf msgs without defer-node-expansion option
Maros Marsalek [Fri, 17 Apr 2015 11:46:21 +0000 (13:46 +0200)]
Parse Xml Netconf msgs without defer-node-expansion option

The defer-node-expansion expands inner nodes on traversal, but its suitable for
bigger xmls (100k bytes) and messages that are not fully traversed. This is not
the case with incomming netconf rpc.

Source:
https://xerces.apache.org/xerces2-j/faq-performance.html

Tested:
Netconf server pipeline performance was improved by 5-6%

Change-Id: I3bd4b917841f0ebe212ff753d6e0f655d618968c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoFix compilation with JDK8
Robert Varga [Sat, 18 Apr 2015 11:31:02 +0000 (13:31 +0200)]
Fix compilation with JDK8

Direct cast was not working, so restructure it a bit.

Change-Id: I58bb6ab2d636cdfe15d1a7ed9c47c393ff6a6920
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2358: Fixed warnings in Restconf"
Ed Warnicke [Thu, 16 Apr 2015 03:55:18 +0000 (03:55 +0000)]
Merge "Bug 2358: Fixed warnings in Restconf"

9 years agoMerge "Stop swallowing exceptions in XmlElement optional methods."
Tony Tkacik [Mon, 13 Apr 2015 09:11:40 +0000 (09:11 +0000)]
Merge "Stop swallowing exceptions in XmlElement optional methods."

9 years agoMerge "Remove isCloseMsg check for each rpc"
Tony Tkacik [Mon, 13 Apr 2015 07:46:46 +0000 (07:46 +0000)]
Merge "Remove isCloseMsg check for each rpc"

9 years agoMerge "BUG 1848 : Use OrderedNormalizedNodeWriter in rpc transformation."
Tony Tkacik [Fri, 10 Apr 2015 09:59:33 +0000 (09:59 +0000)]
Merge "BUG 1848 : Use OrderedNormalizedNodeWriter in rpc transformation."

9 years agoMerge "BUG-1848 : OrderedNormalizedNodeWriter implementation"
Tony Tkacik [Fri, 10 Apr 2015 09:56:01 +0000 (09:56 +0000)]
Merge "BUG-1848 : OrderedNormalizedNodeWriter implementation"