controller.git
8 years agoMake constants really constant 24/22724/5
Robert Varga [Tue, 16 Jun 2015 19:23:21 +0000 (21:23 +0200)]
Make constants really constant

This triggers a major sonar warning, and is insecure as these fields could
get modified by anyone, throwing the system out of whack.

Also optimize comparison and make sure the netconf QNameModule is cached.
Also prevent unneeded QName instantiation.
Also use an immutable list to hold arguments, preventing a copy in
builders.

Change-Id: I74647c444ec273066fc4727618b35c92386ba77c
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse correct boolean values for XML JSON tests. 97/22697/2
Tony Tkacik [Tue, 16 Jun 2015 14:18:08 +0000 (16:18 +0200)]
Use correct boolean values for XML JSON tests.

Change-Id: Ia608f4fdc885e94112e076bf669e67f5c136da03
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoMake sure DataTreeModifications are ready. 83/22683/1
Tony Tkacik [Tue, 16 Jun 2015 11:05:56 +0000 (13:05 +0200)]
Make sure DataTreeModifications are ready.

Change-Id: I1fa957d0f827f34187c4f22b7896581447159890
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoFix unit test failures 59/22659/3
Tom Pantelis [Tue, 16 Jun 2015 01:11:19 +0000 (21:11 -0400)]
Fix unit test failures

A couple tests in ShardTransactionTest are failing on jenkins builds:

java.lang.AssertionError: assertion failed: expected class
org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages$CommitTransactionReply,
found class akka.actor.Status$Failure
at scala.Predef$.assert(Predef.scala:179)
at
akka.testkit.TestKitBase$class.expectMsgClass_internal(TestKit.scala:424)
at
akka.testkit.TestKitBase$class.expectMsgClass(TestKit.scala:419)
at akka.testkit.TestKit.expectMsgClass(TestKit.scala:718)
at akka.testkit.JavaTestKit.expectMsgClass(JavaTestKit.java:408)
at
org.opendaylight.controller.cluster.datastore.ShardTransactionTest$14.<init>(ShardTransactionTest.java:474)
at
org.opendaylight.controller.cluster.datastore.ShardTransactionTest.testOnReceiveBatchedModificationsReadyWithImmediateCommit(ShardTransactionTest.java:454)

The tests use a "desc" leaf node but it's not defined in the test yang.
Nothing has changed in these tests so it appears there was a recent change
in yangtools to validate the node structure on put/merge.

I also fixed an intermittent timing failure in
PreLithiumShardTest#testHelium2VersionApplyStateLegacy that I see a
couple times.

Also, JsonToNnTest  has been failing on merge builds:

org.junit.ComparisonFailure: expected:<...me cont wasn't found[].> but
was:<...me cont wasn't found[ under
(urn:ietf:params:xml:ns:netconf:base:1.0)data].>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at
org.opendaylight.controller.sal.restconf.impl.json.to.nn.test.JsonToNnTest.incorrectTopLevelElementsTest(JsonToNnTest.java:129)

Apparently a change elsewhere added more text to the error message. I
changed the test to use the containsString matcher instead of exact
match.

Change-Id: I33ef71bce50ff39e26dcf2b443679c8eb34dd0dd
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 2358 - Remove tests cnsn to json and add tests nn to json 85/21185/7
Jakub Toth [Wed, 27 May 2015 09:41:45 +0000 (11:41 +0200)]
Bug 2358 - Remove tests cnsn to json and add 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.

* remove CnSnToJsonNotExistingLeafTypeTest.java test
* add NnToJsonNotExistingLeafTypeTest.java to nn/to/json/test/
  * test with not existing leaf type

Change-Id: Id7a1256b42a3a754e13343613dcad7059a2316c4
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to json and add tests nn to json 91/21191/7
Jakub Toth [Wed, 27 May 2015 10:44:31 +0000 (12:44 +0200)]
Bug 2358 - Remove tests cnsn to json and add 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.

* remove CnSnToJsonWithAugmentTest test
* add NnToJsonWithAugmentTest to nn/to/json/test/
  * positive test for test augmented elements

Change-Id: I4c8b92e828ade1d43a5af5384ec7938854fda9ce
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoRemoved uncessary calls to RpcBroker to find routes. 76/22376/7
Tony Tkacik [Thu, 11 Jun 2015 15:19:46 +0000 (17:19 +0200)]
Removed uncessary calls to RpcBroker to find routes.

Moved invokeRpc part to RemoteRpcImplementation
which allowed to do ask for lookups in RemoteRpcImplementation.

This changed role of RpcBroker part to only delegate
to MD-SAL, if RPC was received via Akka.

remote.rpc.RpcBroker interaction model represented
multi-stepped pipeline which resulted in following
message pattern

RemoteRpcImplementaion ->
RpcBroker#InvokeRpc ->
RpcRegistry#FindRoutes ->
RpcBroker#ExecuteRpc

InvokeRpc only did lookup in FindRoutes and all
outgoing messages needed to pass via RpcBroker.
Unfortunatelly this also prevented lookup
of any RPC Path during executing RPC in MD-SAL.

Change-Id: I6e84bfcb74b71f7417c2d3f8c35a7f8b0406caf9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 2358 - Remove tests json to cnsn and add tests json to nn 20/19520/9
ary [Wed, 29 Apr 2015 10:09:41 +0000 (12:09 +0200)]
Bug 2358 - Remove tests json to cnsn and add tests json to nn

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.

