mdsal.git
5 years agoBump versions by x.y.(z+1) 65/71465/1 stable/carbon
jenkins-releng [Thu, 26 Apr 2018 22:04:54 +0000 (22:04 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I091be653156fc209bb0c540eadfaef818afceb39
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
6 years agoUse QName.withModule() 25/70825/1
Robert Varga [Mon, 12 Mar 2018 10:53:51 +0000 (11:53 +0100)]
Use QName.withModule()

There are multiple places where we are creating a well-known QName
with a new namespace. Use QName.withModule() so we do not end up
checking localName over and over.

Change-Id: I932bf3762bfb6ae201e6b309f8a7d95887b99b00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c88bb5b55f973303e4a6b04aced3ad10fdd1b96d)
(cherry picked from commit e080cfc1837938054765ee7325ae2d1dd09b6319)

6 years agoFix derived types missing pattern restrictions 49/70749/3
Robert Varga [Tue, 10 Apr 2018 17:14:19 +0000 (19:14 +0200)]
Fix derived types missing pattern restrictions

We have missed a place where constants to support restrictions need
to be generated, which meant that Ipv4AddressNoZone and similar
constructs were not doing correct enforcement.

JIRA: MDSAL-335
Change-Id: Id659362038e001207eab9ca5f1618c376aa0ea5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a2713a39a1b1aac6a2337a09559f930240523311)

6 years agoAdd alternative enum assigned name mapping 38/69338/2
Robert Varga [Fri, 9 Mar 2018 15:55:44 +0000 (16:55 +0100)]
Add alternative enum assigned name mapping

This patch corrects enumeration mapping rules so that any unicode
string can be mapped to a valid Java identifier as per JLS8.

This is done by attempting to apply className() mapping to all names
and using that if it results in valid non-conflicting identifiers.

If a conflict is detected, we use a bijective mapping, which encodes
any conflicting characters using an $-based escaping scheme.

JIRA: MDSAL-309
Change-Id: Ic51405e533eff9af6afc2abaa8d0cc193d718e64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 53433dfe15da970a6af8362ad21911a82943de7d)

6 years agoShare pre-generated non-verbose string 15/67015/2
Robert Varga [Mon, 8 Jan 2018 17:19:45 +0000 (18:19 +0100)]
Share pre-generated non-verbose string

As it turns out, xtend does not do any sort of constant folding,
hence we need to share the strings instance ourselves to get
the most speed out of quick profile.

Change-Id: I83239aa27567d2927fbed2039f28f7e17461db4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bbd132f6e010b834969481ccc9c138c8a2fd9d84)

6 years agoAdd DataTreeIdentifier.toString() 72/67672/3
Robert Varga [Mon, 29 Jan 2018 13:17:30 +0000 (14:17 +0100)]
Add DataTreeIdentifier.toString()

Adding a toString() method aids debugging and is generally nice.

Change-Id: I70944c85d6507e47aec282a018e7e101c684de62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit fd18053813ba9954ea7efa58ad95993b2f9f599c)

6 years agoLookup leaf key methods in parents 18/67918/4
Robert Varga [Thu, 1 Feb 2018 16:37:20 +0000 (17:37 +0100)]
Lookup leaf key methods in parents

Union is a valid key type and it can actually come from a grouping,
in which case it gets generated as an inner type. If that happens
the typedef is not populated into the usual places, leading to
a failure to find method return type -- leading to a missing key
member.

This is a problem similar to YANGTOOLS-424, so let's use the same
ModuleContext approach taken then.

JIRA: MDSAL-161
Change-Id: Id342701d603bdd2b9b78ba3295c8eae60f253429
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6ac608d5c6b02fbcc3ee01af8fc4e3301a8ed52b)
(cherry picked from commit d295b816714240cccc7d7161c77ee00d2f0ef155)

6 years agoMDSAL-298: properly handle unkeyed lists 73/67673/4
Robert Varga [Mon, 29 Jan 2018 13:18:05 +0000 (14:18 +0100)]
MDSAL-298: properly handle unkeyed lists

Unkeyed lists are not representable in binding, which means they
cannot be reported as modified children, either. This has implications
for any data change which contains unrepresentable fields as child
modifications.

Previously we would report SUBTREE_MODIFIED for the container node,
but would fail to report any children, which is obviously wrong, as the
user is left guessing as to what exactly happened.

This patch modifies LazyDataObjectModification to report a WRITE event
if modifications to unrepresentable children are found in SUBTREE_MODIFIED
case. Since this is a potentially expensive operation, we cache a child
addressability summary in BindingCodecTreeNode, so that we go to this
slow path only when needed.

We also expose BindingStructuralType enumeration, so controller's
sal-binding-broker can reuse the implementation rather than having its
own copy.

Change-Id: I6642166cd262d0dddb1b2ed6d73a20785d0efff6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 972489522808ad9777d4c190a2a0c3896ed0fca4)
(cherry picked from commit 076dcd04523bd003935796c3795ea4f81dfa8898)

6 years agoFix infinite loop on cancel transaction 12/68112/2
Jaime Caamaño Ruiz [Fri, 9 Feb 2018 09:47:26 +0000 (10:47 +0100)]
Fix infinite loop on cancel transaction

This patch fixes a problem where you would run into an infinite loop
after cancelling DOMForwardedWriteTransaction following an exception
thrown by the backed transaction ready or submit methods.

Change-Id: I14bcca6727ab2f173d481b84742c4edbf7bf9dd8
JIRA: CONTROLLER-1812
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
(cherry picked from commit 3534aba923cb1d2dcdd9e3ecf2675e35ce343910)

