Jakub Morvay [Thu, 12 Jul 2018 08:24:47 +0000 (08:24 +0000)]
Merge "Remove netconf-node-inventory"
Jakub Morvay [Thu, 12 Jul 2018 08:14:31 +0000 (08:14 +0000)]
Merge "Add explicit getExtensions()"
Jakub Morvay [Thu, 12 Jul 2018 08:12:59 +0000 (08:12 +0000)]
Merge changes from topic 'no-chararray'
* changes:
Rely in ietf-inet-util to convert IpAddress to string
Do not rely on union char[] values
Robert Varga [Wed, 11 Jul 2018 22:23:11 +0000 (00:23 +0200)]
Add explicit getExtensions()
getExtensions() will become a mandatory method, make sure we are
ready for that.
Change-Id: Idca41be7d2a14c836345ea5d4b77857f6bbeca76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 11 Jul 2018 15:43:29 +0000 (17:43 +0200)]
Remove netconf-node-inventory
This model is not used anywhere, remove it and simplify RemoteDeviceId
so that it is purely topology-based.
Change-Id: Ia4d6738ceab8c1ed9864dd0f6277ea462377e584
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 11 Jul 2018 18:48:42 +0000 (20:48 +0200)]
Rely in ietf-inet-util to convert IpAddress to string
Union-based getValue() is char[]-based for JMX, do not use it.
Change-Id: I67f913e01ee06e26714eaf6554ec2623391cf1b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 11 Jul 2018 18:47:21 +0000 (20:47 +0200)]
Do not rely on union char[] values
This removes the dependency on synthetic getValue() and the union
constructor for JMX.
Change-Id: I46eaa2922e8cc83505a3198a9b29561f8ab1b32a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jakub Morvay [Wed, 11 Jul 2018 17:30:36 +0000 (17:30 +0000)]
Merge "Remove redundant code constructs"
Jakub Morvay [Wed, 11 Jul 2018 10:36:00 +0000 (12:36 +0200)]
Remove redundant code constructs
- Remove redundant type arguments
- Remove redundant type casts
Change-Id: I943060df1f465ff019b62abd5e72bc9ff7bc8ef9
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
Robert Varga [Tue, 10 Jul 2018 18:03:32 +0000 (20:03 +0200)]
Migrate sal.core.api.mount.MountProvisionListener users
DOMMountPointListener is the replacement interface, use it.
Change-Id: I51222f1f2bc133d90dd59a029fe538826dde48c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Balaji Varadaraju [Thu, 15 Feb 2018 07:53:20 +0000 (01:53 -0600)]
NECONF-524 : Setting the netconf keepalive logic to be more proactive.
https://jira.opendaylight.org/browse/NETCONF-524
When a NETCONF device loses connection with the controller in exceptional
conditions such as the management interface going down, underlying TCP
connection would not be closed as there will be no fin packet exchange or
reset. At this point NETCONF state will be set as connected until the
underlying OS determines the connection is stale which can happen after
considerable amount of time. This fix makes the Keepalive packets more
proactive to determine such conditions.This fix also sets the listener
properly which is required for this fix as well.
Change-Id: I781469ae7865e949e9f2c55e53240341f0b10bdd
Signed-off-by: Balaji Varadaraju <bvaradar@luminanetworks.com>
Robert Varga [Mon, 9 Jul 2018 10:53:50 +0000 (12:53 +0200)]
Remove unneeded check
The size of the collection is checked before we allocate
the transaction, hence conditional commit does not make sense.
Change-Id: Iada5db72f2fcf51528c8b1791f2b5ae9d7f51c6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 9 Jul 2018 10:52:02 +0000 (12:52 +0200)]
Migrate netconf users of submit() to commit()
This is the next round of conversions, covering most of netconf.
Change-Id: Ic3caa8ed0879ad547940ff09d034adb5d6d6f687
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 9 Jul 2018 10:47:09 +0000 (12:47 +0200)]
Fix warnings in mdsal-netconf-connector
- potentially-static methods
- deprecated use of Throwables.propagate()
- raw use of NormalizedNode
Change-Id: I06bc1f56c90d7c4fddce262ef2c63eec72492274
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 9 Jul 2018 10:42:41 +0000 (12:42 +0200)]
Add serialVersionUIDs
Exceptions are serializable and should therefore define
serialVersionUID. This patch adds backwards-compatible generated
values.
Change-Id: I742e123df5b694b2ec132a6e48a73f3a501dde66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 17:06:54 +0000 (19:06 +0200)]
Eliminate use of SchemaService
SchemaService has been deprecated in favor of DOMSchemaService,
migrate to it.
Change-Id: If1b6d3c9d821c6c5bea1476c08a61ed0c320b8ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 15:06:27 +0000 (17:06 +0200)]
Convert users from submit() to commit()
This gets rid of CheckedFutures and allows us to use FluentFuture
features.
Change-Id: Ie95bb9ce0d0bb6195f9c6355e644a8563165a953
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 16:42:42 +0000 (18:42 +0200)]
Migrate shell components to new APIs
Karaf has refactored its shell-related APIs, this patch updates
netconf-console to use them.
Change-Id: I8669c19c874d3e851379301712987ada626ef086
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 15:36:06 +0000 (17:36 +0200)]
Eliminate implicit boxing
There is no need to box values, use Boolean.TRUE/FALSE as needed.
Change-Id: I2a71106d7281f5b22e5d14f893f5a67c913e49f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 14:32:34 +0000 (16:32 +0200)]
Remove unneeded use of CheckedFuture
These callsites can live with ListenableFuture, so use that to
reduce clutter.
Change-Id: I4bea70e8f62b06cfdc1d7a3dfa5d7552178fa4c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 15:28:39 +0000 (17:28 +0200)]
Fix ScaleUtil warnings
Callable is a generic type, use it accordingly.
Change-Id: I5f947fc4cce9ef4244684013f5980dde439baf64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 14:39:21 +0000 (16:39 +0200)]
Make methods static
These methods are private without touching object state,
make them static.
Change-Id: I01d675a02098426917e019fb66761b13cacf3d4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 14:40:35 +0000 (16:40 +0200)]
Migrate to UntypedAbstractActor
UntypedActor has been deprecated, migrate to the replacement
bridge UntypedAbstractActor.
Change-Id: Ie4dd16101707a70442bd66bafd4b22190f73d06e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 4 Jul 2018 14:39:59 +0000 (16:39 +0200)]
Fix raw type warnings
Using IdentifiableItem as a raw type does not make sense here,
add type qualifiers and ditch the warnings.
Change-Id: Ifcbd41b53f0c5989e6fad9fd35ce66e115996224
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Jul 2018 15:16:56 +0000 (17:16 +0200)]
Adopt netconf-node-inventory
This model used to be hosted in controller, but it really should
be hosted in netconf.
Change-Id: I54a6cd90c8e182ade53cba08fdaa301a64a677d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Jul 2018 18:43:55 +0000 (20:43 +0200)]
Cache topology path
Instead of creating base InstanceIdentifier over and over, cache
it in a field.
Change-Id: I54d1bb7555a94fc20c5cf406f6f6f6dd69d7fc5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Jul 2018 18:20:40 +0000 (20:20 +0200)]
Fix netconf-node-topology
Topology types augmentation should be a presence container,
fix that.
Change-Id: Iaef6fd18f590767069a91cada2036f9b02ffa167
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Jul 2018 13:23:59 +0000 (15:23 +0200)]
Bump ietf-network(-topology) revision
This bumps the revision to RFC8345 versions.
Change-Id: I75748b45af4f91294eebe553f631cd0c23897035
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
JakubToth [Sun, 1 Jul 2018 08:03:24 +0000 (08:03 +0000)]
Merge "Guard against multiple web registration attempts"
Tom Pantelis [Wed, 27 Jun 2018 16:35:57 +0000 (12:35 -0400)]
Guard against multiple web registration attempts
If both restconf-auth and noath features are installed, both
try to register the web context and PAX web fails and renders
restconf unusable.
JIRA: CONTROLLER-1844
Change-Id: Ie488c792d849616efa806e82121883fe73fb9c6e
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Stephen Kitt [Tue, 26 Jun 2018 16:10:47 +0000 (18:10 +0200)]
Bump to yangtools 2.0.7
Change-Id: Ie48b991bc023cce78a3147371a9a33a627bc8ba1
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Thu, 28 Jun 2018 09:32:35 +0000 (11:32 +0200)]
Remove duplicate ietf-yang-library models
ietf-yang-library is provided by MD-SAL, along with bridge utilities
to work with that model.
Remove the two versions hosted in netconf and consume the version from
mdsal.
Change-Id: If43f159ebac4fedbb267a85fd9df6d46897a5330
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 28 Jun 2018 10:51:24 +0000 (12:51 +0200)]
Cleanup NetconfStateSchemasResolverImpl
We are using a constant QName in lookups, use a constant for that.
Also mark a FIXME for netconf-monitoring/yang-library preference.
Change-Id: Ia30ece91868b55e811e734b817ffaa71d86da0a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Wed, 30 May 2018 13:44:44 +0000 (15:44 +0200)]
Bump odlparent to 3.1.2
Change-Id: Id85c9aa0038633cbec58f747841121fd31067eab
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Tom Pantelis [Sun, 24 Jun 2018 21:58:33 +0000 (17:58 -0400)]
Reference BindingNormalizedNodeSerializer in MountPointEndToEndTest
... instead of referencing BindingToNormalizedNodeCodec
Change-Id: Idc4db9f7c35271ec5c458248727b0f3387fa373f
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Marek Gradzki [Fri, 15 Jun 2018 11:54:41 +0000 (13:54 +0200)]
Advertise :validate:1.0 capability if DOMDataTransactionValidator is supported
Change-Id: I193ba007f32114aa1d43375bfdc6772be173db7c
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Tom Pantelis [Fri, 15 Jun 2018 01:52:32 +0000 (01:52 +0000)]
Merge "Remove CSS yang reference from UT"
Tom Pantelis [Fri, 15 Jun 2018 00:59:29 +0000 (20:59 -0400)]
Remove CSS yang reference from UT
CSS is being removed...
Change-Id: I0e7ad682ed0f7ad1dc815af4b35afe7baa57c5bd
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Marek Gradzki [Wed, 13 Jun 2018 19:12:16 +0000 (21:12 +0200)]
Make RuntimeRpc revision aware
Do not use SchemaContext.findModule(URI),
which looks for a module instance with specified namespace
and no revision.
Such lookup fails for modules with revision defined.
Instead (as already done in AbstractEdit)
use SchemaContext.findModules and take the newest module
if more than one module with the same namespace is found.
Change-Id: I7b6bdcb9156669645e19a6395e1b74995328154d
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
(cherry picked from commit
69c92b2bee54681ebb5c0bfaf89d269877e0b747)
Tom Pantelis [Mon, 30 Apr 2018 14:39:23 +0000 (10:39 -0400)]
Remove AsyncWriteTransaction.submit() impls
The submit() method is now defaulted in the interface
so implementations don't need to implement it.
Change-Id: Ibdb988739df9ea309c2debd9c31dc1b9bf18e83d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Fri, 8 Jun 2018 18:08:30 +0000 (14:08 -0400)]
Remove unused references to BindingAwareBroker
Change-Id: I2a6d5e06f9b357737b37779b7e294731f79ba833
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Fri, 8 Jun 2018 02:45:55 +0000 (22:45 -0400)]
Fix default schema cache failures
We've these seen intermittent failures on jenkins:
Caused by: java.lang.IllegalArgumentException: Unable to create cache directory at cache/schema
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:210)
at org.opendaylight.yangtools.yang.model.repo.util.FilesystemSchemaSourceCache.<init>(FilesystemSchemaSourceCache.java:74)
at org.opendaylight.netconf.topology.AbstractNetconfTopology.<clinit>(AbstractNetconfTopology.java:149)
In FilesystemSchemaSourceCache"
if (!storageDirectory.exists()) {
checkArgument(storageDirectory.mkdirs(), "Unable to create cache directory at %s",
storageDirectory);
}
mkdirs returns false if the dir/file already exists - this seems the likely reason
in this case even though it checks exists() just prior. This scenario could happen
if there's a race where some other component interleaves and creates the dir in
between the exists and mkdirs calls.
To protect against this sceniario, AbstractNetconfTopology and NetconfTopologyUtils
were changed to retry if FilesystemSchemaSourceCache throws an IAE. Also they no
longer fail class initialization on failure.
Change-Id: I9f7ec134e7fd817aa753f0db175bf5620cc52ff4
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Robert Varga [Mon, 28 May 2018 10:16:53 +0000 (12:16 +0200)]
Bump yangtools to 2.0.5
This includes latest fixes.
Change-Id: Ib91a42e74323a99ce378744114071c7268fec3a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jakub Morvay [Tue, 5 Jun 2018 15:34:09 +0000 (15:34 +0000)]
Merge "Convert ProxyDOMDataBroker tx creation to async"
Tom Pantelis [Mon, 4 Jun 2018 15:13:32 +0000 (11:13 -0400)]
Remove sal-dom-config dependency
It's not needed and is going away.
Change-Id: I2fb0ed7ddca920756a07ba61f900fdff47715e67
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Sat, 2 Jun 2018 11:20:33 +0000 (07:20 -0400)]
Remove config features from protocol-framework feature
CSS remnants that aren't needed.
Change-Id: I1e510da5c07c0dddfb602a5abbbc46349288f5eb
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Mon, 21 May 2018 14:28:52 +0000 (10:28 -0400)]
Convert ProxyDOMDataBroker tx creation to async
ProxyReadWriteTransaction was modified to take the ActorRef
Future from the tx creation message and add a callback when
complete. Transaction operations prior to completion are
queued and replayed to a ProxyTransactionFacade instance
once the Future is complete. For successful completion, an
ActorProxyTransactionFacade is created that interfaces
with the master ActorRef. On failed Future, a
FailedProxyTransactionFacade is created that returns a
failed Future for read, exists and commit operations.
The ProxyReadAdapter and ProxyWriteAdapter were removed
in lieu of ProxyTransactionFacade which combines the
read/write operations for simplicity.
Some simple actor response messages,
eg NewWriteTransactionReply, were removed in lieu of
returning the payload or exception via
akka.actor.Status.Success or akka.actor.Status.Failure.
This simplifies caller response handling as akka
automatically unwraps Success and Failure in callbacks
and synchronous await.
UTs were added, modified and removed corresponding to
the changes.
Change-Id: I0bd2a931d91ded97ebba7ccc207d51bd6474a41c
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Mon, 4 Jun 2018 16:58:06 +0000 (16:58 +0000)]
Merge "Fixup Augmentable and Identifiable methods changing"
Jakub Morvay [Mon, 4 Jun 2018 15:43:24 +0000 (15:43 +0000)]
Merge "Use requested media type in RestconfDocumentedExceptionMapper"
Robert Varga [Tue, 24 Apr 2018 13:30:01 +0000 (15:30 +0200)]
Fixup Augmentable and Identifiable methods changing
This is a fixup of the change in binding codegen, adjusting:
- getKey() -> key()
- setKey() -> withKey()
- getAugmentation() -> augmentation()
Change-Id: I7533bd17bcd4a742862576d38f76991162845f4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
miroslav.kovac [Tue, 29 May 2018 18:09:24 +0000 (20:09 +0200)]
NETCONF-542: PUT request return 500 if operational data are used
* Cherry-pick
Change-Id: I5e45b0276e39c3a6af647b6632b67b3f96751464
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Robert Varga [Mon, 4 Jun 2018 00:03:24 +0000 (02:03 +0200)]
odl-netconf-api should not repackage yang-model-api
yang-model-api should be pulled in via odl-yangtools-parser-api,
do exactly that.
Change-Id: I854f6813a378cca691d992e009a55540368ec3bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Tom Pantelis [Fri, 1 Jun 2018 21:16:46 +0000 (17:16 -0400)]
Use requested media type in RestconfDocumentedExceptionMapper
The code uses headers.getAcceptableMediaTypes() to select the media type
for the response but, from what I've seen, that only contains the wildcard "\",
in which case we always return json. We should use the requested media type
via headers.getMediaType(), if set, and fallback to getAcceptableMediaTypes()
or json as default.
Change-Id: I391cf054ddab18ddc2855d8d4337cac376d71825
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Fri, 1 Jun 2018 20:16:47 +0000 (16:16 -0400)]
RestconfDocumentedExceptionMapper not returning json
The media types returned from HttpHeaders returns wildcard type "/"
which we were incorrectly filtering out. So it was defaulting to
xml instead of json.
Change-Id: I2f64840ca4bbc48651c2a8bbe72fdbbc666024a2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Robert Varga [Fri, 1 Jun 2018 09:09:31 +0000 (11:09 +0200)]
odl-netconf-notifications-impl should pull in mdsal runtime
Rather than repackaging upstream artifacts, depend on
odl-mdsal-binding-runtime.
Change-Id: I699ab19bc9bdcc115b80a689f0f8c3dbdb10a9ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Tom Pantelis [Thu, 31 May 2018 19:35:06 +0000 (15:35 -0400)]
Fix jersey 2 WARNs in RestconfApplication
16:11:13 2018-05-31T16:08:28,928 | WARN | Blueprint Extender: 2 | Providers | 197 - org.glassfish.jersey.core.jersey-common - 2.25.1 | A provider org.opendaylight.netconf.sal.restconf.impl.ControllerContext registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.opendaylight.netconf.sal.restconf.impl.ControllerContext will be ignored.
16:11:13 2018-05-31T16:08:28,929 | WARN | Blueprint Extender: 2 | Providers | 197 - org.glassfish.jersey.core.jersey-common - 2.25.1 | A provider org.opendaylight.netconf.sal.restconf.impl.BrokerFacade registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.opendaylight.netconf.sal.restconf.impl.BrokerFacade will be ignored.
We shouldn't return ControllerContext and BrokerFacade as singletons.
Change-Id: I64aa7c6da97fa12f0203b8664d07c1af04f93c6b
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Thu, 31 May 2018 13:34:52 +0000 (09:34 -0400)]
Fix RestconfDocumentedExceptionMapper exception
Seen in CSIT run after jersey 2 upgrade:
2018-05-31T08:47:19,494 | ERROR | qtp315470863-147 | ServerRuntime$Responder | 190 - org.glassfish.jersey.core.jersey-server - 2.25.1 | An exception has been thrown from an exception mapper class org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper.
java.lang.UnsupportedOperationException: null
at java.util.Collections$UnmodifiableList$1.remove(Collections.java:1349) [?:?]
at jersey.repackaged.com.google.common.collect.TransformedIterator.remove(TransformedIterator.java:53) [185:org.glassfish.jersey.bundles.repackaged.jersey-guava:2.25.1]
at java.util.AbstractCollection.remove(AbstractCollection.java:293) [?:?]
at org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper.toResponse(RestconfDocumentedExceptionMapper.java:104) [346:org.opendaylight.netconf.restconf-nb-bierman02:1.8.0.SNAPSHOT]
at org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper.toResponse(RestconfDocumentedExceptionMapper.java:76) [346:org.opendaylight.netconf.restconf-nb-bierman02:1.8.0.SNAPSHOT]
headers.getAcceptableMediaTypes() now returns an immutable list so rework
the code to use stream -> filter - findFirst.
Change-Id: I346c884226c1cfe3afce1b6937176f5397cc3367
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Thu, 24 May 2018 17:32:29 +0000 (13:32 -0400)]
Convert to jersey 2
JIRA: TSC-113
Change-Id: Iaed173f251fc1a38dc42d10b9257cd4531598ed5
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Jakub Morvay [Wed, 30 May 2018 08:18:56 +0000 (08:18 +0000)]
Merge changes I0587299e,I81a92c4e
* changes:
Add AST yang model caching to netconf connector's schema repository
Do not parse YANG schemas into AST when checking if present
Tom Pantelis [Mon, 21 May 2018 14:26:52 +0000 (10:26 -0400)]
Add slave/master end-to-end test
Added a MountPointEndToEndTest that tests master and slave
mount point operations end-to-end with as little mocking as
possible. Hooks were added in NetconfTopologyContext and MasterSalFacade
for the MountPointEndToEndTest to get a hold of the MasterSalFacade
to invoke it manually to simulate backend device connectivity and to
inject the backend DOMDataBroker.
Change-Id: I5cc59987570ba4e99980af4e2f4c5adf47b6a81e
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Robert Varga [Mon, 23 Apr 2018 15:28:44 +0000 (17:28 +0200)]
Adjust to RPC method signature update
Input/Output structures are always present and we need to return
ListenableFuture. Also cleans up unneeded use of CheckedFuture,
reducing the number of warnings and easing future transition.
Change-Id: I517b2e6c930735c544c1582c3027891658c9e452
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jakub Morvay [Tue, 22 May 2018 14:44:44 +0000 (14:44 +0000)]
Merge changes Id268d747,Id095a4ff
* changes:
Mods/improvements to NetconfNodeActorTest et al
NetconfTopologyManager and UT mods/improvements
Jakub Morvay [Tue, 22 May 2018 14:32:30 +0000 (14:32 +0000)]
Merge "Slave mount point registration hardening/resiliency"
JakubToth [Thu, 17 May 2018 20:30:14 +0000 (20:30 +0000)]
Merge "Allow specification of ODL's HELLO message"
Jakub Morvay [Thu, 17 May 2018 16:56:37 +0000 (16:56 +0000)]
Merge "Make CapabilityChangeNotificationProducer AutoClosable"
Ryan Goulding [Wed, 16 May 2018 15:20:55 +0000 (11:20 -0400)]
Bring in org.json
It appears that RESTCONF actually relies on org.json as a runtime
dependency and currently relies on AAA bringing it in. AAA plans
to remove any dependency on org.json ideally in Fluorine. As
such, have RESTCONF properly declare its dependency.
Change-Id: Ib94aef9fafd12d9646f492f63cd63be9b3e2cb09
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Marek Gradzki [Wed, 16 May 2018 06:21:17 +0000 (08:21 +0200)]
Make CapabilityChangeNotificationProducer AutoClosable
the CapabilityChangeNotificationProducer has AutoClosable dependencies
and already implements close() method.
Change-Id: I463df6b5285deb441586fcc786fd1bb53ab6734b
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Ryan Goulding [Mon, 9 Apr 2018 22:47:29 +0000 (18:47 -0400)]
Allow specification of ODL's HELLO message
Some devices are very particular about what they will accept
for a HELLO message. This change allows specification of a custom
message per device mount. If one is not specified, then the
existing default is utilized.
Additionally, certain tests were using very out of date versions of
netconf-node-topology. This is due to the fact that the test
yang files are located in src/test/resources, and were out of date
with the netconf-node-topology used in src/main/yang. These were
updated to the most up-to-date version as of this patch.
JIRA: NETCONF-543
Change-Id: I4049a87a7781655d8d396bb35eb43aab2eca0223
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Maros Marsalek [Thu, 10 May 2018 14:27:49 +0000 (16:27 +0200)]
Add AST yang model caching to netconf connector's schema repository
text -> AST transformation of YANG takes majority of the time when tryinh to parse
SchemaContext. Caching is important when mounting a device where not all yang models
are valid or have their dependencies. Netconf connector tires to parse and eliminate
YANG models in a loop until a valid subset is found. Until now, the text -> AST has
been performed in each iteration, really slowing donw the mount process.
Also fix logs in NetconfDevice
Change-Id: I0587299eefdc7a813afd9967363200243b815551
Signed-off-by: Maros Marsalek <mmarsalek@frinx.io>
Tom Pantelis [Sat, 12 May 2018 18:29:44 +0000 (14:29 -0400)]
Mods/improvements to NetconfNodeActorTest et al
Increased code coverage in NetconfNodeActor et al via new test
cases and mods to existing tests cases in NetconfNodeActorTest.
Also made other mods - see inline comments.
Change-Id: Id268d747110fe5c1b05a0c2959138661b966d0f6
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Maros Marsalek [Thu, 10 May 2018 12:31:36 +0000 (14:31 +0200)]
Do not parse YANG schemas into AST when checking if present
In the filterMissingSources method, each source was also parsed into AST
The process of text -> AST transformation is pretty expensive and not
necessary when checking if source can be downloaded or not
Change-Id: I81a92c4eb2acbf0e17346ef62080151b8821c2b6
Signed-off-by: Maros Marsalek <mmarsalek@frinx.io>
Tom Pantelis [Fri, 11 May 2018 01:57:44 +0000 (21:57 -0400)]
NetconfTopologyManager and UT mods/improvements
NetconfTopologyManagerTest:
- separated the test cases for successful and failed CSS registration
to make it easier to understand/follow.
- added additional scenarios/coverage/verification for DTCL
create/update/replace/delete notifications.
- removed the manipulation and direct verification of the
NetconfTopologyManager internal maps via reflection. These
are internal implementation details that the UTs shouldn't
have knowledge of. The maps are indirectly verified via
verification of the stored mocks.
- used the real DataBroker to verify the initilization of the
Topology nodes. This is easier than mocking a write trannsaction
correctly.
NetconfTopologyManager:
- changed the Maps to ConcurrentHashMap as they are accessed by
multiple threads and could even be accessed concurrently.
- added a hook for the UTs to create mock NetconfTopologyContexts
- if CSS registration fails, it should just close the NetconfTopologyContext
and not itself.
- other minor changes.
NetconfTopologyContext:
- implement AutoCloseable and rename closeFinal to the standard close.
- Renamed the AtomicBooleans for clarity.
Change-Id: Id095a4ff9395d68912a92b0b59d725e062ddd9fc
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Thu, 10 May 2018 01:38:01 +0000 (21:38 -0400)]
Slave mount point registration hardening/resiliency
- It's possible for a message to the master to timeout in which
case the slave mount point doesn't get registered so add retries
for the AskForMasterMountPoint message in NetconfNodeManager and
schema resolution in NetconfNodeActor. The AskForMasterMountPoint
and RegisterMountPoint messages were changed to pass the
slave/master ActorRefs in order to send a success/failure reply to
the original caller.
- In NetconfNodeActor, preserve actor safety by executing
ListenableFuture callbacks via the actor's dispatch queue
(using executeInSelf) if the callback accesses actor state.
- Hardened synchronization in NetconfNodeManager and NetconfNodeManager.
- Added UTs for NetconfNodeManager to cover the slave mount point
registration scenarios.
- Added more logging where appropriate
Change-Id: I31c2d6584d56cb87c1b266565bc4b6f4a48ff303
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Jakub Morvay [Thu, 10 May 2018 07:52:54 +0000 (07:52 +0000)]
Merge "Convert yanglib to new web API"
Jakub Morvay [Wed, 9 May 2018 15:10:49 +0000 (15:10 +0000)]
Merge "Convert apidocs to new web API"
Jakub Morvay [Wed, 9 May 2018 15:07:35 +0000 (15:07 +0000)]
Merge "Implement AsyncWriteTransaction.commit()"
Tom Pantelis [Mon, 7 May 2018 22:10:58 +0000 (18:10 -0400)]
Remove controller DCL-related references
DataChangeListener, DataChangeScope and friends are being removed
from the controller. The DataChangeScope enum is part of the NB data
change stream registration API although the implementation was removed
in Oxygen when it was internally changed to use DTCL. We may still
want/need to support the scope on top of DTCL so the enum was copied
to restconf-common.
Change-Id: If2ebe7b863975b4cae63c838d60f83b33e9e37b4
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Thu, 3 May 2018 14:44:55 +0000 (10:44 -0400)]
Convert yanglib to new web API
Change-Id: I10b287d2aa2cb44ad11c30b69dbccc7fc725e815
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Marek Gradzki [Wed, 28 Mar 2018 19:52:41 +0000 (21:52 +0200)]
NETCONF-536: support for <candidate> validation
Provides support <validate> RPC, as defined in:
https://tools.ietf.org/html/rfc4741#section-8.6.
Only <candidate> datastore is supported.
Support for test-option and capability advertisement
are not included in this patch.
The actual implementation of validation process is delegated to
DOMDataTransactionValidator - an DOMDataBrokerExtension.
Change-Id: I4bbaba18d2e630787d127a51c26918d05fd7e648
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Tom Pantelis [Thu, 26 Apr 2018 14:08:55 +0000 (10:08 -0400)]
Convert apidocs to new web API
The ApiDocGenerator and MountPointSwagger classes were overloaded to
handle draft02 and rfc8040 differences via a 'newDraft' flag. To
facilitate elimination of the static instances, the classes were
refactored to remove the flag and implement the differences via
abstract methods and derived classes.
Change-Id: I950dfceac40b0aee1bafb4d8b78d36d1ef67eadc
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Sun, 29 Apr 2018 22:51:36 +0000 (18:51 -0400)]
Implement AsyncWriteTransaction.commit()
Implement the new commit() method which uses FluentFuture
instead of the deprecated CheckedFuture. The commit() method
is defaulted in the interface but, as soon as all implementations
implement commit(), the deprecated submit() method will be defaulted
instead.
Change-Id: If053be0d3864513685a231a320a7f47931f76684
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Jakub Morvay [Fri, 27 Apr 2018 09:01:44 +0000 (09:01 +0000)]
Merge "NETCONF-540: do not ignore namespace when building error rpc-reply"
Jakub Morvay [Fri, 27 Apr 2018 07:10:41 +0000 (07:10 +0000)]
Merge "Convert rcf8040 from web.xml to programmtic web API"
Marek Gradzki [Fri, 20 Apr 2018 05:57:38 +0000 (07:57 +0200)]
NETCONF-540: do not ignore namespace when building error rpc-reply
use Element.getLocalName() + Element.getNamespaceURI()
instead of Element.getTagName()
to support clients using namespace prefixes.
Change-Id: I29bfa55e6ac043be6306b8da026ae5228ec9344e
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Tom Pantelis [Tue, 24 Apr 2018 18:48:30 +0000 (14:48 -0400)]
Convert rcf8040 from web.xml to programmtic web API
To simplify, the noauth feature was removed. Since this is
a new API, it's been decided not to carry it forward. The
noauth feature for the bierman02 implementation was put in
and kept for legacy reasons.
Change-Id: Ic432b175fae62caee8cc641bb77c19f38a5ab6f6
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Marek Gradzki [Wed, 25 Apr 2018 09:20:09 +0000 (11:20 +0200)]
Move TestSessionNegotiator class to separate file
Change-Id: I20ba4048cc65c40b0b1247e3412abb5c5cb6caed
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Marek Gradzki [Wed, 25 Apr 2018 07:32:57 +0000 (09:32 +0200)]
NETCONF-539: use netconf namespace in base:1.1 capability check
Use Document.getElementsByTagNameNSgetElementsByTagNameNS
with urn:ietf:params:xml:ns:netconf:base:1.0 namespace
instead of getElementsByTagName
to support clients using namespace prefixes in the hello message.
Change-Id: I333bb4522aca566b74db3e4411be1c90ec419aec
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Jakub Morvay [Thu, 26 Apr 2018 10:38:38 +0000 (10:38 +0000)]
Merge changes from topic 'rem_web_xml'
* changes:
Remove RestConnectorProvider
Use DOMMountPointServiceHandler non-statically
Use SchemaContextHandler non-statically
Remove static TransactionChainHandler instance
Tom Pantelis [Fri, 20 Apr 2018 18:58:40 +0000 (14:58 -0400)]
Remove RestConnectorProvider
RestConnectorProvider has been reduced to just initialize the
ServiceWrapper instance so is no longer needed. Also the ServiceWrapper
interface is no longer needed and, as a result, the ServicesWrapperImpl
class was renamed to just ServiceWrappers. The ServiceWrappers
is now instantiated/initiated via blueprint. The static instance
remains temporarily for the RestconfApplication.
Change-Id: I643d18a6980b5f51262396c49af281515b94868f
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Fri, 20 Apr 2018 13:30:32 +0000 (09:30 -0400)]
Use DOMMountPointServiceHandler non-statically
Removed the static field in RestConnectorProvider and made the
DOMMountPointServiceHandler instance static temporarily for the
RestconfApplication but converts the rest of the code to reference
it non-statically. The static DOMMountPointServiceHandler will be
removed in a subsequent patch.
Change-Id: I92e98c4f8c15a8e77bc2e0b970e74e3fe56d58a5
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Thu, 19 Apr 2018 22:16:03 +0000 (18:16 -0400)]
Use SchemaContextHandler non-statically
Removed the static SchemaContext field and made the SchemaContextHandler
instance static temporarily for the RestconfApplication but converts the
rest of the code to reference it non-statically. The static SchemaContextHandler
will be removed in a subsequent patch.
Change-Id: I9763ad472acdefbade511c47ee7e2f140f9d6ca1
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Thu, 19 Apr 2018 14:17:47 +0000 (10:17 -0400)]
Remove static TransactionChainHandler instance
RestConnectorProvider maintained a static instance in order
to reset the DOMTransactionChain statically. The reset logic
was moved to TransactionChainHandler and call sites in the
static Utils were modified to pass the TransactionChainHandler via
the TransactionVarsWrapper and call reset. This allows the static
instance to be removed. The TransactionChainHandler singleton is now
created via blueprint.
Change-Id: I483ac83103286146bc636b7f1e6ba0df70f2f5a6
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Wed, 18 Apr 2018 01:39:22 +0000 (21:39 -0400)]
Convert bierman02 from web.xml to programmtic web API
To handle auth vs noauth, 2 new bundles were added that
import a new Bierman02WebRegistrar service advertised by
the restconf-nb-bierman02 bundle and simply invoke the
appropriate register*Authentication method.
The odl-restconf no longer installs odl-restconf-noauth nor
the aaa-shiro-act bundle. Both bundles install a new
odl-restconf-base feature and their respective
restconf-nb-bierman02-auth/restconf-nb-bierman02-noauth
bundle.
Change-Id: I93f58e791d8b9666083bd379c99a548bff6e8971
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Mon, 16 Apr 2018 21:40:31 +0000 (17:40 -0400)]
Remove static RestconfImpl
The RestconfImpl does not need to be static as it is indirectly
shared between the web and blueprint instantiated components via
the StatisticsRestconfServiceWrapper. Also code using the
StatisticsRestconfServiceWrapper was modified to reference it
non-statically except for the RestconfApplication. This will be
cleaned up when converted to use the new programmtic web API.
Change-Id: I96a0c7724c642db9b2fbe0d78dc79c9c6efc47ad
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Mon, 16 Apr 2018 18:24:59 +0000 (14:24 -0400)]
Use BrokerFacade non-statically
Similar to the previous patch that was done for ControllerContext.
keeps the static BrokerFacade instance temporarily
for the RestconfApplication but converts the rest of the code to
reference it non-statically.
Change-Id: Iafdb26200f8d645a8ed61c7006edd0b106d7d976
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Fri, 13 Apr 2018 23:19:10 +0000 (19:19 -0400)]
Use ControllerContext non-statically
This is a preliminary patch for removing the web.xml and converting
to the new programmtic web API which will allow us to remove the
static instances that bridge between the web-instantiated
and blueprint-instanriated components. First up is the
ControllerContext - this patch keeps the static instance temporarily
for the RestconfApplication but converts the rest of the code to
inject the ControllerContext instance and reference it non-statically.
This patch touches a lot of files but most are UTs.
Change-Id: I08e2ee24e518c01bb1d5fdb5796abd9354dccfa2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Stephen Kitt [Fri, 13 Apr 2018 09:01:31 +0000 (11:01 +0200)]
Add missing synchronisation
AbstractNetconfSessionNegotiator synchronises access to state in
changeState(); this also needs to be done in ifNegotiatedAlready.
(FindBugs now flags this and fails the build.)
Change-Id: Id2209e1987429f3b754a2c7afc1a7e47dc4135ab
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Anil Belur [Fri, 13 Apr 2018 02:49:10 +0000 (02:49 +0000)]
Merge "Bump to odlparent 3.1.0 and yangtools 2.0.3"
Jakub Morvay [Thu, 12 Apr 2018 14:20:59 +0000 (14:20 +0000)]
Merge "fix failure during connecting device when channelActive happens later than handleMessage"
Jakub Morvay [Thu, 12 Apr 2018 07:13:10 +0000 (07:13 +0000)]
Merge "Specify necessary dependencies"