* remove all tests json to composite node and simple node
* rewrite json leafref input tests from comp and simple node to normalized node
  * we're testing REST provider URI path translator with payload
* add test for test data in json with identityref to normalized node
  * positive test
  * test data in builded normalized node with data in json
    * used identityref type to reference an existing identity
* add test for test data in json with leafref to normalized node
  * positive test
  * test data in builded normalized node with data in json
    * used leafref type to reference particular leaf instance in the data tree
* add test for test data in json with more type of nodes and values
  * positive tests
    * test normalized node from json with:
      * simple data in list
      * simple data in container
      * multiple items in leaf-list
      * multiple items in list
      * empty leaf
      * augmented data
  * negative tests
    * test fail on bad top level elements
      * contains 3 situations
    * test fail for null data
      * empty leaf-list
      * leaf without any value
    * test on build normalized node with blank json
    * test fail with different namespaces
    * test fail because of unsupported format of json
    * test on invalid URI character

Change-Id: Icb5ff5d11843123c79859a0c75d7df7bad8a0b44
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 868 - Continuous: remove deprecated APIs 71/22271/3
Jan Hajnar [Wed, 10 Jun 2015 11:55:42 +0000 (13:55 +0200)]
Bug 868 - Continuous: remove deprecated APIs

* removed deprecated API from Bug3595Test

Change-Id: Ic8f987aeb000cfb150286ad44e478771e8a52384
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to json and add tests nn to json 88/20888/7
Jakub Toth [Wed, 20 May 2015 21:34:52 +0000 (23:34 +0200)]
Bug 2358 - Remove tests cnsn to json and add 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.

* add test NnToJsonLeafrefType to nn/to/json/test
  * positive tests of leafref
    * absolut path
    * relative path
    * leafref to not leaf
    * from leaflist to leaf
    * from leafref to leafref
  * negative tests of leafref
    * non existing Leaf

Change-Id: I652204071d874d6c7a2a65e100dd68c16a12af8f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to json and add tests nn to json 10/20510/13
ary [Fri, 15 May 2015 13:25:08 +0000 (15:25 +0200)]
Bug 2358 - Remove tests cnsn to json and add 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.

* remove CnSnJsonChoiceCaseTest test
* add NnJsonChoiceCaseTest to nn/to/json/test/
  * positive and negative tests for choice statement

Change-Id: I83d351bf0de9bb4a1c649c5851209ae472aaaa24
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Fix resources for tests nn to json 71/21871/4
Jakub Toth [Thu, 4 Jun 2015 12:45:53 +0000 (14:45 +0200)]
Bug 2358 - Fix resources for tests nn to json

yang's namespace fix

Change-Id: I4b31cde6d9dc56b8298877b50c21a551c39f645f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 36/21536/5
Jakub Toth [Mon, 1 Jun 2015 08:53:53 +0000 (10:53 +0200)]
Bug 2358 - Remove tests cnsn to xml and add 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.

* remove CnSnToXmlWithDataFromSeveralModulesTest test
* add NnToXmlWithDataFromSeveralModulesTest to nn/to/xml/test/
  * positive test for test more modules

Change-Id: I4f4eea89487e946b0a4a7edd75423d6bf551bd20
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 27/21527/5
Jakub Toth [Mon, 1 Jun 2015 07:34:50 +0000 (09:34 +0200)]
Bug 2358 - Remove tests cnsn to xml and add 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.

* remove CnSnInstanceIdentifierToXmlTest test
* add NnInstanceIdentifierToXmlTest to nn/to/xml/test/
  * positive test for instance identifier

Change-Id: Iceb73ed4d96f7686fca04047524716532297a2f8
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 30/21530/5
Jakub Toth [Mon, 1 Jun 2015 08:15:54 +0000 (10:15 +0200)]
Bug 2358 - Remove tests cnsn to xml and add 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.

* remove CnSnToXmlTest test
* add NnToXmlTest to nn/to/xml/test/
  * positive tests for basic data types

Change-Id: Iac408dc8ce25c8d9c46a21863733b30390ea8c34
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 32/21532/5
Jakub Toth [Mon, 1 Jun 2015 08:33:58 +0000 (10:33 +0200)]
Bug 2358 - Remove tests cnsn to xml and add 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.

* remove CnSnToXmlWithChoiceTest test
* add NnToXmlWithChoiceTest to nn/to/xml/test/
  * positive test for choice statement

Change-Id: Ie3fba1c51db57ef7621703812f7a98b6d417feca
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 31/21531/5
Jakub Toth [Mon, 1 Jun 2015 08:24:40 +0000 (10:24 +0200)]
Bug 2358 - Remove tests cnsn to xml and add 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.

* remove CnSnToXmlNotExistingLeafTypeTest test
* add NnToXmlNotExistingLeafTypeTest to nn/to/xml/test/
  * negative test for not existing leaf type

Change-Id: I6f55fd82c40a03726aecb78cfc2ece9888cf9717
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBUG-3552 Introduce custom java.security config file 61/22261/4
Maros Marsalek [Wed, 10 Jun 2015 08:30:29 +0000 (10:30 +0200)]
BUG-3552 Introduce custom java.security config file

Set the list of excluded ciphers available for use in ODL. The list was
developed in order to disable weak/vulnerable ciphers and also to prevent
the Logjam exploit.