6 years agoBump versions by x.y.(z+1) 21/68621/1
jenkins-releng [Fri, 23 Feb 2018 14:26:52 +0000 (14:26 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I963bd151250f0586f3ae2a344050f7b26922d646
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
6 years agoMDSAL-302: make sure uses+augment works in RPCs 19/67619/2
Robert Varga [Fri, 26 Jan 2018 12:24:54 +0000 (13:24 +0100)]
MDSAL-302: make sure uses+augment works in RPCs

Add missing callouts to generate uses augments for RPC input/output
nodes. This complements processing for data nodes and notifications.

Change-Id: I4f0d9fddce1e019c57b9a45874a45b22ffe6a15f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump versions by x.y.(z+1) 50/64350/1
jenkins-releng [Tue, 17 Oct 2017 01:39:42 +0000 (01:39 +0000)]
Bump versions by x.y.(z+1)

Change-Id: If26fe5b76ad6fedcc81826708b646e0165b18d8d
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
6 years agoBinding v2 generator - fix getting elements from empty array. 06/61906/7
Jakub Toth [Thu, 17 Aug 2017 09:01:09 +0000 (11:01 +0200)]
Binding v2 generator - fix getting elements from empty array.

Change-Id: I865b8bc9f6197489934037ddba68d85b8c7c1378
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoBUG-9145: rework singleton service group state tracking 66/63866/2
Robert Varga [Thu, 21 Sep 2017 23:00:04 +0000 (01:00 +0200)]
BUG-9145: rework singleton service group state tracking

The beef of the issue here is that there are multiple codepaths
which end up sharing state transitions -- hence we could erroneously
end up waiting for entity release, when if fact we have already
lost it.

Rather than going the explicit FSM route, which would require quite
a few more states, rework state tracking such that each event is
evaluated against current state. This has the nice feature of making
duplicate events idempotent, as the code is all about reconciling
current and intended state.

This also disentangles the loss of ownership codepaths, which means
we can optimize behavior when partitions are involved -- specifically
jeopardy service entity ownership does not result in service shutdown,
because service liveness is actually guaranteed by cleanup entity.
Hence we can keep the services and the cleanup entity intact, leading
to less churn during partitions.

Should the cleanup entity report jeopardy, we need to bring the services
down, but we do not need to unregister the cleanup entity -- if the
partition is healed, we can start services again without the delay
incurred by EOS. If we end up losing partition healing, cleanup entity
ownership will be taken from us, at which point we also unregister.

Change-Id: Id5c8a97722b9a21114135554d92c17898dd0150e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix use of deprecated Futures.addCallback() 67/63867/1
Robert Varga [Thu, 21 Sep 2017 09:00:24 +0000 (11:00 +0200)]
Fix use of deprecated Futures.addCallback()

Specify MoreExecutors.directExecutor() instead of relying on a deprecated
method.

Change-Id: I097672d7624f5d32957fac3b18b8205c929c5729
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8858: add integration test suite 38/61938/7
Robert Varga [Thu, 17 Aug 2017 13:47:08 +0000 (15:47 +0200)]
BUG-8858: add integration test suite

We have a single-node, simple EOS implementation in MD-SAL. Test
singleton implementation against it.

Change-Id: Iaf98d27887d284c0a95b6f06d57d00d00d7ee042
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8858: rework singleton group locking 20/61420/19
Robert Varga [Wed, 9 Aug 2017 11:54:12 +0000 (13:54 +0200)]
BUG-8858: rework singleton group locking

Group locking relied on a single semaphore held for long periods
of time, with undeterministic locking in face of timing variance.

This patch reworks the logic to properly lock and manage object
lifecycle. It also expands the test suite to cover cleanup scenarios,
while removing test duplication.

The test suite is expanded slightly to assert that asynchronous
service group cleanup does not interfere with user's ability to
reuse the same group.

Change-Id: I68eb6d0b59b2ab0e1cf98dc374e029fad3d19734
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 8910 - Binding v2 generator exception: Failed to find leafref target 02/61602/1
Jie Han [Thu, 3 Aug 2017 05:46:21 +0000 (13:46 +0800)]
Bug 8910 - Binding v2 generator exception: Failed to find leafref target

- this patch also fixs:
  Bug 8911 - Binding v2 generator exception: Type parameter MUST be specified and cannot be NULL
Change-Id: Icae8a5bb7b8d34d0a7fbcff49fa8f22cd06213e2
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 8edb40f990e40cd6f61a4f5eb0dae11a79f80663)

6 years agoBinding generator v2 - fix units field name 01/61601/1
Jie Han [Thu, 20 Jul 2017 11:44:06 +0000 (19:44 +0800)]
Binding generator v2 - fix units field name

- fix units field name in builder
Change-Id: Iba7e90d4b18cd148acb71d6357a441471ed11873
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit e94235ad34b92dc67e1efe5ddb7f4c3ee2e620c8)

6 years agoBinding generator v2 - fix choice 00/61600/1
Jie Han [Thu, 20 Jul 2017 10:44:26 +0000 (18:44 +0800)]
Binding generator v2 - fix choice

- fix choice's parent type
Change-Id: I436bfb36c396cf95857a7c4c170f1f7601e3c432
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 06c8315eaa9e3468087a99ce2bd1530214aa0e6f)

6 years agoBinding generator v2 - uses statement - uses inner type 99/61599/1
Jie Han [Thu, 20 Jul 2017 07:02:27 +0000 (15:02 +0800)]
Binding generator v2 - uses statement - uses inner type

- for current implementation of yangtools does not copy "types" from groupings,
but the original definition of a type is reused, so we should find inner type
added by uses by original node.
  this patch should be merged with:
  - https://git.opendaylight.org/gerrit/60527
  - https://git.opendaylight.org/gerrit/60529

- add yangs and test

Change-Id: I4336bbf04c25b6caf2a1bd3101760fc3fc40421e
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit b9086681167b83e5aa6887dabbb749807f4c6206)

6 years agoBinding generator v2 - uses statement - uses grouping choice" 98/61598/1
Jie Han [Thu, 20 Jul 2017 01:54:34 +0000 (09:54 +0800)]
Binding generator v2 - uses statement - uses grouping choice"

- interface generated for choice extends interface for the same
choice for referenced grouping
Change-Id: Ida75a7d4a07e3d99c7c119a103ce6fab715b6ff3
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 715b8f2b0ed4842a002d57c4e778e6c2624584c1)

6 years agoBinding generator v2 - fix getter in builder 97/61597/1
Jie Han [Tue, 18 Jul 2017 11:44:07 +0000 (19:44 +0800)]
Binding generator v2 - fix getter in builder

- it should exclude parameteried type for clone.
Change-Id: I0fbb0675c789bbbbf5b6d841c1d6ed261fcbf0cf
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit fa62795f40e6b4b520e3dcc718362a51594a2cbc)