The security file can be set using ODL_JAVA_SECURITY_PROPERTIES env variable.

Change-Id: I4867fe05986c020e09938c138d4d033299e0f9b7
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBUG 2970 : Recovery fails with SchemaValidationException when removing modules 29/22429/5
Moiz Raja [Fri, 12 Jun 2015 01:29:07 +0000 (18:29 -0700)]
BUG 2970 : Recovery fails with SchemaValidationException when removing modules

My prior fixes for bug 2970 did not address the recovery problem when a module is
removed but it's data is still present in the persisted files. This patch attempts
to address that.

There seems to be no schema validation when you write a normalized node at / so
for when writing or merging at / the pruning is done first before attempting a
write on InMemoryDataTreeModification

Also removed all unneccessary code.

Change-Id: Id2793330441606c62dfd903cdd698c2f86b14c1b
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 3652 : GZip restconf response 17/22317/3
Moiz Raja [Thu, 11 Jun 2015 01:10:07 +0000 (18:10 -0700)]
BUG 3652 : GZip restconf response

Change-Id: I15161eb011185b3e477484ad15b90a701a2e08e7
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoChange variables, methods, field names from transactionContextAdapter to transactionC... 04/22304/4
Moiz Raja [Wed, 10 Jun 2015 18:33:00 +0000 (11:33 -0700)]
Change variables, methods, field names from transactionContextAdapter to transactionContextWrapper

Change-Id: I675df3d3c5ace1fcb4b82025e862eafa8cc37357
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG-3675 Support non-prefixed identityrefs in config subsystem 74/22374/3
Maros Marsalek [Thu, 11 Jun 2015 14:39:29 +0000 (16:39 +0200)]
BUG-3675 Support non-prefixed identityrefs in config subsystem

If a non prefixed but valid identityref was submitted as e.g. service type,
netconf connector for config subsystem failed.

Change-Id: I59dbb7dc83da9558db06118bdf1296f1ab9d782f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBUG 3019 : Fix Operation throttling for modification batching scenarios 44/22244/9
Moiz Raja [Wed, 10 Jun 2015 01:37:35 +0000 (18:37 -0700)]
BUG 3019 : Fix Operation throttling for modification batching scenarios

This patch straightens out where exactly limiting is done.

A TransactionProxy creates a TransactionContext for every shard on
which a transaction needs to be done. There are 3 types of TransactionContexts.
NoOpTransactionContext, LocalTransactionContext and RemoteTransactionContext.
When a operation is done on TransactionProxy it does not know which of these
TransactionContexts it should create so it first createas a TransactionContextWrapper.
All operations on TransactionProxy are then queued up in the TransactionContextWrapper
till we determine which TransactionContext to create. This patch creates an
OperationLimiter per TransactionContextWrapper. Everytime an operation is enqueued
we acquire a permit.

When the TransactionContext is finally created we do different things depending on
the TransactionContext. For NoOp and Local TransactionContexts we completely ignore
the limiter - that is for these TransactionContexts there is no limiting done. For
RemoteTransactionContext we do limiting. RemoteTransactionContext does not acquire
Operation permits till it is made visible by the TransactionContextWrapper - this is
signaled be the setting of the handOffComplete flag in AbstractTransactionContext.
After that RemoteTransactionContext takes over the business of acquiring permits.
OperationLimiter which also serves as the Operation completion handler is the only
component that releases the permits.

Another thing which this patch addresses is which configuration option we use for
operation limiting. We now use ShardBatchedModificationCount instead of the mailbox
limit from akka.conf. This removes the possibility of mis-configuration where
making ShardedBatchedModificationCount higher than mailbox limit could cause
unexpected blocking.

Change-Id: I571ba5278630e5166be6bcb3ff8e1c527c5e3343
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 3570: Use SnapShot lastAppliedIndex for install snapshot 85/22285/4
Tom Pantelis [Wed, 10 Jun 2015 06:17:21 +0000 (02:17 -0400)]
Bug 3570: Use SnapShot lastAppliedIndex for install snapshot

Follow-up patch for https://git.opendaylight.org/gerrit/#/c/21904/ to
use the captured Snapshot's lastAppliedIndex for the lastIncludedIndex
field in the InstallSnapshot message and the follower's matchIndex/nextIndex
once the install completes. This is in lieu of using the leader's snapshotIndex
which typically lags behind the lastAppliedIndex by 1 due to the trimming of
the in-memory log. This avoids the leader sending its last log entry
redundantly after the install completes as the last entry was included
in the snapshot.

Change-Id: Ie821078b4316641b67e1b853b9264353dde6bfae
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFix NetconfMessageTransformerTest 09/22309/1
Moiz Raja [Wed, 10 Jun 2015 22:36:45 +0000 (15:36 -0700)]
Fix NetconfMessageTransformerTest

It fails and breaks the build

Change-Id: I1d3bb2d47417f3cb6d6f7246cadc0cc479a5ff4f
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 3595 - RESTCONF: GET operation on a node in a list, identified by 12/22112/2
Jan Hajnar [Mon, 8 Jun 2015 15:28:12 +0000 (17:28 +0200)]
Bug 3595 - RESTCONF: GET operation on a node in a list, identified by
leaf-ref fails.

* added referenced type resolution for leafrefs in ControllerContext

Change-Id: Ic38b77038feb786a46a8bdd069448f006418d7bf
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoBUG 2155 - depth parameter in URI 75/21675/6
Jan Hajnar [Tue, 2 Jun 2015 15:47:08 +0000 (17:47 +0200)]
BUG 2155 - depth parameter in URI

* added interface RestconfNormalizedNodeWriter
* added two implementations of RestconfNormalizedNodeWriter,
RestconfDelegatingNormalizedNodeWriter just calls normalized node
writer from yangtools and DepthAwareNormalizedNodeWriter is writer
implementation tha checks depth
* added CutDataToCorrectDepthTest (randomly failing, needs to be checked
or removed for now)
* added condition to xml and json normalized node writers to create
depth aware normalized node writer id depth is specified in writer parameters

Change-Id: I922942e24cbe505c2803644c25acd755fe4dfae7
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoBug 2153 - pretty printer 77/20877/8
Jan Hajnar [Thu, 21 May 2015 07:46:57 +0000 (09:46 +0200)]
Bug 2153 - pretty printer

NormalizedNodeJsonBodyWriter - added ability to create JsonWritter with
prettyPrint enabled
NormalizedNodeXmlBodyWriter - added IndentingXMLStreamWriter when
prettyPrint is enabled

NormalizedNodeContext - info about requirements on indentation (true |
false) was added

RestconfImpl - added pretty print parsing method and added pretty print
detection to GET methods and RPC call methods

Change-Id: I44cfa778279d67f7dc1bf1532cd7fc1087b492dc
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoAdd a keepalive executor to controller config loopback connection. 34/21934/3
Maros Marsalek [Tue, 9 Jun 2015 11:19:47 +0000 (13:19 +0200)]
Add a keepalive executor to controller config loopback connection.

Change-Id: Id4b93df4eb59a19dea2d00b348db3dd4866338cb
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 3570: Persist snapshot on follower ApplySnapshot 04/21904/7
Tom Pantelis [Tue, 9 Jun 2015 13:32:52 +0000 (09:32 -0400)]
Bug 3570: Persist snapshot on follower ApplySnapshot

When a leader installs a snapshot on a follower, the follower now
perists the snapshot.

Change-Id: I56e25aa80f335e41a992ddce084c84c2a345b03b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 3020: Use leader version in LeaderStateChanged 03/21603/5
Tom Pantelis [Tue, 2 Jun 2015 01:30:59 +0000 (21:30 -0400)]
Bug 3020: Use leader version in LeaderStateChanged

Modified the ShardManager to store the leader's version obtained from the
LeaderStateChanged message in the ShardInformation and propagate to the
RemotePrimaryShardFound message in response to FindPrimary.

ActorContext#findPrimaryShardAsync sets the leader's version in the
PrimaryShardInfo based on the FindPrimary response. If the response is
LocalPrimaryShardFound, it sets it to CURRENT_VERSION, otherwise it sets
it from the RemotePrimaryShardFound response.

RemoteTransactionContextSupport#setPrimaryShard checks the leader's
version to determine if it can utilize the direct tx modification
preparation on the shard actor.

Change-Id: I1defe03dea27dfb652cdc1e0a02fa70c6e454035
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoRemote RPC Broker: Make Futures non-blocking. 19/22219/3
Tony Tkacik [Tue, 9 Jun 2015 16:59:16 +0000 (18:59 +0200)]
Remote RPC Broker: Make Futures non-blocking.

Change-Id: I06eedf5eea33458f88b3bad94afcc8c1d85a9c19
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-3604 Ignore empty edits in netconf connector 59/22159/2
Maros Marsalek [Tue, 9 Jun 2015 08:15:35 +0000 (10:15 +0200)]
BUG-3604 Ignore empty edits in netconf connector

Ignore merge/put operation with data that result in an empty edit-config rpc.
Some netconf devices ignore it, but some dont and return errors.

This kind of merge is triggered e.g. by Restconf when trying to ensure parent
structure for top level list.

Change-Id: I8351be304f4e55e000eb7fe0da262549ec377459
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 3640 - RPC call error - impossible to call rpc 82/22182/4
Jan Hajnar [Tue, 9 Jun 2015 11:02:45 +0000 (13:02 +0200)]
Bug 3640 - RPC call error - impossible to call rpc

* disabled children search in post if request is rpc input
* fixed XmlNormalizedNodeBodyReader tests that were testing on wrong rpc
input data

Change-Id: I2602d34a4ab42169959b867acaffa988a11601f3
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoAvoid ClassCastException in remote-rpc-connector 40/22140/2
Moiz Raja [Tue, 9 Jun 2015 02:22:28 +0000 (19:22 -0700)]
Avoid ClassCastException in remote-rpc-connector

Change-Id: Idc41c2d4409ac321bc47e48150c801166999ce17
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoMigrate to MoreObjects 40/22040/4
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>
8 years agoBUG-2838: Trim leading whitespaces from incoming NETCONF messages. 78/20878/5
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>
(cherry picked from commit eb3ebced9d3471644dece3e4e27cca9451db0685)

8 years agoSet revisions for notification models in netconf 09/22109/2
Maros Marsalek [Mon, 8 Jun 2015 15:20:40 +0000 (17:20 +0200)]
Set revisions for notification models in netconf

Change-Id: I83159f20250914c9e178b83dc526d9e9e14dce74
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBump maven-archetype plugin to 2.3 18/21518/3
Robert Varga [Sun, 31 May 2015 23:29:44 +0000 (01:29 +0200)]
Bump maven-archetype plugin to 2.3