6 years agoBinding generator v2 - fix getter method name 96/61596/1
Jie Han [Tue, 18 Jul 2017 11:18:26 +0000 (19:18 +0800)]
Binding generator v2 - fix getter method name

- for yang snippet:
  container cont {
    leaf class {
      type string;
    }
  }
  the leaf name was reserved, but the result of method normalizing "get_class"
  is "getClass", so here just let "get" append the result of class normalizing
  "class" which should be "ClassReservedKeyword" ,that would be "getClassReservedKeyword".

Change-Id: Ibee98a5d82145b1f39509d05da6923fae0cb19f9
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit f1ccafdea3ef03ef82f5e9f141b94ab2418d0d94)

6 years agoBinding generator v2 - uses statement - uses inner type #2 95/61595/1
Jie Han [Tue, 18 Jul 2017 10:56:25 +0000 (18:56 +0800)]
Binding generator v2 - uses statement - uses inner type #2

- for current implementation of yangtools does not copy "types" from groupings,
but the original definition of a type is reused, so we should find inner type
added by uses by original node.
  this patch should be merged with:
  - https://git.opendaylight.org/gerrit/60529
  - https://git.opendaylight.org/gerrit/60582
- support uses leaf with inner type union, bits
- add yangs and test

Change-Id: Ibee57eb030a79e6ce06bb371e82257b7ab58ab98
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 3c24618b19b500ead3091dc9858baf7c57b79a47)

6 years agoBinding generator v2 - uses statement - uses inner type #1 94/61594/1
Jie Han [Tue, 18 Jul 2017 08:58:03 +0000 (16:58 +0800)]
Binding generator v2 - uses statement - uses inner type #1

- for current implementation of yangtools does not copy "types" from groupings,
but the original definition of a type is reused, so we should find inner type
added by uses by original node.
  this patch should be merged with:
  - https://git.opendaylight.org/gerrit/60529
  - https://git.opendaylight.org/gerrit/60582

- add test yangs

Change-Id: Ia82bc7b298c91bbc3ef34cfb26fea75eed5ff2b2
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 12ff5f7e52eb28e04c9749964329ca7a07649ed0)

6 years agoBinding generator v2 - uses statement - uses of list 93/61593/1
Jie Han [Tue, 18 Jul 2017 08:01:33 +0000 (16:01 +0800)]
Binding generator v2 - uses statement - uses of list

interface generated for list node added by uses extends interfaces for the same
list for referenced grouping
Change-Id: I8131f83d6dd5bbc7877894a9ed33adfec00504f3
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 3e67910220d30d8ecdb29b6081b674c069dc4bfe)

6 years agoBinding generator v2 - fix leaflist return type 92/61592/1
Jie Han [Tue, 18 Jul 2017 07:44:23 +0000 (15:44 +0800)]
Binding generator v2 - fix leaflist return type

- the package name of enum type has been normalized and
it can not be normailized again
Change-Id: I4e114a3827d16c36e0aed4d5c1c3389d63cae8b4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit d9ab15c1a2bacc13b5fa409266d662338772a3e8)

6 years agoBinding generator v2 - fix choice's parent 91/61591/1
Jie Han [Tue, 18 Jul 2017 06:48:08 +0000 (14:48 +0800)]
Binding generator v2 - fix choice's parent

- elminate duplicated moudle type
Change-Id: I0e3b26952c7b19ee6caf55bcde0486fac78bc5bc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 6218a99965e40fea9234bdbb1d300dcb7d9b162b)

6 years agoBinding generator v2 - fix double dot package name 90/61590/1
Jie Han [Tue, 18 Jul 2017 06:14:54 +0000 (14:14 +0800)]
Binding generator v2 - fix double dot package name

- fix normalize package name which has double dot ".."

Change-Id: Ic732f79a9d58d560450eaf1dfa064857c49507c5
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 1119c51af083ada5319bd371a688adb705cff4b1)

6 years agoBinding generator v2 - fix submodule class name 89/61589/1
Jie Han [Tue, 18 Jul 2017 02:37:19 +0000 (10:37 +0800)]
Binding generator v2 - fix submodule class name

- fix normalize submodule name in camel
Change-Id: Id4829b01b2319f8410b821c6814ea459069382ab
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 6b55aae217b7bc73b08c422e95ed7f22b01d30ec)

6 years agoBinding generator v2 - fix format javadoc text 88/61588/1
Jie Han [Tue, 18 Jul 2017 01:31:13 +0000 (09:31 +0800)]
Binding generator v2 - fix format javadoc text

- call encodeJavadocSymbols first to replace like '*/' in java doc.

Change-Id: I971028f3118757b8fc26822c7e57986aa3e9c018
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 0817049e91c6d11dde06c1e3ce72967826dcc860)

6 years agoBinding generator v2 - uses implement - fix finding target grouping 87/61587/1
Jie Han [Tue, 18 Jul 2017 00:51:00 +0000 (08:51 +0800)]
Binding generator v2 - uses implement - fix finding target grouping

- can not call findDataSchemaNode to find target grouping since it search
data node first that may find a wrong data node with the same name, here
specially find grouping by getGrouping() first, and that should be always
correct for uses grouping, anyway, in case find nothing,
keep the findDataSchemaNode methord.

Change-Id: Ibef1c5a0e01d1fe36260c76676ae02b926d62296
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 77c25a44eecef69ee0e6611c3c995e90860b1b45)

6 years agoBinding generator v2 - uses statement - uses leafref #2 86/61586/1
Jie Han [Mon, 17 Jul 2017 12:07:42 +0000 (20:07 +0800)]
Binding generator v2 - uses statement - uses leafref #2

- find actual node for leafref node added by uses

Change-Id: I1b5febb3665544def9ff9ba0c7b127ca1be247fc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit f935e02f0667b235841a921fa163d94a193e6947)

6 years agoBinding generator v2 - uses statement - uses leafref #1 76/61476/2
Jie Han [Mon, 17 Jul 2017 12:06:33 +0000 (20:06 +0800)]
Binding generator v2 - uses statement - uses leafref #1

- find parent module by original node for leafref node added by uses
if the leafnode is not local.

Change-Id: I14b57b796ba33f391d59e8ae7dd06b88ef7e0b51
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 8570a7dd21fdaded0a48313ed4e8df62b10a50c0)