This is a newer version, so make a central bump.

Change-Id: I512b2ec1db75db53e47e23458fa99724e22eef53
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUnify declarations in archetype-parent 17/21517/4
Robert Varga [Sun, 31 May 2015 23:20:04 +0000 (01:20 +0200)]
Unify declarations in archetype-parent

Instead of repeating extends/pluginManagement sections, make sure they
are inherited from the parent.

Change-Id: I49882c57221a5c5806d936ff3b94cf71aeef64e6
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoMove operation limiter down to TransactionContextWrapper 55/20755/14
Robert Varga [Tue, 19 May 2015 20:04:10 +0000 (22:04 +0200)]
Move operation limiter down to TransactionContextWrapper

The limiter tracks the number of operations invoked on the shard leader,
which does not correspond to the number of operations executed on the
frontend.

The appropriate entity to decide what is throttled how is the
TransactionContext, which unfortunately may not exist. We will solve
this problem by making TransactionContextWrapper perform pessimistic
limiting as long as the context does not exist. Once the context is
materialized, the outstanding operation queue is handed off to it and
the context becomes the entity managing the limits.

This patch has the side-effect that committing a transaction requires
number of permits equal to the number of shards it touches. It also
ensures that readAll() is properly throttled.

Change-Id: If91816d806bbb3895592e1f42b0b8e389443d0f7
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoConvert OperationCompleter to OperationLimiter 54/20754/11
Robert Varga [Tue, 19 May 2015 19:50:12 +0000 (21:50 +0200)]
Convert OperationCompleter to OperationLimiter

The completer and limiter functions are related to each other, so
encapsulate them in a single object.

Since a TransactionProxy cannot really do anything without touching the
limiter, make sure we instantiate it in constructor, preventing some
volatile reads in the fast path.

Change-Id: I4cf31ef46c11676611a62db7a794f504712ce5af
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3039 - PUT augmentNode like last path element 47/21847/4
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>
8 years agoFix various netconf warnings 39/22039/2
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>
8 years agoBug 3020: Add leader version to LeaderStateChanged 84/19184/3
Tom Pantelis [Fri, 24 Apr 2015 22:26:22 +0000 (18:26 -0400)]
Bug 3020: Add leader version to LeaderStateChanged

Added the leader's payload version to the LeaderStateChanged message and
modified the raft code to set it.

Change-Id: I9a34f90641a2962418d234bb56e55f2df5207e5b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoCheck total batched messages sent in ShardCommitCoordinator on tx ready 00/21500/3
Tom Pantelis [Sat, 30 May 2015 09:06:46 +0000 (05:06 -0400)]
Check total batched messages sent in ShardCommitCoordinator on tx ready

Added check in the ShardCommitCoordinator to ensure the total number of
batched messages sent equals the total number of messages received as
was done in the ShardWriteTransaction.

Change-Id: I86a67aec7a6a8e8994aee9a2a167972ede1808c7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 3372: Convert backend DataTree exceptions appropriately 26/22026/2
Tom Pantelis [Sat, 6 Jun 2015 12:06:48 +0000 (08:06 -0400)]
Bug 3372: Convert backend DataTree exceptions appropriately

Specifically, convert ConflictingModificationAppliedException to
OptimisticLockFailedException and
DataValidationFailedException to TransactionCommitFailedException.

Change-Id: I7962e80d1fd51e818d17ed29a3e81262a78f9c3d
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 2787: Batch AppendEntries to speed up follower sync 01/21701/6
Tom Pantelis [Tue, 2 Jun 2015 06:55:15 +0000 (02:55 -0400)]
Bug 2787: Batch AppendEntries to speed up follower sync

AbstractLeader#sendUpdatesToFollower now attempts to send all entries
to the follower to catch it up with 1 AppendEntries message. However, we
don't want to send too large a message and risk exceeding akka's message
size limit. So I added another param, maxDataSize, to
ReplicatedLog#getFrom. It will attempt to add all entries up to
maxEntries but stops if the accumulated data size exceeds maxDataSize.

For maxDataSize, I reused the existing snapshotChunkSize (default 2M)
defined in ConfigParams. This currently is hard-coded - we may want to
make this configurable.

Change-Id: Ib2c1165c4140a36f4eada8f81b4261260615dd18
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFix clustering-test app rpcs to add new data ensuring parents 06/22006/2
Moiz Raja [Fri, 5 Jun 2015 20:54:35 +0000 (13:54 -0700)]
Fix clustering-test app rpcs to add new data ensuring parents

The add-person rpc needs to pass true for ensureParents when adding
a person into the datastore. This ensures that it can be called on
an empty model.

Similarly when the CarBought notification is received and we try to
add a car-person to the datastore we need to do it with ensureParents
so that the data can be added to an empty model.

Change-Id: I551038298d635ff6daed0f5dae49a6eda86a24cb
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 3566 : Get remote-rpc working again 90/21890/5
Moiz Raja [Thu, 4 Jun 2015 17:18:30 +0000 (10:18 -0700)]
BUG 3566 : Get remote-rpc working again

Some changes to moving from CompositeNode to NormalizedNode had broken
remote rpc. This patch attempts to get it working again.

Verified everything works in a 3 node cluster with the clustering-test-app