6 years agoBinding generator v2 - fix InstanceIdentifier package path in classTemplate 24/61424/2
Jie Han [Mon, 17 Jul 2017 09:01:13 +0000 (17:01 +0800)]
Binding generator v2 - fix InstanceIdentifier package path in classTemplate

Change-Id: Ib38526864799e759e06ed123c17b46e4615587cc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit e64c5f327e4aae605561a095a76e7765ae62c208)

6 years agoBinding generator v2 - uses statement - uses of cases 23/61423/2
Jie Han [Mon, 17 Jul 2017 08:30:22 +0000 (16:30 +0800)]
Binding generator v2 - uses statement - uses of cases

- interface for case data extends interface for same case for referenced
grouping

Change-Id: If71de3c1361d87c5d6f4cf352e1fa9798a6e1ada
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 2111fe7094b1d794f78ca175d806b7b211fb960d)

6 years agoBinding generator v2 - fix action #3 22/61422/1
Jie Han [Mon, 17 Jul 2017 07:25:46 +0000 (15:25 +0800)]
Binding generator v2 - fix action #3

- Just let RPC process not throw exception when the parent is null.
  TODO: process action that the parent is null.

Change-Id: I730c7e19db6bd708dbf1693d8116bc088c45ba98
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit ffd5a1f75a7f1eb930c16ba65c4c655b46db5c80)

6 years agoBinding generator v2 - fix action #2 19/61419/2
Jie Han [Mon, 17 Jul 2017 02:22:13 +0000 (10:22 +0800)]
Binding generator v2 - fix action #2

- delete duplicate resolving data node which has been done in
resolveOperationNode

Change-Id: I1fda7f35cc84f14dff1213f7c70fd844d9d08607
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit de3659e9417072d31f34812a65fdaa79b9eeba83)

6 years agoBinding generator v2 - fix action #1 18/61418/1
Jie Han [Fri, 14 Jul 2017 14:07:22 +0000 (22:07 +0800)]
Binding generator v2 - fix action #1

- support action tied to a container or list data node

Change-Id: I0dafa0559608be6a269ad177f73f400bf8e18a87
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit e41f4aa9fad1174a0600d4f006ed992b6587934e)

6 years agoJavaIdentifierNormalizer ThreadSafe/Memory leak fix 58/61258/1
Martin Ciglan [Thu, 6 Jul 2017 07:33:19 +0000 (09:33 +0200)]
JavaIdentifierNormalizer ThreadSafe/Memory leak fix

1. make it thread-safe
2. memory leak fix
3. avoid deep indentations by obeying code conventions

Result "org.opendaylight.coretutorials.MyBenchmark.testBindingV2":
  165.567 ±(99.9%) 1.548 ops/s [Average]
  (min, avg, max) = (146.161, 165.567, 180.523), stdev = 6.553
  CI (99.9%): [164.019, 167.115] (assumes normal distribution)

Benchmark                   Mode  Cnt    Score   Error  Units
MyBenchmark.testBindingV2  thrpt  200  165.567 ± 1.548  ops/s

We're still around 2.8x slower than binding v1 generator,
so there will be follow-up activity to analyse/profile
architecture vs. implementation weakness and fixes
should/might be necessary to improve binding v2 generator.

Change-Id: Id1ca6e5f530c0340c3234526d6babf1f9e3c62b0
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
6 years agoBUG-8733: switch to using DOMDataTreeListener-based APIs 72/60772/20
Robert Varga [Tue, 25 Jul 2017 23:43:15 +0000 (01:43 +0200)]
BUG-8733: switch to using DOMDataTreeListener-based APIs

This patch switches ShardedDOMDataTree to use
ListenableDOMDataTreeShard, performing adaptation and aggregation
only when needed.

The end result is that a DOMDataTreeListeners affected only by
a single ListenableDOMDataTreeShard are passed directly to that
instance, allowing for efficient event delivery.

In case a registration spans multiple shards, we register a listener
with each and use DOMDataTreeListenerAggregator to efficiently
merge the callbacks.

Change-Id: I0a879b45b2389d8def5ab824ab29dfbccc2b4f86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8733: Add ListenableDOMDataTreeShard 30/60630/26
Robert Varga [Fri, 21 Jul 2017 09:45:24 +0000 (11:45 +0200)]
BUG-8733: Add ListenableDOMDataTreeShard

Implementation reliance on DOMDataTreeChangePublisher is a mistake
coming from similarities between interfaces. DOMDataTreeShard interfaces
should work with DOMDataTreeListener instances, not DOMDataTreeChangeListener.

This patch introduces ListenableDOMDataTreeShard, which exposes a proper
SPI-level method for registering DOMDataTreeListeners.

It also adds AbstractStateAggregator, which can be used to efficiently
aggregate multiple listeners into a single upcall, without the synchronization
overhead of ShardedDOMDataTreeListenerContext.

This class is then used to build DOMDataTreeChangeListenerAggregator for
bridging the old approach with ListenableDOMDataTreeShard via a utility
proxy, CompatListenableDOMDataTreeShard.

We also introduce DOMDataTreeListenerAggregator, which performs aggregation
of multiple DOMDataTreeListeners and is useful for ListenableDOMDataTreeShard
implementations where requested subtrees live in multiple child shards.

Change-Id: I979610e032605ade6d68196d51ae62778311f8c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoCleanup ShardRootModificationContext 19/60719/3
Robert Varga [Mon, 24 Jul 2017 12:10:51 +0000 (14:10 +0200)]
Cleanup ShardRootModificationContext

Remove and unneeded cast and add Identifiable interface.

Change-Id: Ibd9217402055863461349f8071211a95b3b5e2ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBug 8449 - BindingToNormalizedNodeCodec fails to deserialize union of leafrefs 31/60631/3
Jakub Toth [Fri, 21 Jul 2017 09:58:08 +0000 (11:58 +0200)]
Bug 8449 - BindingToNormalizedNodeCodec fails to deserialize union of leafrefs

Fix problem of leafref in typedef called from union
 *generated part
   *generating of new property of GTO for leaf's union type of typedef
     according to return type of referenced leaf via leafref from typedef
 *codec part
   *getting codec of leaf type according to new generator part of leafref
    in typedef
 *tests

Change-Id: Ibffe4e51ef66f1911c32c71d4f08bbdbdd40e234
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoFix a few warnings 29/60629/3
Robert Varga [Fri, 21 Jul 2017 09:38:00 +0000 (11:38 +0200)]
Fix a few warnings

Change-Id: I8b80c5c38ced7f0c02b4731df7ef94392fbd1868
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-8733: use DataTreeCandidateNodes.empty() 33/60633/2
Robert Varga [Fri, 21 Jul 2017 10:11:22 +0000 (12:11 +0200)]
BUG-8733: use DataTreeCandidateNodes.empty()

Empty node has been moved to yang-data-api, use it from there.

Change-Id: I69477c88d11a644095d2a10932a1c930da073687
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize transaction collection 93/60493/2
Robert Varga [Thu, 13 Jul 2017 15:34:56 +0000 (17:34 +0200)]
Optimize transaction collection

For cases when we have a single transaction it is not necessary
to use Futures.allAsList(). Discover this property and reuse returned
future directly.

Change-Id: I10c2d0371d8bc2c2c0585de41a114adcb7250f3c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5b094bb7682f8b2172ba4a605a8a715a19d4d6bb)

6 years agoDo not obfuscate constant 0/1 23/60523/1
Robert Varga [Wed, 5 Jul 2017 11:30:31 +0000 (13:30 +0200)]
Do not obfuscate constant 0/1

Using simple and obvious literals is preferable to non-canonical
constants. Eliminate them, making the code more explicit.

Change-Id: I2e0c1abe7717cfc119088b00504562f20820b12d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoOptimize JavaIdentifierNormalizer reserved words lookup 49/60449/6
Robert Varga [Wed, 5 Jul 2017 09:44:41 +0000 (11:44 +0200)]
Optimize JavaIdentifierNormalizer reserved words lookup

Rather than having to go to upper case for each identifier being
looked up, cache a lower-case version of
BindingMapping.WINDOWS_RESERVED_WORDS.

+ adjusted to Guava 19 (stable/carbon)

Change-Id: I1fe5f89cfd2b443b059bde3c5250c916b33b0978
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b3527d64c63d13a5ab02bdcee38bbcb3a14d975a)

6 years agoBinding2-runtime JUnit code coverage increase 35/60235/4
Martin Ciglan [Mon, 10 Jul 2017 15:30:20 +0000 (17:30 +0200)]
Binding2-runtime JUnit code coverage increase

- JUnit tests
- code clean-up

Change-Id: Id2dbf490e41a6cd7eddf024208765ac3381325f6
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
(cherry picked from commit a5bdef7fdfea23bc27cc7600e3fa34232bc27e71)

6 years agoBinding generator v2 - fix union getter name in camel-case 74/60474/2
Jie Han [Thu, 13 Jul 2017 01:54:27 +0000 (09:54 +0800)]
Binding generator v2 - fix union getter name in camel-case

Change-Id: Iaf96a0db0a60ac4ae9bad587942c81723c86ea64
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit a40f3ba3a514c4ee7f98b7c864443e8cdc5d92e3)

6 years agoBinding generator v2 - code style & cleanup 73/60473/1
Jie Han [Wed, 12 Jul 2017 12:14:48 +0000 (20:14 +0800)]
Binding generator v2 - code style & cleanup

Change-Id: I5b5d4ffcb0ea3e4f1d69158b02f665d55c3e2366
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 2763a0ab49214e98779452b250a0bd1d68c2c67f)

6 years agoBinding generator v2 - augment statement #4 71/60471/2
Jie Han [Mon, 10 Jul 2017 07:26:59 +0000 (15:26 +0800)]
Binding generator v2 - augment statement #4

- resolve augmentation that target in same module

Change-Id: Ic01b3e34271ba3f667ef3a6dc95482640bd9b895
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit b1fa86d7d82b6f20576b8b1f94af90081b44a3e6)

6 years agoBinding generator v2 - augment statement #3 70/60470/2
Jie Han [Mon, 10 Jul 2017 07:16:47 +0000 (15:16 +0800)]
Binding generator v2 - augment statement #3

- support uses implements of augmentation

Change-Id: Ic62bf99d841ec95c81bd9408acd027f41b0bc00e
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 1a500171a83bb142b59c26597e7581832fb98554)

6 years agoOptimize JavaIdentifierNormalizer.normalizeClassIdentifier() 65/60465/2
Robert Varga [Wed, 5 Jul 2017 11:19:44 +0000 (13:19 +0200)]
Optimize JavaIdentifierNormalizer.normalizeClassIdentifier()

Inner split-and-iterate is really just a simple substring assembly,
as mentioned in comments. Let's not go off into weeds and perform
a simple lastIndexOf() and substring() operations.

Change-Id: I2f21a6c92644a358bd9f8316bedde33f8b661f13
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 620b863120d334412d280cf1d4480107f4aa392d)

6 years agoDo not use temporary string to extract last character 64/60464/2
Robert Varga [Wed, 5 Jul 2017 10:29:24 +0000 (12:29 +0200)]
Do not use temporary string to extract last character

StringBuilder is a CharSequence, hence turning it into a String
just to get a character from it is wasteful.

Change-Id: Icba9d5b7ebc1207498a06b41fec84aa74a19ff3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 78da6b0de0b2c5673ff144b043ef6aaf506a88b7)

6 years agoOptimize JavaIdentifierNormalizer.normalizeClassIdentifier() 63/60463/2
Robert Varga [Wed, 5 Jul 2017 10:17:04 +0000 (12:17 +0200)]
Optimize JavaIdentifierNormalizer.normalizeClassIdentifier()

Do not use toLowerCase() in order to perform a simple compare.

Change-Id: Iadb0fce7a7ec163494442396111c6f473ac649e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bf58434226294ecaf660584d840940cedeb18010)

6 years agoOptimize fixCasesByJavaType for packages 62/60462/2
Robert Varga [Wed, 5 Jul 2017 10:10:01 +0000 (12:10 +0200)]
Optimize fixCasesByJavaType for packages

Rather than doing expensive String.replaceAll(), use CharMatcher's
removeFrom().

Change-Id: I1748fdb3fe11246b81b598cba12ddf166ee3cb4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 245a006423d41d1d4946d6a40b2f3311525f897a)