Change-Id: I2ec714f1d21d95812bd5b486260be3575df252a2
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 3340 : Log the count of modifications on a given transaction context 98/21898/3
Moiz Raja [Thu, 4 Jun 2015 18:40:57 +0000 (11:40 -0700)]
BUG 3340 : Log the count of modifications on a given transaction context

This log statement is to give a quick summary count - I found it useful for
debugging

Change-Id: I5ec2cb13fb75182bc94b3728188378fae2e55b43
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 3189: Check consistency of Instance Identifier and Data 26/20226/5
Tony Tkacik [Wed, 13 May 2015 09:24:36 +0000 (11:24 +0200)]
Bug 3189: Check consistency of Instance Identifier and Data

Change-Id: If6f5cf8b28eb27cba89faf8a7c9489ed7fdc3dca
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoStreamline updating out-of-sync follower 85/21485/7
Tom Pantelis [Sat, 30 May 2015 03:27:33 +0000 (23:27 -0400)]
Streamline updating out-of-sync follower

The first AppendEntries message a leader sends to a follower contains
the leader's entry at the current commit index as it doesn't know the
follower's next index yet. If the the previous index isn't present
in the follower's log, the follower sends back an unsuccessful reply. The
leader then decrements the prior index it just sent and sends the
next message. This continue's until the next index gets down to the
follower's last index (or -1 if the follower's log is empty). Then
it succeeds on the follower and the leader increments the next index
and sends the rest.

This results in at least twice the number of messages sent to sync the
follower. The follower sends back its lastIndex in the unsuccessful
responses so it seems to make sense for the leader to use that index
instead of decrementing what it thinks might be the next index. This
eliminates the excessive AppendEntries messages. However we should only
do this is the follower's last index is present in the leader's log and
the terms match. Otherwise we fall back to decrementing the index.

Change-Id: If49ed48e8c70cb87b06b48a5ed3e6b0bbb6efc36
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBUG-2150 Report errors for semantic issues with config snapshots 11/21411/3
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>
8 years agoBug 2521 - Wrong return status code for non-existing mount-point 62/21662/2
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>
8 years agoFix duplicate dependency declarations 16/21516/5
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>
8 years agoMinor changes in LibLLDP. 01/21301/4
Jozef Gloncak [Thu, 28 May 2015 09:20:40 +0000 (11:20 +0200)]
Minor changes in LibLLDP.

- change modifier of emptyTLV field to final
- added cisco header to CustomTLVKey class
- formatting CustomTlvKey and LLDPTest classes

Change-Id: Ic347f549fb3ba3a97e9b6f02883445c852cd3eb8
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
8 years agoFix Subtree filter failing prefix lookup in element. 06/20806/4
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>
8 years agoHttp client for testing restconf 07/20807/9
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>
8 years agoBUG 2610: Delete config:service instance via restconf 96/21296/4
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>
8 years agoBUG-3438 Prevent null pointer for keepalives(netconf-connector) 35/21535/3
Maros Marsalek [Mon, 1 Jun 2015 08:47:41 +0000 (10:47 +0200)]
BUG-3438 Prevent null pointer for keepalives(netconf-connector)

Change-Id: If480ddb8c6a494eca5affc9d93db6f1fd11e5972
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBUG 2596: Use base service name in service serialization. 61/21561/4
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>
8 years agoBug 568 - Websockets: Test & fix data change notifications 20/21620/2
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>
8 years agoBug 2358 - Decrease Technical Debt 53/21853/3
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>
8 years agoBug 2358 - Resources for tests nn to xml 22/21522/3
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>
8 years agoBug 2970: Remove SchemaContextModules perisistence 01/20901/5
Tom Pantelis [Sun, 17 May 2015 16:20:05 +0000 (12:20 -0400)]
Bug 2970: Remove SchemaContextModules perisistence

Now that the GlobalBundleScanningSchemaServiceImpl has been fixed to
load all schema contexts on startup, we no longer need to persist the
last known schema context modules in the ShardManager.

Change-Id: Ie5d261e3725c680d4365d63fecdb2115772f69ba
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFix intermittent ToasterTest failures 77/21777/2
Tom Pantelis [Sat, 30 May 2015 05:54:44 +0000 (01:54 -0400)]
Fix intermittent ToasterTest failures

The ToasterTest has been intermittently failing on jenkins for a while.
I repro'ed it locally after 5 tries. An error occurs indicating it
can't find the pingpong-databroker namespace. Not sure why this occurs
intermittently.

The test doesn't need/use the pingpong databroker so I commented it out
in the controller.xml. After this change the test ran successfully 80
times.

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

8 years agoBUG 3555: disable RC4 in mina-sshd 92/21792/2
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>
8 years agoBug 3067: Enable blocking behaviour 36/21136/3
Tony Tkacik [Tue, 26 May 2015 14:07:15 +0000 (16:07 +0200)]
Bug 3067: Enable blocking behaviour

MD-SAL Binding components will block user threads
till schemas for used binding classes is loaded
or 5sec timeout expires.

Change-Id: Ib1280e0d68e7bda979ad0e944b1e7d199a243399
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-3436 Fix UNION type leaves resolution in config subsystem 47/21547/2
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>
8 years agoBUG 2970 : Handle SchemaValidationFailedException instead of IllegalArgumentException 95/21595/1
Moiz Raja [Tue, 2 Jun 2015 01:28:32 +0000 (18:28 -0700)]
BUG 2970 : Handle SchemaValidationFailedException instead of IllegalArgumentException