6 years agoOptimize convertIdentifierEnumValue() 61/60461/2
Robert Varga [Wed, 5 Jul 2017 10:06:43 +0000 (12:06 +0200)]
Optimize convertIdentifierEnumValue()

Use String.equalsIgnoreCase() rather than converting strings around.

Change-Id: I1695bd7aff746a4920fe985d2f95f31d1ed875b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d53de03aabb1e63d54d927d62775090da3620db6)

6 years agoOptimize JavaIdentifierNormalizer.fixCases() 60/60460/2
Robert Varga [Wed, 5 Jul 2017 09:55:38 +0000 (11:55 +0200)]
Optimize JavaIdentifierNormalizer.fixCases()

Rather than doing expensive String.split(), optimize the method
for non-underscore case and take advantage of Splitter. Also
peel the first iteration out of the loop.

Change-Id: I452737f1d3b65600aa73b19cf17ea837b12f843c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 21600d42239d0733a7b8d9de9ee442de108c8149)

6 years agoBinding generator v2 - uses statement - uses augment 57/60457/3
Jie Han [Fri, 7 Jul 2017 08:51:13 +0000 (16:51 +0800)]
Binding generator v2 - uses statement - uses augment

Change-Id: I04cd6044ad81fb8a71dd5ee70b5d06e7d01bf5f2
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 9e7fdf90771bb0ecb1dcaffcfb6ff58e93ec20b0)

6 years agoBinding generator v2 - augment statement #2 59/60459/2
Jie Han [Mon, 10 Jul 2017 07:07:02 +0000 (15:07 +0800)]
Binding generator v2 - augment statement #2

- fix augment package and class name
Change-Id: I00e5f1d0547fdf15b9c5ee5abc9059c343feccc8
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit dd12713af387be01539547adbdc001e7ce2dcc43)

6 years agoBinding generator v2 - augment statement #1 58/60458/2
Jie Han [Mon, 10 Jul 2017 06:57:41 +0000 (14:57 +0800)]
Binding generator v2 - augment statement #1

- Only resolve augmentation that it's target in same module

Change-Id: Ifb135570871e37a697238919ec6b6ef08cb8d048
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit fb0cecb23bc02de2e243ce6f7a2b4df59a7334ff)

6 years agoBinding generator v2 - uses statement - uses of list 56/60456/2
Jie Han [Fri, 7 Jul 2017 06:19:38 +0000 (14:19 +0800)]
Binding generator v2 - uses statement - uses of list

- fix list getter name of leaf "key" and
  do not add list name as prefix of leaf name.
  key "key" ; // -> getKey

  leaf key { // -> getKeyReservedWord
  ....
  }
  leaf key1 { // -> getKey1

Change-Id: I84821fbeb378e2cdd02730a2c9c0da8a288e2e90
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 58ec504edcb0c8a287b7b871022c715b1e9d6789)

6 years agoBinding generator v2 - uses statement - uses of module 55/60455/1
Jie Han [Fri, 7 Jul 2017 02:44:26 +0000 (10:44 +0800)]
Binding generator v2 - uses statement - uses of module

Change-Id: I8a2c5c9872be167ee0883a5a3020af7f4dc1d937
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 70c109ac0bde4fc1c1c94e423242522df0f06cc7)

6 years agoBinding generator v2 - uses statement - support choice 52/60452/2
Jie Han [Tue, 27 Jun 2017 08:14:54 +0000 (16:14 +0800)]
Binding generator v2 - uses statement - support choice

- generate type from uses choice which extends reference choice type
- add test yang

Note: fix getter in case type in grouping by
      "Binding generator v2 - Clean up codes of constructGetter

Change-Id: I1e72a6812ac5c32974b2db2c1b6c343ae0944bd8
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit d68c7fe825e06409bdd721dd15437ae72be097c5)

6 years agoBinding generator v2 - uses statement - uses of rpc & action 54/60454/2
Jie Han [Thu, 6 Jul 2017 12:17:40 +0000 (20:17 +0800)]
Binding generator v2 - uses statement - uses of rpc & action

Change-Id: I67ca5f9551141fc72de3644b7f6a0ee4c37c548c
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 1352a76c9a3fe8638093a8477575f8fda76f8fcb)

6 years agoBinding generator v2 - uses statement - restore getter 53/60453/2
Jie Han [Thu, 6 Jul 2017 12:15:48 +0000 (20:15 +0800)]
Binding generator v2 - uses statement - restore getter

- restore getter name without suffix "Data"

Change-Id: I1c3dfd17c1a6507170e79b6945d36992ddfe1f36
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 826538f5c121f753db2a5afa483d9e8d7e57b4be)

6 years agoBinding generator v2 - Type reference fix 72/60072/3
Jie Han [Fri, 30 Jun 2017 07:38:18 +0000 (15:38 +0800)]
Binding generator v2 - Type reference fix

Change-Id: I85e08bdb4bfe09ac12604b1e57d1933f753a0176
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 23da4f4d9b685af9c40ab570158aa0263042ed57)

6 years agoBinding generator v2 - Identity fix 77/60177/3
Jie Han [Fri, 30 Jun 2017 15:40:03 +0000 (23:40 +0800)]
Binding generator v2 - Identity fix

Change-Id: Iad246a2dfc355832ff5869a5b0bbd7b330140d00
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit b9712d4e34708ae0c5c6779bd3218557f593007d)

6 years agoOptimize JavaIdentifierNormalizer.convertFirst() 48/60448/2
Robert Varga [Wed, 5 Jul 2017 09:23:35 +0000 (11:23 +0200)]
Optimize JavaIdentifierNormalizer.convertFirst()

Rather than fiddling around with temporary strings, perform a direct
replacement capabilities of CharMatcher with two possible matches.

Change-Id: I50c4f229ef38dcd9327da183372fc5e6d7c2faf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 50d9f2ba56f265b5b0b1a19e67ad569ecabf61c3)

6 years agoBinding generator v2 - uses statement - support list 43/60443/2
Jie Han [Tue, 27 Jun 2017 03:23:17 +0000 (11:23 +0800)]
Binding generator v2 - uses statement - support list

- generate type from uses list which extends reference list type
- add suffix "Data" to the method getKey in grouping to avoid clashing with
  the method generated from uses this grouping
- add test yang

Change-Id: Id9dde5688515732abe7d8e0e7ba8b68290f14fef
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 98178444055d011062f7e3350cfd6a4a391c8aa2)

6 years agoBinding generator v2 - uses statement - resolve uses node 45/60445/2
Jie Han [Thu, 6 Jul 2017 08:17:11 +0000 (16:17 +0800)]
Binding generator v2 - uses statement - resolve uses node

Change-Id: I06c06180e84b2798c746d00cc53be200c654af90
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 7aecab16128ca4f551e4c736ba395acdba2c30d7)

6 years agoBinding generator v2 - uses statement - uses of notification 46/60446/2
Jie Han [Thu, 6 Jul 2017 09:29:56 +0000 (17:29 +0800)]
Binding generator v2 - uses statement - uses of notification

- changed for bebase
Change-Id: I78acfd070b8fe1e9987adf7de01aab81037106a4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit e2b08f79e353126cc0e89f3891aae032c591c515)

6 years agoOptimize JavaIdentifierNormalizer.normalizePartialPackageName() 44/60444/1
Robert Varga [Wed, 5 Jul 2017 08:55:27 +0000 (10:55 +0200)]
Optimize JavaIdentifierNormalizer.normalizePartialPackageName()

- eliminate duplicate String.toLower() calls
- use StringBuilder.length() instead of toString.isEmpty()
- use CharMatcher.replaceFrom() instead of String.replaceAll()
- reuse innerSb

Change-Id: I7fcdb1f2b3d6a9a0d549b1506e5a381d94ed1ba6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 539c9d657cc0aff53bd05bba74545275cba8885c)

6 years agoOptimize JavaIdentifierNormalizer.normalizeFullPackageName() 42/60442/2
Robert Varga [Wed, 5 Jul 2017 08:35:26 +0000 (10:35 +0200)]
Optimize JavaIdentifierNormalizer.normalizeFullPackageName()

Use a Splitter instead of String.split(), pre-allocate StringBuilder
with an estimated size and remove duplicate at-end checks.

Change-Id: I0f0a51533ae26aec58cf514499ffd4e0a9f3d584
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 106dc46a7d431c140869cb346b38c4f5142016b5)

6 years agoOptimize JavaIdentifierNormalizer.existNext() 41/60441/2
Robert Varga [Wed, 5 Jul 2017 09:12:05 +0000 (11:12 +0200)]
Optimize JavaIdentifierNormalizer.existNext()

Simplify conditional down to a simple expression.

Change-Id: I9914276aabff7463121d9c79f47f07a414a2e6c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ee7ca68f75cee58e6250fd2ddae42365616b54b6)

6 years agoBinding generator v2 - uses statement - uses implements 74/60274/2
Jie Han [Wed, 5 Jul 2017 14:15:48 +0000 (22:15 +0800)]
Binding generator v2 - uses statement - uses implements

- interfaces generated for data children extends (implements) interfaces for
  same children generated for referenced grouping

Change-Id: I4d9cd6e31760870353c5fdb22b7d961b195db8a0
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit d62116a5cd78856140135a991b1efe09081fe127)

6 years agoBinding2-dom-adapter JUnit code coverage increase 27/60327/2
Martin Ciglan [Tue, 11 Jul 2017 07:21:50 +0000 (09:21 +0200)]
Binding2-dom-adapter JUnit code coverage increase

- JUnit tests
- code clean-up
- ignore failing test from different package for now

Change-Id: Ia9ad961c7f4a4f7f342d3732f61ed838fecb6593
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
(cherry picked from commit 5d8911c43a7ad34a8f189289567742811f5fd981)

6 years agoBinding generator v2 - fix case builder to dto 21/60021/2
Jie Han [Thu, 6 Jul 2017 03:21:38 +0000 (11:21 +0800)]
Binding generator v2 - fix case builder to dto

Change-Id: I162e6349022a1fcc0efb69b84beba3b6c4716b71
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit e11c488ca9cbfa667b0cae9cad0b66eb304e6ee2)

6 years agoCleanup JavaIdentifierNormalizer 06/60006/2
Robert Varga [Wed, 5 Jul 2017 08:26:55 +0000 (10:26 +0200)]
Cleanup JavaIdentifierNormalizer

Eliminate overly-long line and eliminate unneeded parentheses.

Change-Id: Ifa6e22f2166a3362b6876db3532f940a9fe8367d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ee7a46fbaedcb61ca59851917b4fbe1848b1e39b)

6 years agoBinding v2 - remove checked future 57/59757/3
Jakub Toth [Fri, 23 Jun 2017 10:25:00 +0000 (12:25 +0200)]
Binding v2 - remove checked future

Change-Id: I641ae876a76ba8e06d60ec5c63d6bdf7e3695973
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoBump versions by x.y.(z+1) 57/60357/1
jenkins-releng [Fri, 14 Jul 2017 12:49:20 +0000 (12:49 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Ie62822d6d3bf54fba025492caf414f6a283c089d
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
6 years agoBug 8769 YangTextTemplate throw exception during yang binding Code Generator 59/59659/2
xygeng [Thu, 29 Jun 2017 09:06:11 +0000 (17:06 +0800)]
Bug 8769   YangTextTemplate throw exception during yang binding Code Generator

Change-Id: Ibbf5cfd60f3110cf7298dcf5a31720672b6ca296
Signed-off-by: Geng Xingyuan <geng.xingyuan@zte.com.cn>
6 years agoBinding v2 runtime - write transaction fix 51/59651/1
Martin Ciglan [Tue, 27 Jun 2017 12:00:44 +0000 (14:00 +0200)]
Binding v2 runtime - write transaction fix

- don't fiddle with normalizer in runtime
- make sure streamWriter method names correspond with yang-data-api naming
- JUnit test revealing mentioned issues added

Change-Id: Iebf92f43e0d3bd39e4c4c1aa0d38b8128cd7a918
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
(cherry picked from commit 6707b4a164734c6f2ea87bfe956a2367766e28a5)

6 years agoBinding generator v2 - namespace fix #4 74/59574/1
Jie Han [Sat, 24 Jun 2017 08:05:28 +0000 (16:05 +0800)]
Binding generator v2 - namespace fix #4

- interfaces generated for data children extends
  (implements) interfaces for same children generated for referenced grouping
- fix builder & key class link in description
- fix some tests
- cleanup codes
- fix hasBuilderClass
Change-Id: I7b26b9c930593f3874650d32f225e6c6c9313cbc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit a3cd072bdec079b4c1cdaa985e7b6d9f769d1b0d)

6 years agoBinding generator v2 - namespace fix #3 71/59571/1
Jie Han [Thu, 22 Jun 2017 09:01:45 +0000 (17:01 +0800)]
Binding generator v2 - namespace fix #3

- support generate type from uses grouping
- fix imports for builders in dto
- fiex merge conflicts

Change-Id: I211306a14243d5625a1af914329bca525ba54d7f
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit dd0a3c05d76d6576c66099eaefbbb9dc2dc90722)