Switch to handling the more specific SchemaValidationFailedException.

Change-Id: Id2f07aae4f45bb11257906fcc157e679b7e34948
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 3067: Added support for blocking if schema is not available. 07/19607/5
Tony Tkacik [Tue, 5 May 2015 11:57:57 +0000 (13:57 +0200)]
BUG 3067: Added support for blocking if schema is not available.

Codecs are able to send specific exception, which describes
reason of failure for codec failing. If the reason is
missing schema (not yet loaded) we catch it and retry
serialization after schema context is upgraded.

User thread will be blocked maximally for 5 seconds
after that it will be unblocked.

Change-Id: I3494702eae644b495211a1a34c074e268c2f5f46
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoRemove PrimaryShardInfoFutureCache entry on UnreachableMember event 95/21495/2
Tom Pantelis [Sat, 30 May 2015 07:15:10 +0000 (03:15 -0400)]
Remove PrimaryShardInfoFutureCache entry on UnreachableMember event

The ShardManager removes the PrimaryShardInfoFutureCache entry when
leadership changes. We should do the same for UnreachableMember events.

Change-Id: I9582450f1c319e6967f43aacd1b0dd668e2654d6
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug:3260-Recovery misses flows installed on single node 72/21372/3
Kamal Rameshan [Thu, 28 May 2015 20:54:48 +0000 (13:54 -0700)]
Bug:3260-Recovery misses flows installed on single node

There are 2 bugs which were enountered
1. When akka replays the journal, it replays it from the peristent journal's sequence number present at the time of snapshot success
2. The log entry on which a snapshot capture is triggered does not make it to that snapshot and gets removed from persistent journal as well.
So on recovery, that log entry/data is missing

To fix the first, the snapshotSeqNr() method of UnTypedPersistenActor is overridden, so that akka uses the cached last-sequence-number rather than using its own

To fix the second issue, the capture of snapshot for single node is done after applyState. This ensures that the persistent journal and snapshot are in sync

Also the in-memory journal was replaying all its messages and not honoring the fromSequenceNr, like akka does. So fixed it.

The tests needed to be fixed primarily due to the in-memory journal change.

A new test is added to test out the recovery of single node.

Change-Id: I779d1d6ce9880b19322d831ef5c8696b4c751e3d
Signed-off-by: Kamal Rameshan <kramesha@cisco.com>
8 years agoAddress comments in https://git.opendaylight.org/gerrit/#/c/18392/ 99/21499/2
Tom Pantelis [Sat, 30 May 2015 08:30:34 +0000 (04:30 -0400)]
Address comments in https://git.opendaylight.org/gerrit/#/c/18392/

Patch https://git.opendaylight.org/gerrit/#/c/18392/ was merged with
some minor comments. This follow-up patch addresses them.

Change-Id: I1842a85f35021b598e1ded0b334453fd7751d9f7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFix archetype compilation 15/21515/2
Robert Varga [Sun, 31 May 2015 23:16:36 +0000 (01:16 +0200)]
Fix archetype compilation

Change-Id: I9217cb78881118c46c81f7c5d4f8c9bafe82d3fd
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3427 - Websockets: Cannot create stream if path contains predicates 75/21375/4
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>
8 years agoBUG 3340 : Improve logging 86/21286/2
Moiz Raja [Thu, 28 May 2015 02:22:40 +0000 (19:22 -0700)]
BUG 3340 : Improve logging

- In SimpleShardDataTreeCohort we log the contents of the tree at debug level. This
  makes it impossible to turn on debug for the package org.opendaylight.cluster.datastore
- At some point we seem to have lost the feature to include the chain number in the transaction
 identifier. I added that back in.

Change-Id: Ifd6cd4c9f5c49790dfb045d2800b5a8beef19b37
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 3104 - fixed XmlNormalizedNodeBodyReader 94/21394/1
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>
8 years agoBUG 2970 : Create a PruningDataTreeModification 16/21016/7
Moiz Raja [Sat, 23 May 2015 00:22:02 +0000 (17:22 -0700)]
BUG 2970 : Create a PruningDataTreeModification

The PruningDataTreeModification automatically tries to prune the passed
in NormalizedNode if an IllegalArgumentException is thrown when doing
a write or a merge on the DataTreeModification.

*I know* that doing the pruning on IllegalArgumentException is flaky but
that is the best I can do unless we can change the implementation in yangtools
to throw a more specific exception when the data node does not map to a
the schema context

Change-Id: Iea0cea82eda8bd51c1f3f07b063404458798c348
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 3376: Add debug context for CDS transactions 26/21226/4
Tom Pantelis [Wed, 27 May 2015 06:03:20 +0000 (02:03 -0400)]
Bug 3376: Add debug context for CDS transactions

Added a new setting, transaction-context-debug-enabled, to the config yang
to enable/disable debug context that outputs the call site trace for
TransactionProxy instances for failed transactions.

Change-Id: I8b1a393871be4fa076054681c62c14fd68dc74b7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoImprove BindingDOMRpcImplementationAdapter performance 18/21318/4
Robert Varga [Thu, 28 May 2015 11:20:30 +0000 (13:20 +0200)]
Improve BindingDOMRpcImplementationAdapter performance