6 years agoBinding generator v2 - namespace fix #2 69/59569/1
Jie Han [Wed, 21 Jun 2017 09:40:18 +0000 (17:40 +0800)]
Binding generator v2 - namespace fix #2

- fix namespace of data type in grouping namespace

- add suffix "Grouping" for grouping type name
        & "Data" for data type name

TODO #3 - support generate type from uses grouping

Change-Id: I1e59929169eb13bcba75de61770525d35213b524
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 58d35f538fe48fd71df99cc0e901da92634357a2)

6 years agoBinding generator v2 - namespace fix #1 66/59566/1
Jie Han [Wed, 21 Jun 2017 06:27:02 +0000 (14:27 +0800)]
Binding generator v2 - namespace fix #1

- put builders to dto package
- add test yang
- fix merge conflicts
TODO
     #2 - fix namespace of data type in grouping namespace

        - add "Grouping" suffix for grouping type name
        & "Data" for data type name

     #3 - support generate type from uses grouping

Change-Id: Iac9fb8f76c8308860f166019d47b8849fb41f95e
ChangeId: I08aa15ebdc6ebefb5aa38869d9fb04bfe9664ee9
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit 8d45e9e792a02e5aba4cef141f4df3955b21a378)

6 years agoBinding generator v2 - Action, ListAction fix 26/59526/2
Martin Ciglan [Thu, 22 Jun 2017 14:25:49 +0000 (16:25 +0200)]
Binding generator v2 - Action, ListAction fix

- make sure generated code is compilable
- no unnecessary calls of Java identifier normalizer
- code clean up
- TODO: 2 JUnit tests needs some rework

Change-Id: I3f5151a60106fb21e60a1cff1afad40885215fde
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
6 years agoBinding generator v2 - Binary key fix 25/59425/3
Martin Ciglan [Wed, 21 Jun 2017 10:17:18 +0000 (12:17 +0200)]
Binding generator v2 - Binary key fix

- small isues fixed to get generated code compilable

Change-Id: Idccf66675fddaba373758d810e03149c73ca0251
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
6 years agoBinding generator v2 - Identities fix 26/59426/3
Martin Ciglan [Tue, 20 Jun 2017 21:25:48 +0000 (23:25 +0200)]
Binding generator v2 - Identities fix

- if identity is once generated as base identity
of some other one, don't generate it again.
- this prevents unnecessary calls to JavaIdentifierNormalizer
and fixes compilablity issue (IdentityName.java vs. IdentityName1.java, etc..)
- code clean-up, javadoc fixes

Change-Id: Ie83f22d66bef06fd9a3b1850c09da8a3f9436062
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
6 years agoBinding generator v2 - Augments fix 24/59424/2
Martin Ciglan [Tue, 20 Jun 2017 19:05:26 +0000 (21:05 +0200)]
Binding generator v2 - Augments fix

- if YANG file uses augment identifier extension,
we need to normalize this identifier, otherwise
we end up with non-compilable generated Java code

- code clean up

Change-Id: I05ce4290b9587578944ef64428cff3e96d33dcf8
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
6 years agoBinding v2 runtime - adapters - abstract data broker test 10/59510/3
Jakub Toth [Mon, 26 Jun 2017 09:02:38 +0000 (11:02 +0200)]
Binding v2 runtime - adapters - abstract data broker test

Change-Id: Ieeaf1a4e23af0b4c723c6a5cd771388d355ad70d
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoMDSAL Binding2 Features - Carbon only 53/59153/7
Martin Ciglan [Mon, 19 Jun 2017 10:24:56 +0000 (12:24 +0200)]
MDSAL Binding2 Features - Carbon only

Change-Id: Ib2c3b85fe14eaa675d294f01ad6b2ae85655afeb
Signed-off-by: Martin Ciglan <martin.ciglan@pantheon.tech>
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoBinding v2 runtime - adapters - impl - operations 49/59449/1
Jakub Toth [Tue, 20 Jun 2017 12:39:03 +0000 (14:39 +0200)]
Binding v2 runtime - adapters - impl - operations

Change-Id: I2d95df66996bff0ae340c2f7799e6399081af6ef
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
(cherry picked from commit 20e925231d9a4d8bec35fe328c0f92f79886837d)

6 years agoRecover removed test case for JavaIdentifierNormalizerTest 38/59238/2
Jakub Toth [Tue, 20 Jun 2017 13:37:45 +0000 (15:37 +0200)]
Recover removed test case for JavaIdentifierNormalizerTest

Change-Id: Ia4064aec360e3e5f31a1322ded0730ca746f6bdf
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
(cherry picked from commit fb3ffdcf0d424e8dc6638a875181f3f5c3d74129)

6 years agoBinding v2 runtime - adapters - impl - operations invoker 35/59235/2
Jakub Toth [Mon, 19 Jun 2017 13:38:57 +0000 (15:38 +0200)]
Binding v2 runtime - adapters - impl - operations invoker

  * added marker for operations

Change-Id: I7bf7144bf35882694c7223d6b3e5e2196757bd12
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
(cherry picked from commit 76cea2ee405a4edcec07788a21fb9c4848676554)

6 years agoBinding v2 runtime - adapters - impl - notifications 34/59234/2
Jakub Toth [Fri, 16 Jun 2017 10:54:20 +0000 (12:54 +0200)]
Binding v2 runtime - adapters - impl - notifications

Change-Id: Ibfff70b6f4e9c5e4c7c198c95fb41ac278301eca
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
(cherry picked from commit bb582aed99ca77913439628b1356b1b81877fd46)