BindingReflections return a non-shared QNameModule instance, which means
that we may end up using suboptimal lookups when comparing QNames.
Furthermore it is not the QNameModule which we need in the fastpath, but
rather QName of the input statement, hence create a cached reference of
that -- leading to minimal object allocation in the fast path.

Change-Id: I97ceb43d80c50d53d21cc66a31bfaae6ff0193e9
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-1135 Improve error reporting in config pusher 81/20781/5
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>
8 years agoFix deadlock in AsyncSshHandlerWriter 02/21102/5
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>
8 years agoBUG-3335 Disable keepalives in netconf testtool 44/21044/3
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>
8 years agoGet rid of netconf session preferences after connect 95/21295/2
Maros Marsalek [Wed, 27 May 2015 15:10:56 +0000 (17:10 +0200)]
Get rid of netconf session preferences after connect

Memory usage improvement for sal-netconf-connector: The preferences object was
kept inside the data broker during the entire lifetime of a netconf connector.
This is not necessary as it only needs 3 boolean values from it.

+ intern String representation of capabilities written into datastore.

Change-Id: I46363a3dc079350ccb1db4840b31fdd5342798d3
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 3414 - exposed location header in CORS setings 32/21332/2
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>
8 years agoBug 3104 - fixed XmlNormalizedNodeBodyReader bug when data started at 05/21305/2
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>
8 years agoBUG-2453 Enable nested enums in configuration 46/21146/3
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>
8 years agoBug 2820 - squashed changes from master. 88/20088/3
Jozef Gloncak [Tue, 17 Mar 2015 10:34:03 +0000 (11:34 +0100)]
Bug 2820 - squashed changes from master.

Squashed changes from master patches:
- Bug 2820 - problem to add second TLV with type 127.
- Bug 2820 - LLDP TLV support and testing
- BUG 2820 - LLDP refactor

into one commit were applied to stable/lithium because patch
 - BUG 2820 - LLDP refactor
was applied as first by mistake.

Change-Id: Ifa1cab17206e1be37022bc8b49f7990649cbd356
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
8 years agoBUG-2976: Resolve clash between current and feature cfg pusher 56/20656/8
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>
8 years agoSet revision of inet-types in ietf-netconf-monitoring 49/21049/3
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>
8 years agoBUG 2820: Fix breakage from Import-Package 76/21276/1
Ed Warnicke [Thu, 28 May 2015 00:07:26 +0000 (17:07 -0700)]
BUG 2820: Fix breakage from Import-Package

Change-Id: I41401d4745c2126ccdc7ed9dffee3299aae9ed0c
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
8 years agoBug -3221 : Adding a new DataStoreUnavailableException for external applications. 59/21259/2
Harman Singh [Mon, 18 May 2015 21:51:46 +0000 (14:51 -0700)]
Bug -3221 : Adding a new DataStoreUnavailableException for external applications.
If cluster member, which is a leader of one or multiple shards becomes unavailable,
Shard re-election happens after certain time period and anyone tries to access datastore,
receives akka.timeout exception. No application can act upon such exception.

DataStoreUnavailableException will help external applications to retry if they see this exception.

Change-Id: Iceb10580bbe73ae91dc8abb4bc6a183cb4fad6f8
Signed-off-by: Harman Singh <harmasin@cisco.com>
(cherry picked from commit 6823ef1fd8f0a2f7ea39a2e85276a73e5de0bf72)

8 years agoInstantiate faster RpcServiceInvokers 23/21223/3
Robert Varga [Wed, 27 May 2015 15:00:07 +0000 (17:00 +0200)]
Instantiate faster RpcServiceInvokers

Now that we have the SchemaPath->Method mapping available and
RpcServiceInvoker can instantiate efficient invokers based on the
QName->Method mapping, switch over to them by creating an intermediate
map.

Change-Id: If5e17924d9deb494045965578cfcec6d321d04d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoAdd missing capabilities declaration to toaster test configuration. 03/20803/3
Tony Tkacik [Wed, 20 May 2015 12:39:29 +0000 (14:39 +0200)]
Add missing capabilities declaration to toaster test configuration.

Change-Id: I7055a36adce5e21a80a025f4cf55bdc9224b6879
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 2358 - Resources for tests nn to json 71/19771/10
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>
8 years agoBug 3017 - Error messages and logs missing for this or other RPC failures 12/19712/10
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>
8 years agoBUG-3335 Add keepalive mechanism to netconf-connector 88/20988/3
Maros Marsalek [Fri, 22 May 2015 14:40:58 +0000 (16:40 +0200)]
BUG-3335 Add keepalive mechanism to netconf-connector

Invoke harmless RPC (get-config with empty filter) with a fixed delay to check
whether the netconf session is still active. The RPC is postponed if any other
RPC is invoked by a user/application.

This also prevents the remote device to close session due to being idle.

Change-Id: I013d2641c38d4c8adb5d3198795e337b91c4f95d
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 2150: Feature wrappers now log parse errors better. 00/21100/2
Maros Marsalek [Mon, 25 May 2015 14:32:13 +0000 (16:32 +0200)]
Bug 2150: Feature wrappers now log parse errors better.

getFeatureConfigSnapshotHolders() logging is now similar
to what XmlDirectoryPersister.fromXmlSnapshot() does.

Also, files not ending with .xml (and not available files)
are filtered out as they do not hold configuration snapshots.

Warn level for config load failure.

Change-Id: I7c9d472bbe0ad031aaf7cc8dead1fd1e41d93306
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>