From 21571078aa80057509bf3761fde6f0da92fee0b2 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 3 Apr 2018 13:43:37 +0200 Subject: [PATCH] Initial commit --- Dockerfile | 8 + LICENSE | 202 + README.md | 51 + anc/pom.xml | 21 + .../cisco/stbarth/netconf/anc/Netconf.java | 71 + .../stbarth/netconf/anc/NetconfClient.java | 134 + .../stbarth/netconf/anc/NetconfException.java | 61 + .../stbarth/netconf/anc/NetconfFraming.java | 164 + .../stbarth/netconf/anc/NetconfSSHClient.java | 145 + .../stbarth/netconf/anc/NetconfSession.java | 650 + .../cisco/stbarth/netconf/anc/XMLElement.java | 821 + docker-compose.yml | 7 + explorer/pom.xml | 219 + .../com/cisco/stbarth/netconf/anx/MainUI.java | 77 + .../cisco/stbarth/netconf/anx/MainView.java | 613 + .../stbarth/netconf/anx/NetconfTools.java | 133 + .../stbarth/netconf/anx/RetrieverView.java | 226 + .../stbarth/netconf/anx/TelemetryTools.java | 397 + .../stbarth/netconf/anx/WrappedYangNode.java | 340 + .../cisco/stbarth/netconf/anx/YangParser.java | 166 + explorer/src/main/resources/README | 1 + explorer/src/main/resources/config.properties | 0 .../main/resources/tailf-cli-extensions.yang | 3433 ++++ explorer/src/main/resources/tailf-common.yang | 3505 +++++ .../main/resources/tailf-meta-extensions.yang | 153 + .../VAADIN/themes/adtportal/adtportal.scss | 36 + .../VAADIN/themes/adtportal/favicon.ico | Bin 0 -> 1150 bytes .../VAADIN/themes/adtportal/styles.scss | 9 + pom.xml | 19 + test.sh | 2 + xrgrpc/pom.xml | 31 + .../cisco/stbarth/netconf/xrgrpc/XRGRPC.java | 13121 ++++++++++++++++ .../stbarth/netconf/xrgrpc/XRGRPCClient.java | 144 + .../netconf/xrgrpc/gRPCConfigOperGrpc.java | 1018 ++ .../stbarth/netconf/xrgrpc/gRPCExecGrpc.java | 361 + xrgrpc/src/main/proto/mdt_grpc_dialin.proto | 166 + 36 files changed, 26505 insertions(+) create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 anc/pom.xml create mode 100644 anc/src/main/java/com/cisco/stbarth/netconf/anc/Netconf.java create mode 100644 anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfClient.java create mode 100644 anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfException.java create mode 100644 anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfFraming.java create mode 100644 anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfSSHClient.java create mode 100644 anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfSession.java create mode 100644 anc/src/main/java/com/cisco/stbarth/netconf/anc/XMLElement.java create mode 100644 docker-compose.yml create mode 100644 explorer/pom.xml create mode 100644 explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainUI.java create mode 100644 explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainView.java create mode 100644 explorer/src/main/java/com/cisco/stbarth/netconf/anx/NetconfTools.java create mode 100644 explorer/src/main/java/com/cisco/stbarth/netconf/anx/RetrieverView.java create mode 100644 explorer/src/main/java/com/cisco/stbarth/netconf/anx/TelemetryTools.java create mode 100644 explorer/src/main/java/com/cisco/stbarth/netconf/anx/WrappedYangNode.java create mode 100644 explorer/src/main/java/com/cisco/stbarth/netconf/anx/YangParser.java create mode 100644 explorer/src/main/resources/README create mode 100644 explorer/src/main/resources/config.properties create mode 100644 explorer/src/main/resources/tailf-cli-extensions.yang create mode 100644 explorer/src/main/resources/tailf-common.yang create mode 100644 explorer/src/main/resources/tailf-meta-extensions.yang create mode 100644 explorer/src/main/webapp/VAADIN/themes/adtportal/adtportal.scss create mode 100644 explorer/src/main/webapp/VAADIN/themes/adtportal/favicon.ico create mode 100644 explorer/src/main/webapp/VAADIN/themes/adtportal/styles.scss create mode 100644 pom.xml create mode 100644 test.sh create mode 100644 xrgrpc/pom.xml create mode 100644 xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/XRGRPC.java create mode 100644 xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/XRGRPCClient.java create mode 100644 xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/gRPCConfigOperGrpc.java create mode 100644 xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/gRPCExecGrpc.java create mode 100644 xrgrpc/src/main/proto/mdt_grpc_dialin.proto diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8badc16 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM jetty:alpine +LABEL maintainer "Steven Barth " +COPY . /src +USER root +RUN apk --no-cache add --virtual build-dependencies maven openjdk8 \ + && cd /src && mvn package javadoc:javadoc && cp /src/explorer/target/*.war /var/lib/jetty/webapps/ROOT.war \ + && cp -a /src/anc/target/site/apidocs /var/lib/jetty/webapps/ && cd / && rm -r /src /root/.m2 && apk del build-dependencies +EXPOSE 8080 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3ac0a46 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# ANX +ADT Netconf client (ANC) and explorer (ANX) + +## Explorer +ANX is a graphical explorer for YANG models supported by a NETCONF device or service orchestrator. Features include: +* Retrieving all YANG models supported by a device or orchestrator using the NETCONF monitoring standard. +* Parsing the YANG models (using ODL yangtools) and outputting a tree with all the nodes, which the user can expand / collapse. +* Filtering the model tree by module name and searching the names and descriptions of the YANG nodes in it (e.g. “neighbor count” or “bgp” “neighbor count”). +* Downloading a ZIP-Archive of all YANG-models supported by the device or orchestrator. +* Showing details and generating metadata for a YANG node, e.g. the description, the (sensor-)path, a subtree-filter (for NETCONF development) etc. +* Telemetry support tools to edit sensor groups and show live data using GRPC. +* Browsing and searching live (operational) data for selected YANG models. + + +### Quickstart note + +You can easily build and run using docker: + +docker build -t anx . +docker run --name anx -d -p 9269:8080 anx + +Afterwards access port 9269 of the docker host using a browser. You can use ANX to connect to any NETCONF / Yang +enabled device or orchestrator supporting NETCONF Monitoring [RFC 6022](https://tools.ietf.org/html/rfc6022). Enter +its hostname or IP-address in the "NETCONF Host"-field (optionally followed by a colon and the NETCONF over SSH port) +and input the username and password into the corresponding fields and click "Connect". + +Note: You need at least 2-3 GB of RAM on your Docker (Virtual) Machine to run this application. In case you are running it on your +laptop, please increase the RAM assigned to Docker to 3 GB. See https://docs.docker.com/docker-for-windows/#advanced or +https://docs.docker.com/docker-for-mac/#advanced + + +### Docker container +The easiest way to build and deploy the viewer is using the included Dockerfile. +If you have docker-compose installed the application can be built and run by issuing a simple `docker-compose up -d` +and will be available on port 9269. + +### WAR deployment +Alternatively maven can be used to build a WAR-file which can be deployed using Jetty, +Tomcat or a similar servlet container. + +For building use the following command: +* `mvn package` + +The resulting war-file can subsequently be found under `explorer/target`. + + + +## ANC - Java Netconf client library +ANC is the basis of the explorer and offers abstraction for most of the features of NETCONF. +It is packaged as a maven artifact so it can be installed using `mvn install` in the `anc` directory. + diff --git a/anc/pom.xml b/anc/pom.xml new file mode 100644 index 0000000..28dd774 --- /dev/null +++ b/anc/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + com.cisco.stbarth.netconf + anc + 0.3-SNAPSHOT + + 1.8 + 1.8 + + + + com.jcraft + jsch + 0.1.54 + + + diff --git a/anc/src/main/java/com/cisco/stbarth/netconf/anc/Netconf.java b/anc/src/main/java/com/cisco/stbarth/netconf/anc/Netconf.java new file mode 100644 index 0000000..a43d49c --- /dev/null +++ b/anc/src/main/java/com/cisco/stbarth/netconf/anc/Netconf.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anc; + +public class Netconf { + public static final String NS_NETCONF = "urn:ietf:params:xml:ns:netconf:base:1.0"; + public static final String NS_NETCONF_WITH_DEFAULTS = "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults"; + public static final String NS_NETCONF_NOTIFICATION = "urn:ietf:params:xml:ns:netconf:notification:1.0"; + public static final String NS_NETMOD_NOTIFICATION = "urn:ietf:params:xml:ns:netmod:notification"; + public static final String NS_NETCONF_MONITORING = "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"; + public static final String NS_TAILF_ACTIONS = "http://tail-f.com/ns/netconf/actions/1.0"; + public static final String NS_NCS = "http://tail-f.com/ns/netconf/ncs"; + + public static final String CAP_NETCONF_10 = "urn:ietf:params:netconf:base:1.0"; + public static final String CAP_NETCONF_11 = "urn:ietf:params:netconf:base:1.1"; + public static final String CAP_CONFIRMED_COMMIT = "urn:ietf:params:netconf:capability:confirmed-commit:1.1"; + public static final String CAP_VALIDATE = "urn:ietf:params:netconf:capability:validate:1.1"; + public static final String CAP_WITH_DEFAULTS = "urn:ietf:params:netconf:capability:with-defaults:1.0"; + public static final String CAP_NOTIFICATION = "urn:ietf:params:netconf:capability:notification:1.0"; + public static final String CAP_INTERLEAVE = "urn:ietf:params:netconf:capability:interleave:1.0"; + public static final String CAP_STARTUP = "urn:ietf:params:netconf:capability:startup:1.0"; + public static final String CAP_WRITABLE_RUNNING = "urn:ietf:params:netconf:capability:writable-running:1.0"; + public static final String CAP_CANDIDATE = "urn:ietf:params:netconf:capability:candidate:1.0"; + public static final String CAP_ROLLBACK_ON_ERROR = "urn:ietf:params:netconf:capability:rollback-on-error:1.0"; + public static final String CAP_URL = "urn:ietf:params:netconf:capability:url:1.0"; + public static final String CAP_XPATH = "urn:ietf:params:netconf:capability:xpath:1.0"; + public static final String CAP_MONITORING = NS_NETCONF_MONITORING; + public static final String CAP_TAILF_ACTIONS = NS_TAILF_ACTIONS; + + + + public enum Datastore { + RUNNING, CANDIDATE, STARTUP + } + + public enum EditConfigDefaultOperation { + MERGE, REPLACE, NONE + } + + public enum EditConfigTestOption { + TEST_THEN_SET, SET, TEST_ONLY + } + + public enum EditConfigOnErrorOption { + STOP, CONTINUE, ROLLBACK + } + + public enum DefaultsMode { + REPORT_ALL, REPORT_ALL_TAGGED, TRIM, EXPLICIT + } + + public enum NCSCommitParameter { + NO_REVISION_DROP, NO_NETWORKING, NO_OVERWRITE, NO_OUT_OF_SYNC_CHECK + } +} diff --git a/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfClient.java b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfClient.java new file mode 100644 index 0000000..e22f61c --- /dev/null +++ b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfClient.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anc; + +import java.time.ZonedDateTime; +import java.util.function.Consumer; + +public abstract class NetconfClient implements AutoCloseable { + /** + * Create a new session + * @return + * @throws NetconfException + */ + public abstract NetconfSession createSession() throws NetconfException; + + /** + * Close the current client + * @throws NetconfException + */ + public abstract void close() throws NetconfException; + + private AutoCloseable createSubscriptionThread(NetconfSession session, Consumer notificationConsumer, + Consumer terminationConsumer) { + session.setNotificationConsumer(notificationConsumer); + Thread thread = new Thread(() -> { + NetconfException.ProtocolException error = null; + try { + session.receiveNotifications(); + } catch (NetconfException.ProtocolException e) { + if (!session.isClosed()) + error = e; + } finally { + try { + synchronized (session) { + if (!session.isClosed()) + session.close(); + } + } catch (NetconfException.ProtocolException e) { + // pass + } + } + if (terminationConsumer != null) + terminationConsumer.accept(error); + }); + thread.setDaemon(true); + thread.start(); + return session; + } + + /** + * Create a new subscription session, subscribe to the given notifications and spawn a new thread for consumption. + * + * @param stream if not-null, the stream to subscribe to, otherwise "NETCONF" is used + * @param startTime the time to start replaying from + * @param stopTime the time until the subscription ends + * @param notificationConsumer Callback which will be invoked for each received notification + * @param terminationConsumer Callback which will be invoked after the session has ended with the termination cause + * @throws NetconfException + * @return AutoCloseable object to close the subscription and end the underlying session + */ + public AutoCloseable createSubscriptionSession(String stream, ZonedDateTime startTime, ZonedDateTime stopTime, + Consumer notificationConsumer, + Consumer terminationConsumer) + throws NetconfException { + NetconfSession session = createSession(); + session.createSubscription(stream, startTime, stopTime); + return createSubscriptionThread(session, notificationConsumer, terminationConsumer); + } + + /** + * Create a new subscription session, subscribe to the given notifications and spawn a new thread for consumption. + * + * Use XPath to filter notifications. + * + * @param stream + * @param xpathFilter + * @param startTime + * @param stopTime + * @param notificationConsumer Callback which will be invoked for each received notification + * @param terminationConsumer Callback which will be invoked after the session has ended with the termination cause + * @throws NetconfException + * @return AutoCloseable object to close the subscription and end the underlying session + */ + public AutoCloseable createSubscriptionSession(String stream, String xpathFilter, ZonedDateTime startTime, + ZonedDateTime stopTime, Consumer notificationConsumer, + Consumer terminationConsumer) + throws NetconfException { + NetconfSession session = createSession(); + session.createSubscription(stream, xpathFilter, startTime, stopTime); + return createSubscriptionThread(session, notificationConsumer, terminationConsumer); + } + + + /** + * Create a new subscription session, subscribe to the given notifications and spawn a new thread for consumption. + * + * Use a subtree filter for filtering notifications. + * + * @param stream if not-null, the stream to subscribe to, otherwise "NETCONF" is used + * @param subtreeFilter Subtree filter to apply + * @param startTime if not-null, the time to start replaying from + * @param stopTime if not-null, the time until the subscription ends + * @param notificationConsumer Callback which will be invoked for each received notification + * @param terminationConsumer Callback which will be invoked after the session has ended with the termination cause + * @throws NetconfException + * @return AutoCloseable object to close the subscription and end the underlying session + */ + public AutoCloseable createSubscriptionSession(String stream, XMLElement subtreeFilter, + ZonedDateTime startTime, ZonedDateTime stopTime, + Consumer notificationConsumer, + Consumer terminationConsumer) + throws NetconfException { + NetconfSession session = createSession(); + session.createSubscription(stream, subtreeFilter, startTime, stopTime); + return createSubscriptionThread(session, notificationConsumer, terminationConsumer); + } +} + diff --git a/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfException.java b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfException.java new file mode 100644 index 0000000..5ad295a --- /dev/null +++ b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfException.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anc; + +public class NetconfException extends Exception { + public NetconfException(Throwable e) { + super(e); + } + + public NetconfException(String msg) { + super(msg); + } + + /** + * A low-level protocol or I/O exception. + * + * Upon catching such an exception, the behavior of the session becomes undefined. + */ + public static class ProtocolException extends NetconfException { + public ProtocolException(Throwable e) { + super(e); + } + + public ProtocolException(String msg) { + super(msg); + } + } + + /** + * A high-level RPC exception. + */ + public static class RPCException extends NetconfException { + private XMLElement rpcReply; + + public RPCException(XMLElement rpcReply) { + super(rpcReply.getFirst("rpc-error").map(x -> x.getText("error-tag")).orElse("") + ": " + + rpcReply.getFirst("rpc-error").map(x -> x.getText("error-message")).orElse("")); + this.rpcReply = rpcReply; + } + + public XMLElement getRPCReply() { + return rpcReply; + } + } +} diff --git a/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfFraming.java b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfFraming.java new file mode 100644 index 0000000..50b7e6d --- /dev/null +++ b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfFraming.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anc; + +import java.io.FilterOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; + +class NetconfFraming { + private static final ByteBuffer EOM = ByteBuffer.wrap("]]>]]>".getBytes()); + static { + EOM.position(1); + } + + static class DelimitedMessageUnframer extends InputStream { + private ByteBuffer buffer = ByteBuffer.allocate(EOM.remaining()); + private boolean closed = false; + private InputStream inputStream; + + DelimitedMessageUnframer(InputStream inputStream) { + this.inputStream = inputStream; + buffer.limit(0); + } + + @Override + public int read() throws IOException { + int b = closed ? -1 : (buffer.hasRemaining() ? buffer.get() : inputStream.read()); + if (b == EOM.get(0)) { + buffer.compact(); + while (buffer.hasRemaining()) { + int read = inputStream.read(buffer.array(), buffer.position(), buffer.remaining()); + if (read < 0) + throw new IOException("Premature EOF"); + else + buffer.position(buffer.position() + read); + } + + buffer.rewind(); + if (buffer.equals(EOM)) { + closed = true; + b = -1; + } + } + return b; + } + + @Override + public void close() throws IOException { + while (read() >= 0); + } + } + + static class DelimitedMessageFramer extends FilterOutputStream { + DelimitedMessageFramer(OutputStream outputStream) { + super(outputStream); + } + + @Override + public void close() throws IOException { + out.write(EOM.array()); + out.flush(); + } + } + + static class ChunkedMessageUnframer extends InputStream { + private InputStream inputStream; + private byte[] dummy = new byte[1]; + private int remaining = 0; + + ChunkedMessageUnframer(InputStream inputStream) { + this.inputStream = inputStream; + } + + @Override + public int read() throws IOException { + return read(dummy) < 0 ? -1 : dummy[0]; + } + + @Override + public int read(byte[] b) throws IOException { + return read(b, 0, b.length); + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + if (remaining < 0) { + return -1; + } else if (remaining == 0 && inputStream.read() == '\n' && inputStream.read() == '#') { + int c; + for (c = inputStream.read(); c >= '0' && c <= '9'; c = inputStream.read()) + remaining = remaining * 10 + (c - '0'); + + if (remaining == 0 && c == '#' && inputStream.read() == '\n') { + remaining = -1; + return -1; + } else if (c != '\n') { + remaining = -1; + } + } + + if (remaining <= 0) + throw new IOException("Invalid framing header"); + + len = inputStream.read(b, off, Math.min(remaining, len)); + if (len < 0) + throw new IOException("Premature EOF"); + + remaining -= len; + return len; + } + + @Override + public void close() throws IOException { + while (read() >= 0); + } + } + + static class ChunkedMessageFramer extends FilterOutputStream { + ChunkedMessageFramer(OutputStream outputStream) { + super(outputStream); + } + + @Override + public void write(int b) throws IOException { + out.write("\n#1\n".getBytes()); + out.write(b); + } + + @Override + public void write(byte[] b) throws IOException { + write(b, 0, b.length); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + out.write(String.format("\n#%d\n", len).getBytes()); + out.write(b, off, len); + } + + @Override + public void close() throws IOException { + out.write("\n##\n".getBytes()); + out.flush(); + } + } +} diff --git a/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfSSHClient.java b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfSSHClient.java new file mode 100644 index 0000000..60455d5 --- /dev/null +++ b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfSSHClient.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anc; + +import com.jcraft.jsch.ChannelSubsystem; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.JSchException; +import com.jcraft.jsch.Session; + +import java.io.IOException; + +public class NetconfSSHClient extends NetconfClient { + private Session session; + private String hostname; + private String username; + private String password; + private String keyfile; + private String keyfilePassphrase; + private boolean strictHostKeyChecking = true; + private int port; + private int timeout; + private int keepalive; + + /** + * Create a new NETCONF connection to the given server + * + * The connection will not be established immediately, but instead upon creating the first session. + * + * @param hostname + * @param port + * @param username + */ + public NetconfSSHClient(String hostname, int port, String username) { + this.hostname = hostname; + this.port = port; + this.username = username; + } + + /** + * Use password authentication for the SSH session + * @param password + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Set the SSH connection timeout in ms + * @param timeout timeout in milliseconds + */ + public void setTimeout(int timeout) { + this.timeout = timeout; + } + + /** + * Set the SSH keepalive interval in ms + * @param keepalive interval in milliseconds + */ + public void setKeepalive(int keepalive) { + this.keepalive = keepalive; + } + + /** + * Use a private key to authenticate and use the password (if given) to decrypt it. + * @param keyFile + * @param keyFilePassphrase + */ + public void setKeyFile(String keyFile, String keyFilePassphrase) { + this.keyfile = keyFile; + this.keyfilePassphrase = keyFilePassphrase; + } + + /** + * Enable or disable strict hostkey checking + * + * This must be done before createSession is called + * + * @param strictHostKeyChecking + */ + public void setStrictHostKeyChecking(boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + } + + /** + * Create a new NETCONF session (and create the underlying SSH connection if it didn't already exist). + * @return + * @throws NetconfException.ProtocolException + */ + public NetconfSession createSession() throws NetconfException.ProtocolException { + try { + if (session == null || !session.isConnected()) { + JSch jSch = new JSch(); + + if (keyfile != null && keyfilePassphrase != null) + jSch.addIdentity(keyfile, keyfilePassphrase); + else if (keyfile != null) + jSch.addIdentity(keyfile); + + session = jSch.getSession(username, hostname, port); + session.setDaemonThread(true); + session.setTimeout(timeout); + session.setServerAliveInterval(keepalive); + session.setConfig("StrictHostKeyChecking", strictHostKeyChecking ? "yes" : "no"); + + if (password != null) + session.setPassword(password); + + session.connect(); + } + + ChannelSubsystem channel = (ChannelSubsystem)session.openChannel("subsystem"); + channel.setSubsystem("netconf"); + NetconfSession netconfSession = new NetconfSession( + this, channel.getInputStream(), channel.getOutputStream(), channel::disconnect); + channel.connect(); + netconfSession.hello(); + return netconfSession; + } catch (JSchException | IOException e) { + throw new NetconfException.ProtocolException(e); + } + } + + /** + * Close the NETCONF connection to the server including any remaining sessions. + */ + public void close() { + session.disconnect(); + } +} diff --git a/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfSession.java b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfSession.java new file mode 100644 index 0000000..f10c00e --- /dev/null +++ b/anc/src/main/java/com/cisco/stbarth/netconf/anc/NetconfSession.java @@ -0,0 +1,650 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anc; + +import java.io.*; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Stream; + +import static com.cisco.stbarth.netconf.anc.Netconf.*; + +public class NetconfSession implements AutoCloseable { + private NetconfClient client; + private InputStream inputStream; + private OutputStream outputStream; + private AutoCloseable closeableTransport; + private Map capabilities; + private long sessionID; + private int messageID; + private Netconf.DefaultsMode defaultsMode; + private Netconf.NCSCommitParameter ncsCommitParameter; + private boolean closed; + private Consumer notificationConsumer; + private BiConsumer callTraceConsumer; + + private Function unframingFactory = NetconfFraming.DelimitedMessageUnframer::new; + private Function framingFactory = NetconfFraming.DelimitedMessageFramer::new; + + NetconfSession(NetconfClient client, InputStream input, OutputStream output, AutoCloseable closeableTransport) { + this.client = client; + this.inputStream = input; + this.outputStream = output; + this.closeableTransport = closeableTransport; + } + + void hello() throws NetconfException.ProtocolException { + XMLElement peerHello = request(new XMLElement(NS_NETCONF, "hello") + .createChild("capabilities") + .withTextChild("capability", CAP_NETCONF_10) + .withTextChild("capability", CAP_NETCONF_11)); + + sessionID = Long.parseLong(peerHello.getText("session-id")); + capabilities = new HashMap<>(); + peerHello.getFirst("capabilities").map(x -> x.stream("capability")).orElse(Stream.empty()) + .map(XMLElement::getText).forEach(x -> capabilities.put( + x.indexOf('?') < 0 ? x : x.substring(0, x.indexOf('?')), + x.indexOf('?') < 0 ? "" : x.substring(x.indexOf('?')))); + + if (capabilities.containsKey(CAP_NETCONF_11)) { + framingFactory = NetconfFraming.ChunkedMessageFramer::new; + unframingFactory = NetconfFraming.ChunkedMessageUnframer::new; + } else if (!capabilities.containsKey(CAP_NETCONF_10)) { + throw new NetconfException.ProtocolException("No supported protocol versions in common!"); + } + } + + /** + * Set with-defaults parameter for handling of default values for data retrieval operations. + * @param defaultsMode + */ + public void setDefaultsMode(DefaultsMode defaultsMode) { + this.defaultsMode = defaultsMode; + } + + /** + * Add NCS-specific commit parameter + * @param ncsCommitParameter + */ + public void setNCSCommitParameter(NCSCommitParameter ncsCommitParameter) { + this.ncsCommitParameter = ncsCommitParameter; + } + + private void send(XMLElement element) throws NetconfException.ProtocolException { + try (OutputStream messageOutputStream = framingFactory.apply(outputStream)) { + element.writeTo(messageOutputStream, true); + } catch (IOException | XMLElement.XMLException e) { + throw new NetconfException.ProtocolException(e); + } + } + + private synchronized XMLElement request(XMLElement element) throws NetconfException.ProtocolException { + send(element); + return receive(); + } + + /** + * Receive one message from the server. + * + * This can be used for receiving notifications, once a subscription has been created. + * + * @return XML element + * @throws NetconfException.ProtocolException + */ + public synchronized XMLElement receive() throws NetconfException.ProtocolException { + try { + return new XMLElement(unframingFactory.apply(inputStream)); + } catch (IOException | XMLElement.XMLException e) { + throw new NetconfException.ProtocolException(e); + } + } + + /** + * Set the consumer for notifications + * + * This is used as callback whenever notifications are received, e.g. when reusing a session for both notifications + * and requests or to avoid a race condition when setting up multiple subscriptions. This callback is also used + * for receiveNotifications(). + * + * @param notificationConsumer + */ + public void setNotificationConsumer(Consumer notificationConsumer) { + this.notificationConsumer = notificationConsumer; + } + + /** + * Set the consumer for call-traces + * + * This is a debug mechanism which can trace all request / response messages done by this session. + * @param callTraceConsumer + */ + public void setCallTraceConsumer(BiConsumer callTraceConsumer) { + this.callTraceConsumer = callTraceConsumer; + } + + /** + * Receive all notifications from the server, until a non-notification is received which is returned. + * + * setNotificationConsumer is used to setup the callback. + * + * @return the first non-notification reply + * @throws NetconfException.ProtocolException + */ + public XMLElement receiveNotifications() throws NetconfException.ProtocolException { + XMLElement message = receive(); + while (message.getNamespace().equals(NS_NETCONF_NOTIFICATION) && message.getName().equals("notification")) { + notificationConsumer.accept(message); + message = receive(); + } + return message; + } + + /** + * Send a RPC request to the NETCONF server and receive the reply. + * + * @param request Request element + * @return The RPC reply in case of success + * @throws NetconfException RPCException with data supplied from the server or a ProtocolException indicating lower-level errors + */ + public synchronized XMLElement call(XMLElement request) throws NetconfException { + String rpcID = String.valueOf(++messageID); + XMLElement call = new XMLElement(NS_NETCONF, "rpc").withAttribute("message-id", rpcID).withChild(request); + XMLElement reply = request(call); + + while (reply.getNamespace().equals(NS_NETCONF_NOTIFICATION) && reply.getName().equals("notification")) { + if (notificationConsumer != null) + notificationConsumer.accept(reply); + reply = receive(); + } + + if (callTraceConsumer != null) + callTraceConsumer.accept(call, reply); + + if (!reply.getName().equals("rpc-reply")) + throw new NetconfException.ProtocolException("Invalid RPC-reply received"); + + if (reply.getFirst("rpc-error").isPresent()) + throw new NetconfException.RPCException(reply); + + return reply; + } + + private XMLElement get(Datastore datastore, Consumer filter) + throws NetconfException { + return call(new XMLElement(NS_NETCONF, datastore != null ? "get-config" : "get", gc -> { + if (datastore != null) + gc.createChild("source").createChild(datastore.name().toLowerCase()); + + if (filter != null) + gc.withChild("filter", filter); + + if (defaultsMode != null) + gc.withTextChild(NS_NETCONF_WITH_DEFAULTS, "with-defaults", + defaultsMode.name().toLowerCase().replace('_', '-')); + })).getFirst("data").orElseThrow(() -> new NetconfException("Missing data element in reply to ")); + } + + /** + * Perform a get-config operation using an XPath filter + * @param xpathFilter XPath-filter to apply remotely + * @param datastore If non-null, perform a get-config operation on given datastore, otherwise perform a get + * @return Data element of the rpc-reply + * @throws NetconfException RPCException or Protocol + */ + public XMLElement getConfig(Datastore datastore, String xpathFilter) throws NetconfException { + return get(datastore, f -> f + .withAttribute("type", "xpath") + .withAttribute("select", xpathFilter)); + } + + /** + * Perform a get-config operation using an XML subtree filter + * @param subtreeFilter XPath-filter to apply remotely + * @param datastore If non-null, perform a get-config operation on given datastore, otherwise perform a get + * @return Data element of the rpc-reply + * @throws NetconfException RPCException or Protocol + */ + public XMLElement getConfig(Datastore datastore, Iterable subtreeFilter) throws NetconfException { + return get(datastore, f -> f + .withAttribute("type", "subtree") + .withChildren(subtreeFilter)); + } + + /** + * Perform a get-config operation without any filter + * @param datastore If non-null, perform a get-config operation on given datastore, otherwise perform a get + * @return Data element of the rpc-reply + * @throws NetconfException RPCException or Protocol + */ + public XMLElement getConfig(Datastore datastore) throws NetconfException { + return get(datastore, null); + } + + /** + * Perform a get operation using an XPath filter + * @param xpathFilter XPath-filter to apply remotely + * @return Data element of the rpc-reply + * @throws NetconfException RPCException or Protocol + */ + public XMLElement get(String xpathFilter) throws NetconfException { + return get(null, f -> f + .withAttribute("type", "xpath") + .withAttribute("select", xpathFilter)); + } + + /** + * Perform a get operation using an XML subtree filter + * @param subtreeFilter XPath-filter to apply remotely + * @return Data element of the rpc-reply + * @throws NetconfException RPCException or Protocol + */ + public XMLElement get(Iterable subtreeFilter) throws NetconfException { + return get(null, f -> f + .withAttribute("type", "subtree") + .withChildren(subtreeFilter)); + } + + /** + * Perform a get operation without any filter + * @return Data element of the rpc-reply + * @throws NetconfException RPCException or Protocol + */ + public XMLElement get() throws NetconfException { + return get(null, null); + } + + /** + * Perform an edit-config opetation on the given datastore. + * @param datastore Target datastore + * @param config Config elements to manipulate + * @param defaultOperation If non-null, the default operation to perform + * @param onError If non-null, the behavior for error cases + * @param testOption If non-null, the behavior for testing + * @throws NetconfException + */ + public void editConfig(Datastore datastore, XMLElement config, EditConfigDefaultOperation defaultOperation, + EditConfigOnErrorOption onError, EditConfigTestOption testOption) throws NetconfException { + call(new XMLElement(NS_NETCONF, "edit-config", ec -> { + ec.withChild("target", t -> t + .withChild(datastore.name().toLowerCase())) + .withChild("config", c -> c.withChild(config)); + + if (defaultOperation != null) + ec.withTextChild("default-operation", defaultOperation.name().toLowerCase()); + + if (onError != null) + ec.withTextChild("error-option", onError.name().toLowerCase().concat("-on-error")); + + if (testOption != null) + ec.withTextChild("test-option", testOption.name().toLowerCase().replace('_', '-')); + + if (ncsCommitParameter != null) + ec.withChild(NS_NCS, ncsCommitParameter.name().toLowerCase().replace('_', '-')); + })); + } + + /** + * Perform an edit-config opetation on the given datastore. + * @param datastore Target datastore + * @param config Config elements to manipulate + * @param defaultOperation If non-null, the default operation to perform + * @throws NetconfException + */ + public void editConfig(Datastore datastore, XMLElement config, EditConfigDefaultOperation defaultOperation) + throws NetconfException { + editConfig(datastore, config, defaultOperation, null, null); + } + + /** + * Perform an edit-config opetation on the given datastore. + * @param datastore Target datastore + * @param config Config elements to manipulate + * @throws NetconfException + */ + public void editConfig(Datastore datastore, XMLElement config) throws NetconfException { + editConfig(datastore, config, null, null, null); + } + + /** + * Copy configuration from one datastore to another + * @param source + * @param target + * @throws NetconfException + */ + public void copyConfig(Datastore source, Datastore target) throws NetconfException { + call(new XMLElement(NS_NETCONF, "copy-config", cc -> cc + .withChild("source", s -> s.withChild(source.name().toLowerCase())) + .withChild("target", t -> t.withChild(target.name().toLowerCase())))); + } + + /** + * Copy configuration from a datastore to a URL + * @param source + * @param targetURL + * @throws NetconfException + */ + public void copyConfig(Datastore source, String targetURL) throws NetconfException { + call(new XMLElement(NS_NETCONF, "copy-config", cc -> { + cc.withChild("source", s -> s.withChild(source.name().toLowerCase())) + .withChild("target", t -> t.withTextChild("url", targetURL)); + + if (defaultsMode != null) + cc.withTextChild(NS_NETCONF_WITH_DEFAULTS, "with-defaults", + defaultsMode.name().toLowerCase().replace('_', '-')); + })); + } + + /** + * Copy configuration from a URL to a datastore + * @param sourceURL + * @param target + * @throws NetconfException + */ + public void copyConfig(String sourceURL, Datastore target) throws NetconfException { + call(new XMLElement(NS_NETCONF, "copy-config", cc -> cc + .withChild("source", s -> s.withTextChild("url", sourceURL)) + .withChild("target", t -> t.withChild(target.name().toLowerCase())))); + } + + /** + * Copy configuration remote to remote + * @param sourceURL + * @param targetURL + * @throws NetconfException + */ + public void copyConfig(String sourceURL, String targetURL) throws NetconfException { + call(new XMLElement(NS_NETCONF, "copy-config", cc -> cc + .withChild("source", s -> s.withTextChild("url", sourceURL)) + .withChild("target", t -> t.withTextChild("url", targetURL)))); + } + + /** + * Delete configuration from a datastore + * @param target + * @throws NetconfException + */ + public void deleteConfig(Datastore target) throws NetconfException { + call(new XMLElement(NS_NETCONF, "delete-config").withChild("target", + x -> x.createChild(target.name().toLowerCase()))); + } + + /** + * Delete configuration from a URL + * @param targetURL + * @throws NetconfException + */ + public void deleteConfig(String targetURL) throws NetconfException { + call(new XMLElement(NS_NETCONF, "unlock").withChild("target", + x -> x.withTextChild("url", targetURL))); + } + + /** + * Lock given datastore + * @param target + * @throws NetconfException + */ + public void lock(Datastore target) throws NetconfException { + call(new XMLElement(NS_NETCONF, "lock").withChild("target", + x -> x.createChild(target.name().toLowerCase()))); + } + + /** + * Unlocak given datastore + * @param target + * @throws NetconfException + */ + public void unlock(Datastore target) throws NetconfException { + call(new XMLElement(NS_NETCONF, "unlock").withChild("target", + x -> x.createChild(target.name().toLowerCase()))); + } + + /** + * Kill given NETCONF session + * @param sessionID + * @throws NetconfException + */ + public void killSession(long sessionID) throws NetconfException { + call(new XMLElement(NS_NETCONF, "kill-session").withTextChild("session-id", String.valueOf(sessionID))); + } + + /** + * Commit the candidate configuration as the device's new current configuration. + * @throws NetconfException + */ + public void commit() throws NetconfException { + call(new XMLElement(NS_NETCONF, "commit")); + } + + /** + * Create a confirmed commit + * @param confirmTimeout If greater than 0, also set the confirmation timeout to the given value in seconds + * @param persist If non-null, make the commit persistent with the given ID + * @throws NetconfException + */ + public void commit(long confirmTimeout, String persist) throws NetconfException { + call(new XMLElement(NS_NETCONF, "commit", c -> { + c.withChild("confirmed"); + + if (confirmTimeout > 0) + c.withTextChild("confirm-timeout", String.valueOf(confirmTimeout > 0 ? confirmTimeout : 600)); + + if (persist != null) + c.withTextChild("persist", persist); + })); + } + + /** + * Confirm a persistent commit with given ID (likely from another Session) + * @param persistID + * @throws NetconfException + */ + public void commit(String persistID) throws NetconfException { + call(new XMLElement(NS_NETCONF, "commit").withTextChild("persist-id", persistID)); + } + + /** + * Cancel a given commit + * @param persistID If non-null, the persistent commit identifier (likely from another Session) + * @throws NetconfException + */ + public void cancelCommit(String persistID) throws NetconfException { + call(new XMLElement(NS_NETCONF, "cancel-commit").withTextChild("persist-id", persistID)); + } + + /** + * Revert the candidate configuration to the current running configuration. + * @throws NetconfException + */ + public void discardChanges() throws NetconfException { + call(new XMLElement(NS_NETCONF, "discard-changes")); + } + + /** + * Validate given datastore + * @param source + * @throws NetconfException + */ + public void validate(Datastore source) throws NetconfException { + call(new XMLElement(NS_NETCONF, "validate").withChild("source", + x -> x.createChild(source.name().toLowerCase()))); + } + + /** + * Validate given remote configuration. + * @param sourceURL + * @throws NetconfException + */ + public void validate(String sourceURL) throws NetconfException { + call(new XMLElement(NS_NETCONF, "validate").withChild("source", + x -> x.withTextChild("url", sourceURL))); + } + + /** + * Validate given configuration passed by value + * @param config + * @throws NetconfException + */ + public void validate(XMLElement config) throws NetconfException { + call(new XMLElement(NS_NETCONF, "validate").withChild("source", + x -> x.createChild("config").withChild(config))); + } + + private void createSubscription(String stream, ZonedDateTime startTime, ZonedDateTime stopTime, + Consumer consumer) throws NetconfException { + call(new XMLElement(NS_NETCONF_NOTIFICATION, "create-subscription", cs -> { + if (stream != null) + cs.withTextChild("stream", stream); + + if (consumer != null) + cs.withChild(NS_NETCONF, "filter", consumer); + + if (startTime != null) + cs.withTextChild("startTime", startTime.format(DateTimeFormatter.ISO_INSTANT)); + + if (stopTime != null) + cs.withTextChild("stopTime", stopTime.format(DateTimeFormatter.ISO_INSTANT)); + })); + } + + /** + * Create a subscription for receiving notifications. + * @param stream if not-null, the stream to subscribe to, otherwise "NETCONF" is used + * @param startTime if not-null, the time to start replaying from + * @param stopTime if not-null, the time until the subscription ends + * @throws NetconfException + */ + public void createSubscription(String stream, ZonedDateTime startTime, ZonedDateTime stopTime) + throws NetconfException { + createSubscription(stream, startTime, stopTime, null); + } + + /** + * Create a subscription for receiving notifications and filter using XPath. + * @param stream if not-null, the stream to subscribe to, otherwise "NETCONF" is used + * @param xpathFilter XPath filter to apply + * @param startTime if not-null, the time to start replaying from + * @param stopTime if not-null, the time until the subscription ends + * @throws NetconfException + */ + public void createSubscription(String stream, String xpathFilter, ZonedDateTime startTime, ZonedDateTime stopTime) + throws NetconfException { + createSubscription(stream, startTime, stopTime, f -> f.withAttribute("type", "xpath") + .withAttribute("select", xpathFilter)); + } + + /** + * Create a subscription for receiving notifications and filter using subtree. + * @param stream if not-null, the stream to subscribe to, otherwise "NETCONF" is used + * @param subtreeFilter Subtree filter to apply + * @param startTime if not-null, the time to start replaying from + * @param stopTime if not-null, the time until the subscription ends + * @throws NetconfException + */ + public void createSubscription(String stream, XMLElement subtreeFilter, + ZonedDateTime startTime, ZonedDateTime stopTime) throws NetconfException { + createSubscription(stream, startTime, stopTime, + f -> f.withAttribute("type", "subtree").withChild(subtreeFilter)); + } + + /** + * Retrieve a schema from a NETCONF server. + * @param identifier Schema to retrieve + * @param version if not-null, the version to retrieve + * @param format if not-null, the format to receive, otherwise "yang" is used + * @throws NetconfException + * @return Yang schema + */ + public XMLElement getSchema(String identifier, String version, String format) throws NetconfException { + return call(new XMLElement(NS_NETCONF_MONITORING, "get-schema", gs -> { + gs.withTextChild("identifier", identifier); + + if (version != null) + gs.withTextChild("version", version); + + if (format != null) + gs.withTextChild("format", format); + })).getFirst(NS_NETCONF_MONITORING, "data") + .orElseThrow(() -> new NetconfException("No data-element in reply to get-schema")); + } + + /** + * Call a tailf:action. + * @param data Data + * @throws NetconfException + * @return Action Reply + */ + public XMLElement tailfAction(XMLElement data) throws NetconfException { + return call(new XMLElement(NS_TAILF_ACTIONS, "action").withChild("data", x -> x.withChild(data))) + .getFirst("data").orElseThrow(() -> new NetconfException("Missing data element in reply to ")); + } + + /** + * Get the client object associated with this session. + * @return + */ + public NetconfClient getClient() { + return client; + } + + /** + * Get the capabilities as indicated by the server + * @return Mapping of capability (without arguments) to capability arguments (URI query string) + */ + public Map getCapabilities() { + return capabilities; + } + + /** + * Get the ID of the current session + * @return + */ + public long getSessionID() { + return sessionID; + } + + /** + * Check if the session was closed + * @return + */ + public boolean isClosed() { + return closed; + } + + /** + * Gracefully shutdown the current session + * @throws NetconfException.ProtocolException + */ + public void close() throws NetconfException.ProtocolException { + try { + closed = true; + send(new XMLElement(NS_NETCONF, "close-session")); + } finally { + try { + closeableTransport.close(); + } catch (Exception e) { + throw new NetconfException.ProtocolException(e); + } + } + } +} \ No newline at end of file diff --git a/anc/src/main/java/com/cisco/stbarth/netconf/anc/XMLElement.java b/anc/src/main/java/com/cisco/stbarth/netconf/anc/XMLElement.java new file mode 100644 index 0000000..ee9d27e --- /dev/null +++ b/anc/src/main/java/com/cisco/stbarth/netconf/anc/XMLElement.java @@ -0,0 +1,821 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anc; + +import org.w3c.dom.*; +import org.xml.sax.SAXException; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +public class XMLElement implements Iterable, Cloneable { + private Element element; + private static HashMap xpathNamespaces = new HashMap<>(); + + public static class XMLException extends Exception { + XMLException(Throwable cause) { + super(cause); + } + } + + public static class XPathException extends RuntimeException { + XPathException(Throwable cause) { + super(cause); + } + } + + public XMLElement(Element element) { + this.element = element; + } + + /** + * Create a wrapped XML element from an InputStream + * @param stream + * @throws IOException + * @throws XMLException + */ + public XMLElement(InputStream stream) throws IOException, XMLException { + try { + element = createBuilder().parse(stream).getDocumentElement(); + } catch (SAXException e) { + throw new XMLException(e); + } + } + + /** + * Create a wrapped XML element from a string containing an XML document + * @param source + * @throws IOException + * @throws XMLException + */ + public XMLElement(String source) throws IOException, XMLException { + this(new ByteArrayInputStream(source.getBytes(StandardCharsets.UTF_8))); + } + + /** + * Create a new empty document and return the root element. + * @param namespace + * @param name + */ + public XMLElement(String namespace, String name) { + Document document = createBuilder().newDocument(); + element = document.createElementNS(namespace, name); + document.appendChild(element); + } + + /** + * Create a new empty document, apply a function and return the root element. + * @param namespace + * @param name + * @param consumer + */ + public XMLElement(String namespace, String name, Consumer consumer) { + this(namespace, name); + consumer.accept(this); + } + + private static DocumentBuilder createBuilder() { + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + return factory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + throw new RuntimeException(e); + } + } + + private Stream nodeListToElementStream(NodeList list) { + return IntStream.range(0, list.getLength()).mapToObj(list::item). + filter(n -> n.getNodeType() == Node.ELEMENT_NODE).map(Element.class::cast).map(XMLElement::new); + } + + private Optional select(QName type, String xPathExpression, String... ns) { + try { + XPath xpath = XPathFactory.newInstance().newXPath(); + xpath.setNamespaceContext(new NamespaceContext() { + @Override + public String getNamespaceURI(String prefix) { + return Arrays.stream(ns).filter(x -> x.charAt(prefix.length()) == '=' && x.startsWith(prefix)). + findAny().map(x -> x.substring(prefix.length() + 1)).orElse( + xpathNamespaces.getOrDefault(prefix, element.getNamespaceURI())); + } + + @Override + public String getPrefix(String namespaceURI) { + throw new UnsupportedOperationException(); + } + + @Override + public Iterator getPrefixes(String namespaceURI) { + throw new UnsupportedOperationException(); + } + }); + return Optional.ofNullable(xpath.evaluate(xPathExpression, element, type)); + } catch (XPathExpressionException e) { + throw new XPathException(e); + } + } + + /** + * Create a stream of all child nodes satisfying an XPath query. + * + * Note that unless withoutNamespaces() was used, every name in a query needs to be namespace-qualified, e.g. + * find("nm:netconf-state/nm:schemas/nm:schema", "nm=urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring") + * + * @param xpath + * @param namespaces Namespace definitions in the form of "prefix=URI" + * @return + */ + public Stream find(String xpath, String... namespaces) { + return nodeListToElementStream(select(XPathConstants.NODESET, xpath, namespaces).map(NodeList.class::cast).get()); + } + + /** + * Create a (one-time) iterable stream of all child nodes satisfying an XPath query. + * + * Note that unless withoutNamespaces() was used, every name in a query needs to be namespace-qualified, e.g. + * select("nm:netconf-state/nm:schemas/nm:schema", "nm=urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring") + * + * @param xpath + * @param namespaces Namespace definitions in the form of "prefix=URI" + * @return + */ + public Iterable select(String xpath, String... namespaces) { + return find(xpath, namespaces)::iterator; + } + + /** + * Select a single child node using XPath. + * + * Note that unless withoutNamespaces() was used, every name in a query needs to be namespace-qualified, e.g. + * select("nm:netconf-state/nm:schemas/nm:schema", "nm=urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring") + * + * @param xpath + * @param namespaces Namespace definitions in the form of "prefix=URI" + * @return + */ + public Optional selectElement(String xpath, String... namespaces) { + return select(XPathConstants.NODE, xpath, namespaces).map(Element.class::cast).map(XMLElement::new); + } + + /** + * Select a single string value using XPath. + * + * Note that unless withoutNamespaces() was used, every name in a query needs to be namespace-qualified, e.g. + * select("nm:netconf-state/nm:schemas/nm:schema", "nm=urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring") + * + * @param xpath + * @param namespaces Namespace definitions in the form of "prefix=URI" + * @return + */ + public Optional selectString(String xpath, String... namespaces) { + return select(XPathConstants.STRING, xpath, namespaces).map(String.class::cast); + } + + /** + * Select a single numeric value using XPath. + * + * Note that unless withoutNamespaces() was used, every name in a query needs to be namespace-qualified, e.g. + * select("nm:netconf-state/nm:schemas/nm:schema", "nm=urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring") + * + * @param xpath + * @param namespaces Namespace definitions in the form of "prefix=URI" + * @return + */ + public Optional selectNumber(String xpath, String... namespaces) { + return select(XPathConstants.NUMBER, xpath, namespaces).map(Number.class::cast); + } + + /** + * Get the local name of the element + * @return + */ + public String getName() { + return element.getLocalName(); + } + + /** + * Get the namespace of the element (if any) + * @return + */ + public String getNamespace() { + return element.getNamespaceURI(); + } + + /** + * Get the text content of the element. + * @return + */ + public String getText() { + return element.getTextContent(); + } + + /** + * Get the text content of the first immediate child element with the given name. + * @param namespace + * @param name + * @return + */ + public String getText(String namespace, String name) { + return getFirst(namespace, name).map(XMLElement::getText).orElse(""); + } + + /** + * Get the text element of the first immediate child element with the given name. + * @param name + * @return + */ + public String getText(String name) { + return getText(null, name); + } + + /** + * Get the text content of the first immediate child element with the given name. + * @param namespace + * @param name + * @param defaultValue + * @return + */ + public String getTextOrDefault(String namespace, String name, String defaultValue) { + return getFirst(namespace, name).map(XMLElement::getText).orElse(defaultValue); + } + + /** + * Get the text content of the first immediate child element with the given name. + * @param name + * @param defaultValue + * @return + */ + public String getTextOrDefault(String name, String defaultValue) { + return getTextOrDefault(null, name, defaultValue); + } + + /** + * Get the value of an attribute of this element in the same namespace. + * @param namespace + * @param name + * @return + */ + public String getAttribute(String namespace, String name) { + return element.getAttributeNS(namespace != null ? namespace : getNamespace(), name); + } + + /** + * Get the value of an attribute of this element that has the same namespace as this element. + * @param name + * @return + */ + public String getAttribute(String name) { + return getAttribute(null, name); + } + + /** + * Get all attributes of this element belonging to the given namespace. + * @param namespace + * @return + */ + public Map getAttributes(String namespace) { + final String ns = (namespace != null) ? namespace : getNamespace(); + NamedNodeMap attributes = element.getAttributes(); + return IntStream.range(0, attributes.getLength()).mapToObj(attributes::item). + filter(a -> (ns == null || ns.equals(a.getNamespaceURI()))).map(Attr.class::cast). + collect(Collectors.toMap(Attr::getLocalName, Attr::getValue)); + } + + /** + * Get all attributes of this element belonging to the same namespace. + * @return + */ + public Map getAttributes() { + return getAttributes(null); + } + + /** + * Get a stream of all immediate child elements. + * @return + */ + public Stream stream() { + return nodeListToElementStream(element.getChildNodes()); + } + + /** + * Get a stream of all immediate child elements with given name and namespace. + * @param namespace + * @param name + * @return + */ + public Stream stream(String namespace, String name) { + final String ns = (namespace != null) ? namespace : getNamespace(); + return stream().filter(e -> e.getName().equals(name) && + (ns == null || ns.equals(e.getNamespace()))); + } + + /** + * Get a stream of all immediate child elements with given name. + * @param name + * @return + */ + public Stream stream(String name) { + return stream(null, name); + } + + /** + * Get the first immediate child element with the given name. + * @param namespace + * @param name + * @return + */ + public Optional getFirst(String namespace, String name) { + return stream(namespace, name).findFirst(); + } + + /** + * Get the first immediate child element with the given name in the same namespace. + * @param name + * @return + */ + public Optional getFirst(String name) { + return getFirst(null, name); + } + + /** + * Get the first immediate child element with the given name or an empty element + * @param namespace + * @param name + * @return + */ + public XMLElement getOrEmpty(String namespace, String name) { + return stream(namespace, name).findFirst().orElse(new XMLElement(namespace, name)); + } + + /** + * Get the first immediate child element with the given name in the same namespace. + * @param name + * @return + */ + public XMLElement getOrEmpty(String name) { + return getOrEmpty(null, name); + } + + + /** + * Get a (one-time) iterable of all child elements with the given name + * @param namespace + * @param name + * @return + */ + public Iterable getAll(String namespace, String name) { + return stream(namespace, name)::iterator; + } + + /** + * Get a (one-time) iterable of all child elements with the given name in the same namespace as this element. + * @param name + * @return + */ + public Iterable getAll(String name) { + return stream(null, name)::iterator; + } + + /** + * Get the parent element of this element. + * @return + */ + public XMLElement getParent() { + Node node = element.getParentNode(); + return (node instanceof Element) ? new XMLElement((Element)node) : null; + } + + /** + * Get the root element of this element. + * @return + */ + public XMLElement getRoot() { + return new XMLElement(element.getOwnerDocument().getDocumentElement()); + } + + /** + * Create a new element in the same document and return it. + * @param namespace + * @param name + * @return + */ + public XMLElement create(String namespace, String name) { + final String ns = (namespace != null) ? namespace : getNamespace(); + return new XMLElement(element.getOwnerDocument().createElementNS(ns, name)); + } + + /** + * Create a new element in the same document, append it and return it. + * @param namespace + * @param name + * @return + */ + public XMLElement createChild(String namespace, String name) { + XMLElement child = create(namespace, name); + element.appendChild(child.element); + return child; + } + + /** + * Create a new element in the same document and in the same namespace, append it and return it. + * @param name + * @return + */ + public XMLElement createChild(String name) { + return createChild(getNamespace(), name); + } + + /** + * Returns the first element with given name (creating it if it does not exist) + * if a condition is true, otherwise deletes it and returns null. + * + * @param namespace + * @param name + * @param condition + * @return + */ + public Optional setChildIff(String namespace, String name, boolean condition) { + Optional child = getFirst(namespace, name); + if (!condition) { + child.ifPresent(XMLElement::remove); + return Optional.empty(); + } else if (child.isPresent()) { + return child; + } else { + return Optional.of(createChild(namespace, name)); + } + } + + /** + * Returns the first element with given name (creating it if it does not exist). + * + * @param namespace + * @param name + * @return + */ + public XMLElement setChild(String namespace, String name) { + return setChildIff(namespace, name, true).get(); + } + + /** + * Returns the first element with given name (creating it if it does not exist). + * + * @param name + * @return + */ + public XMLElement setChild(String name) { + return setChildIff(name, true).get(); + } + + /** + * Returns the first element with given name (creating it if it does not exist) + * if a condition is true, otherwise deletes it and returns null. + * + * @param name + * @param condition + * @return + */ + public Optional setChildIff(String name, boolean condition) { + return setChildIff(getNamespace(), name, condition); + } + + /** + * Remove the element from its parent element + */ + public void remove() { + if (element.getParentNode() != null) + element.getParentNode().removeChild(element); + } + + /** + * Apply a consumer to the element and return it + */ + public XMLElement with(Consumer consumer) { + consumer.accept(this); + return this; + } + + /** + * Set the text content of this element and return the element. + * @param value + * @return + */ + public XMLElement withText(String value) { + element.setTextContent(value != null ? value : ""); + return this; + } + + /** + * Adds a comment node with given value to this element and return this element + * @param value + * @return + */ + public XMLElement withComment(String value) { + element.appendChild(element.getOwnerDocument().createComment(value)); + return this; + } + + /** + * Append the given element as a child to this one (and adopt it if necessary) and return the parent element. + * @param child + * @return + */ + public XMLElement withChild(XMLElement child) { + element.appendChild(element.getOwnerDocument().adoptNode(child.element)); + return this; + } + + /** + * Append the given elements as children to this one (and adopt it if necessary) and return the parent element. + * @param children + * @return + */ + public XMLElement withChildren(Iterable children) { + children.forEach(this::withChild); + return this; + } + + /** + * Create and append a new child element and return the parent element. + * @param namespace + * @param name + * @return + */ + public XMLElement withChild(String namespace, String name) { + element.appendChild(create(namespace, name).element); + return this; + } + + /** + * Create and append a new child element in the same namespace and return the parent element. + * @param name + * @return + */ + public XMLElement withChild(String name) { + element.appendChild(create(getNamespace(), name).element); + return this; + } + + /** + * Create and append a new child element, apply a function and return the parent element. + * @param namespace + * @param name + * @param consumer + * @return + */ + public XMLElement withChild(String namespace, String name, Consumer consumer) { + consumer.accept(createChild(namespace, name)); + return this; + } + + /** + * Create and append a new child element in the same namespace, apply a function and return the parent element. + * @param name + * @param consumer + * @return + */ + public XMLElement withChild(String name, Consumer consumer) { + return withChild(getNamespace(), name, consumer); + } + + /** + * Create and append a new child element with given text content and return the parent element. + * @param namespace + * @param name + * @param value + * @return + */ + public XMLElement withTextChild(String namespace, String name, String value) { + return withChild(create(namespace, name).withText(value)); + } + + /** + * Create and append a new child element with given text content in the same namespace and return the parent. + * @param name + * @param value + * @return + */ + public XMLElement withTextChild(String name, String value) { + return withTextChild(getNamespace(), name, value); + } + + /** + * Removes the first element with given name (if present) and adds a new text node if the condition is true. + * @param namespace + * @param name + * @param value + * @param condition + * @return + */ + public XMLElement withTextContentIff(String namespace, String name, String value, boolean condition) { + setChildIff(namespace, name, condition).ifPresent(x -> x.withText(value)); + return this; + } + + /** + * Removes the first element with given name (if present) and adds a new text node if the condition is true. + * @param name + * @param value + * @param condition + * @return + */ + public XMLElement withTextContentIff(String name, String value, boolean condition) { + return withTextContentIff(getNamespace(), name, value, condition); + } + + /** + * Removes the first element with given name (if present) and adds a new text node. + * @param namespace + * @param name + * @param value + * @return + */ + public XMLElement withTextContent(String namespace, String name, String value) { + return withTextContentIff(namespace, name, value, true); + } + + /** + * Removes the first element with given name (if present) and adds a new text node. + * @param name + * @param value + * @return + */ + public XMLElement withTextContent(String name, String value) { + return withTextContentIff(name, value, true); + } + + /** + * Set of unset an attribute of this element to a given value. + * @param namespace + * @param name + * @param value + * @return + */ + public XMLElement withAttribute(String namespace, String name, String value) { + final String ns = (namespace != null) ? namespace : getNamespace(); + if (value != null) + element.setAttributeNS(ns, name, value); + else + element.removeAttributeNS(ns, name); + return this; + } + + /** + * Set of unset an attribute of this element in the same namespace as to a given value. + * @param name + * @param value + * @return + */ + public XMLElement withAttribute(String name, String value) { + return withAttribute(getNamespace(), name, value); + } + + /** + * Removes all instances of the child node + * @param namespace + * @param name + */ + public XMLElement withoutChildren(String namespace, String name) { + stream(namespace, name).collect(Collectors.toList()).forEach(XMLElement::remove); + return this; + } + + /** + * Removes all instances of the child node + * @param name + */ + public XMLElement withoutChildren(String name) { + return withoutChildren(getNamespace(), name); + } + + /** + * Strip all namespaces from this element, all child elements and attributes and return this element. + * @return + */ + public XMLElement withoutNamespaces() { + element = (Element)stripNamespaces(element); + return this; + } + + /** + * Write either this element or the whole document to a given stream. + * @param outputStream + * @param wholeDocument + * @throws XMLException + */ + public void writeTo(OutputStream outputStream, boolean wholeDocument) throws XMLException { + try { + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + transformer.transform(new DOMSource(wholeDocument ? element.getOwnerDocument() : element), + new StreamResult(outputStream)); + } catch (TransformerException e) { + throw new XMLException(e); + } + } + + private Node stripNamespaces(Node node) { + Document document = element.getOwnerDocument(); + if (node.getNodeType() == Node.ELEMENT_NODE || node.getNodeType() == Node.ATTRIBUTE_NODE) + node = document.renameNode(node, null, node.getLocalName()); + NodeList list = node.getChildNodes(); + IntStream.range(0, list.getLength()).mapToObj(list::item).forEach(this::stripNamespaces); + return node; + } + + /** + * Get the underlying DOM element wrapped by this XMLElement + * @return + */ + public Element getElement() { + return element; + } + + /** + * Register a namespace prefix for use in XPath calls + * @param prefix + * @param namespace + */ + public static void registerXPathNamespace(String prefix, String namespace) { + xpathNamespaces.put(prefix, namespace); + } + + @Override + public Iterator iterator() { + return stream().iterator(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof XMLElement && element.equals(((XMLElement) obj).element); + } + + @Override + public int hashCode() { + return element.hashCode(); + } + + @Override + public String toString() { + return toXML(); + } + + /** + * Transform this element into a unicode XML string. + * @return XML string + */ + public String toXML() { + try { + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + writeTo(stream, false); + return stream.toString("UTF-8"); + } catch (XMLException | UnsupportedEncodingException e) { + return ""; + } + } + + @Override + public XMLElement clone() { + return new XMLElement((Element)element.cloneNode(true)); + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5e89956 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '2' + +services: + anx: + build: . + ports: + - 9269:8080 diff --git a/explorer/pom.xml b/explorer/pom.xml new file mode 100644 index 0000000..92f8dd8 --- /dev/null +++ b/explorer/pom.xml @@ -0,0 +1,219 @@ + + + 4.0.0 + + com.cisco.stbarth.netconf.anx + explorer + war + 1.0-SNAPSHOT + explorer + + + 3 + + + + 8.3.3 + 8.3.3 + 9.4.6.v20170531 + UTF-8 + 1.8 + 1.8 + + local + + + + + vaadin-addons + http://maven.vaadin.com/vaadin-addons + + + + + + + com.vaadin + vaadin-bom + ${vaadin.version} + pom + import + + + + + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + com.vaadin + vaadin-server + + + com.vaadin + vaadin-push + + + com.vaadin + vaadin-client-compiled + + + com.vaadin + vaadin-themes + + + com.cisco.stbarth.netconf + anc + 0.3-SNAPSHOT + + + com.cisco.stbarth.netconf + xrgrpc + 0.1-SNAPSHOT + + + org.opendaylight.yangtools + yang-parser-impl + 1.1.3-Carbon + + + org.slf4j + slf4j-api + 1.7.25 + + + org.slf4j + slf4j-simple + 1.7.25 + + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.0.0 + + false + + WEB-INF/classes/VAADIN/widgetsets/WEB-INF/** + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.plugin.version} + + + + update-theme + update-widgetset + compile + + compile-theme + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.0.0 + + + + + src/main/webapp/VAADIN/themes + + **/styles.css + **/styles.scss.cache + + + + + + + + + org.eclipse.jetty + jetty-maven-plugin + ${jetty.plugin.version} + + 2 + + + + + + + + + + + vaadin-prerelease + + true + + + + + vaadin-prereleases + http://maven.vaadin.com/vaadin-prereleases + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + vaadin-prereleases + http://maven.vaadin.com/vaadin-prereleases + + + + + + diff --git a/explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainUI.java b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainUI.java new file mode 100644 index 0000000..3308cf3 --- /dev/null +++ b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainUI.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anx; + +import javax.servlet.annotation.WebServlet; + +import com.cisco.stbarth.netconf.anc.NetconfSSHClient; +import com.vaadin.annotations.Push; +import com.vaadin.annotations.Theme; +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.server.Page; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.ui.themes.ValoTheme; + +import java.util.Collection; + +/** + * This MainUI is the application entry point. A MainUI may either represent a browser window + * (or tab) or some part of a html page where a Vaadin application is embedded. + *

+ * The MainUI is initialized using {@link #init(VaadinRequest)}. This method is intended to be + * overridden to add component to the user interface and initialize non-component functionality. + */ + +@Theme("adtportal") +@Push +public class MainUI extends com.vaadin.ui.UI { + String name; + String username; + String password; + NetconfSSHClient client; + YangParser parser; + Collection capabilities; + + @Override + protected void init(VaadinRequest vaadinRequest) { + Page.getCurrent().setTitle("ANX"); + addStyleName(ValoTheme.UI_WITH_MENU); + showMain(); + } + + public void showMain() { + // Show main view or login view depending on state + if (client != null) { + setSizeFull(); + getPage().setTitle("ANX: ".concat(name)); + setContent(new MainView(name, username, password, client, parser, capabilities)); + removeStyleName("loginview"); + addStyleName("mainview"); + } else { + setContent(new RetrieverView(this)); + addStyleName("loginview"); + } + } + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = MainUI.class, productionMode = true) + public static class MyUIServlet extends VaadinServlet { + } +} diff --git a/explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainView.java b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainView.java new file mode 100644 index 0000000..65fae03 --- /dev/null +++ b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainView.java @@ -0,0 +1,613 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anx; + +import com.cisco.stbarth.netconf.anc.*; +import com.vaadin.data.TreeData; +import com.vaadin.data.provider.TreeDataProvider; +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.icons.VaadinIcons; +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewBeforeLeaveEvent; +import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; +import com.vaadin.server.FileDownloader; +import com.vaadin.server.Page; +import com.vaadin.server.StreamResource; +import com.vaadin.server.ThemeResource; +import com.vaadin.shared.ui.grid.HeightMode; +import com.vaadin.ui.*; +import com.vaadin.ui.Notification; +import com.vaadin.ui.themes.ValoTheme; +import org.opendaylight.yangtools.yang.model.api.*; +import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * Main view showing schema and data tree + */ +@SuppressWarnings("serial") +public final class MainView extends VerticalLayout implements View { + private VerticalLayout sidebarPanel; + private Tree schemaTree; + private Tree dataTree; + private Collection capabilities; + private XMLElement dataElements = new XMLElement(null, "data"); + private String dataQuery; + String host; + String username; + String password; + NetconfClient client; + YangParser parser; + WrappedYangNode selectedNode; + XMLElement selectedData; + + public MainView(String host, String username, String password, + NetconfClient client, YangParser parser, Collection capabilities) { + this.host = host; + this.username = username; + this.password = password; + this.client = client; + this.parser = parser; + this.capabilities = capabilities; + + setSizeFull(); + setMargin(false); + + // Build topbar + Label title = new Label("ANX Netconf Explorer"); + title.addStyleName("topbartitle"); + title.setSizeUndefined(); + + Label padding = new Label(); + + Label connected = new Label(String.format("Device %s (%d YANG models)", + host, parser.getSchemaContext().getModules().size())); + + Button disconnectButton = new Button(VaadinIcons.SIGN_OUT); + disconnectButton.setPrimaryStyleName(ValoTheme.BUTTON_BORDERLESS); + disconnectButton.addClickListener(x -> { + try { + client.close(); + } catch (Exception e) {} + Page.getCurrent().reload(); + }); + + HorizontalLayout topbar = new HorizontalLayout(); + topbar.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); + topbar.addComponents(title, padding, connected, disconnectButton); + topbar.setExpandRatio(padding, 1.0f); + topbar.setWidth("100%"); + topbar.setMargin(true); + topbar.addStyleName("topbar"); + addComponent(topbar); + + // Define main layout: sidebar + content + HorizontalLayout mainLayout = new HorizontalLayout(); + mainLayout.setSizeFull(); + mainLayout.setMargin(false); + addComponent(mainLayout); + setExpandRatio(mainLayout, 1.0f); + + // Define static part of sidebar, this will always be visible + VerticalLayout sidebar = new VerticalLayout(); + sidebar.addStyleName(ValoTheme.MENU_PART); + sidebar.addStyleName("no-vertical-drag-hints"); + sidebar.addStyleName("no-horizontal-drag-hints"); + mainLayout.addComponent(new Panel(sidebar)); + + HorizontalLayout buttonLayout = new HorizontalLayout(); + Button homeButton = new Button("Start", VaadinIcons.HOME); + homeButton.addClickListener(x -> showHomeScreen()); + buttonLayout.addComponent(homeButton); + + try { + buttonLayout.addComponent(new NetconfTools(this).createComponent()); + } catch (NetconfException e) { + Notification.show(e.getMessage(), Notification.Type.ERROR_MESSAGE); + } + sidebar.addComponent(buttonLayout); + + HorizontalLayout downloadTools = new HorizontalLayout(); + downloadTools.setDefaultComponentAlignment(Alignment.BOTTOM_CENTER); + + ComboBox modelSelect = new ComboBox<>("YANG Models"); + modelSelect.setWidth("400px"); + modelSelect.setIcon(VaadinIcons.DOWNLOAD); + modelSelect.setItemCaptionGenerator(x -> x.getIdentifier().toYangFilename()); + modelSelect.setItems(parser.getSources().stream().sorted((a, b) -> + a.getIdentifier().toYangFilename().compareTo(b.getIdentifier().toYangFilename()))); + modelSelect.setEmptySelectionAllowed(false); + modelSelect.setTextInputAllowed(true); + + Button viewButton = new Button("View", VaadinIcons.FILE_CODE); + viewButton.setEnabled(false); + viewButton.addClickListener(x -> { + Window yangWindow = new Window("YANG Model " + .concat(modelSelect.getValue().getIdentifier().toYangFilename())); + yangWindow.setModal(true); + yangWindow.setDraggable(true); + yangWindow.setResizable(false); + yangWindow.setWidth("1000px"); + yangWindow.setHeight("700px"); + + try { + ByteArrayOutputStream yangStream = new ByteArrayOutputStream(); + modelSelect.getValue().copyTo(yangStream); + + TextArea yangText = new TextArea(); + yangText.setReadOnly(true); + yangText.setSizeFull(); + yangText.setValue(new String(yangStream.toByteArray(), StandardCharsets.UTF_8)); + + VerticalLayout yangLayout = new VerticalLayout(yangText); + yangLayout.setSizeFull(); + + yangWindow.setContent(yangLayout); + UI.getCurrent().addWindow(yangWindow); + } catch (Exception e) { + e.printStackTrace(); + } + }); + modelSelect.addValueChangeListener(x -> viewButton.setEnabled(x.getValue() != null)); + + Button downloadButton = new Button("Download all", VaadinIcons.FILE_ZIP); + new FileDownloader(new StreamResource(() -> { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zipStream = new ZipOutputStream(outputStream); + zipStream.setLevel(9); + + parser.getSources().forEach(source -> { + try { + zipStream.putNextEntry(new ZipEntry(source.getIdentifier().toYangFilename())); + source.copyTo(zipStream); + zipStream.closeEntry(); + } catch (IOException e) {} + }); + + try { + zipStream.close(); + } catch (IOException e) {}; + + return new ByteArrayInputStream(outputStream.toByteArray()); + }, "yang-models-" + host + ".zip")).extend(downloadButton); + downloadTools.addComponents(modelSelect, viewButton, downloadButton); + sidebar.addComponent(downloadTools); + + sidebar.addComponent(new TelemetryTools(this).createComponent()); + + sidebarPanel = new VerticalLayout(); + sidebarPanel.setMargin(false); + sidebar.addComponent(sidebarPanel); + sidebar.setExpandRatio(sidebarPanel, 1.0f); + + showHomeScreen(); + + // Define content (right-hand side) + VerticalLayout contentLayout = new VerticalLayout(); + contentLayout.setSizeFull(); + + Panel contentPanel = new Panel(contentLayout); + contentPanel.setSizeFull(); + mainLayout.addComponent(contentPanel); + + // Button and filter layout + HorizontalLayout schemaFilterLayout = new HorizontalLayout(); + schemaFilterLayout.setDefaultComponentAlignment(Alignment.BOTTOM_CENTER); + + TextField schemaModuleFilter = new TextField("Search models"); + schemaModuleFilter.setWidth("150px"); + schemaModuleFilter.focus(); + schemaFilterLayout.addComponent(schemaModuleFilter); + + TextField schemaNodeFilter = new TextField("Search nodes"); + schemaNodeFilter.setWidth("150px"); + schemaFilterLayout.addComponent(schemaNodeFilter); + + Button schemaFilterApply = new Button("Apply", VaadinIcons.SEARCH); + schemaFilterApply.setClickShortcut(KeyCode.ENTER); + schemaFilterLayout.addComponent(schemaFilterApply); + + Button schemaFilterClear = new Button("Clear", VaadinIcons.ERASER); + schemaFilterLayout.addComponent(schemaFilterClear); + + Button showData = new Button("Show Data", VaadinIcons.DATABASE); + schemaFilterLayout.addComponent(showData); + contentLayout.addComponent(schemaFilterLayout); + + HorizontalLayout dataFilterLayout = new HorizontalLayout(); + dataFilterLayout.setDefaultComponentAlignment(Alignment.BOTTOM_CENTER); + dataFilterLayout.setVisible(false); + + TextField dataNodeFilter = new TextField("Search nodes"); + dataNodeFilter.setWidth("150px"); + dataNodeFilter.focus(); + dataFilterLayout.addComponent(dataNodeFilter); + + TextField dataValueFilter = new TextField("Search values"); + dataValueFilter.setWidth("150px"); + dataFilterLayout.addComponent(dataValueFilter); + + Button dataFilterApply = new Button("Apply", VaadinIcons.SEARCH); + dataFilterApply.setClickShortcut(KeyCode.ENTER); + dataFilterLayout.addComponent(dataFilterApply); + dataFilterLayout.setComponentAlignment(dataFilterApply, Alignment.BOTTOM_CENTER); + + Button dataFilterClear = new Button("Clear", VaadinIcons.ERASER); + dataFilterLayout.addComponent(dataFilterClear); + dataFilterLayout.setComponentAlignment(dataFilterClear, Alignment.BOTTOM_CENTER); + + Button showSchemas = new Button("Show Schemas", VaadinIcons.FILE_TREE); + dataFilterLayout.addComponent(showSchemas); + dataFilterLayout.setComponentAlignment(showSchemas, Alignment.BOTTOM_CENTER); + contentLayout.addComponent(dataFilterLayout); + + // Data or schema tree definition + Panel treePanel = new Panel(); + treePanel.setHeight("100%"); + contentLayout.addComponent(treePanel); + contentLayout.setExpandRatio(treePanel, 1.0f); + + schemaFilterApply.addClickListener(e -> treePanel.setContent( + showSchemaTree(schemaModuleFilter.getValue(), schemaNodeFilter.getValue(), showData))); + + dataFilterApply.addClickListener(e -> treePanel.setContent( + showDataTree(dataNodeFilter.getValue(), dataValueFilter.getValue()))); + + schemaFilterClear.addClickListener(e -> { + schemaModuleFilter.clear(); + schemaModuleFilter.focus(); + schemaNodeFilter.clear(); + schemaFilterApply.click(); + }); + + dataFilterClear.addClickListener(e -> { + dataNodeFilter.clear(); + dataNodeFilter.focus(); + dataValueFilter.clear(); + dataFilterApply.click(); + }); + + showData.addClickListener(x -> { + schemaFilterLayout.setVisible(false); + dataFilterLayout.setVisible(true); + dataFilterClear.click(); + }); + + showSchemas.addClickListener(x -> { + schemaFilterLayout.setVisible(true); + dataFilterLayout.setVisible(false); + treePanel.setContent(schemaTree); + selectedData = null; + }); + + treePanel.setContent(showSchemaTree("", "", showData)); + } + + // Show the schema tree based on the current collected YANG models + private Tree showSchemaTree(String moduleFilter, String fieldFilter, Button showData) { + List moduleQuery = Arrays.asList(moduleFilter.toLowerCase().split(" ")); + List fieldQuery = Arrays.asList(fieldFilter.toLowerCase().split(" ")); + + schemaTree = new Tree<>(); + schemaTree.setSelectionMode(Grid.SelectionMode.MULTI); + schemaTree.setItemCaptionGenerator(WrappedYangNode::getCaption); + schemaTree.setItemIconGenerator(x -> x.isKey() ? VaadinIcons.KEY : null); + schemaTree.addItemClickListener(x -> showYangNode(x.getItem())); + + // Iterate YANG models, apply filters and add matching schema nodes + TreeData data = new TreeData<>(); + for (Module module: parser.getSchemaContext().getModules()) { + String name = module.getName().toLowerCase(); + String description = Optional.ofNullable(module.getDescription()).orElse("").toLowerCase(); + if (moduleQuery.stream().filter(name::contains).count() == moduleQuery.size() || + moduleQuery.stream().filter(description::contains).count() == moduleQuery.size()) + new WrappedYangNode(module).addToTree(data, fieldQuery); + } + + // Define data provide and ordering of YANG nodes and render on tree widget + TreeDataProvider dataProvider = new TreeDataProvider<>(data); + dataProvider.setSortComparator(Comparator.comparing(WrappedYangNode::isNotKey) + .thenComparing(WrappedYangNode::getName)::compare); + schemaTree.setDataProvider(dataProvider); + + // Expand the first 50 direct filter matches automatically + int remain = 50; + for (WrappedYangNode module: data.getRootItems()) + remain = module.applyExpand(schemaTree, remain); + + if (remain <= 0) + Notification.show("Too many search results! They are all shown, but only 50 have been auto-expanded.", + Notification.Type.TRAY_NOTIFICATION); + + return schemaTree; + } + + // Show a tree of live data from the device + private Tree showDataTree(String moduleFilter, String fieldFilter) { + List moduleQuery = Arrays.asList(moduleFilter.toLowerCase().split(" ")); + List fieldQuery = Arrays.asList(fieldFilter.toLowerCase().split(" ")); + + dataTree = new Tree<>(); + // Show name of the node/leaf and value (if available) + dataTree.setItemCaptionGenerator(x -> x.getName().concat(x.stream().count() > 0 ? "" : (" = " + x.getText()))); + dataTree.addItemClickListener(x -> { + // Build (X)Path of selected element and find namespace + + String path = ""; + String namespace = ""; + for (XMLElement element = x.getItem(); element != null; element = element.getParent()) { + path = "/" + element.getName() + path; + namespace = element.getNamespace(); + + if (element.getAttribute("root").equals("1")) + break; + } + path = path.substring(1); + selectedData = x.getItem(); + + // Iterate YANG schemas to find the schema node associated with the data + for (Module module: parser.getSchemaContext().getModules()) + if (module.getNamespace().toString().equals(namespace)) + WrappedYangNode.byPath(new WrappedYangNode(module), path).ifPresent(this::showYangNode); + }); + + // Get selected schema elements and build a NETCONF combined subtree-filter to retrieve all of them with a single get-call + LinkedList subtreeFilter = new LinkedList<>(); + Set items = schemaTree.getSelectedItems(); + for (WrappedYangNode item: items) { + boolean unique = true; + + for (WrappedYangNode c = item.getParent(); unique && c != null; c = c.getParent()) + if (items.contains(c)) + unique = false; + + // Only add new subtree filter if we don't have it or any parent element selected already + if (unique) { + item.createNetconfTemplate().map(Stream::of).orElse(item.getChildren() + .map(WrappedYangNode::createNetconfTemplate).filter(Optional::isPresent).map(Optional::get)) + .forEach(subtreeFilter::add); + } + } + + // Cache retrieved config data if selected fields are the same and just filters change + String newQuery = subtreeFilter.stream().map(XMLElement::toXML).collect(Collectors.joining()); + if (!newQuery.equals(dataQuery)) { + try (NetconfSession session = client.createSession()) { + // Query peer using NETCONF to retrieve current data using get or get-config + if (subtreeFilter.isEmpty()) { + try { + dataElements = session.get(); + } catch (NetconfException.RPCException e) { + Notification.show("The device cowardly refused to send all operational data at once, thus " + + "displaying configuration only. To view operational data, use 'Show Schemas' to go back, " + + "select desired schemas and use 'Show Data' again.", Notification.Type.ERROR_MESSAGE); + dataElements = session.getConfig(Netconf.Datastore.RUNNING); + } + } else { + dataElements = session.get(subtreeFilter); + } + dataQuery = newQuery; + } catch (NetconfException e) { + Notification.show("Failed to get data: " + e.getMessage(), Notification.Type.ERROR_MESSAGE); + } + } + + // Collect NETCONF data for tree display + TreeData data = new TreeData<>(); + for (XMLElement element: dataElements) + addXMLToTree(data, element, null, moduleQuery, fieldQuery); + + // Create data provider for tree and define sorting order + TreeDataProvider dataProvider = new TreeDataProvider<>(data); + dataProvider.setSortComparator(Comparator.comparing(XMLElement::getName)::compare); + dataTree.setDataProvider(dataProvider); + + int remain = 50; + + // Expand up to 50 direct filter matches from data tree + if (moduleFilter.isEmpty() && fieldFilter.isEmpty()) { + for (WrappedYangNode node : schemaTree.getSelectedItems()) { + String path = node.getSensorPath(); + List paths = Arrays.asList(path.substring(path.indexOf(':') + 1).split("/")); + remain = expandXMLSelected(dataTree, data.getRootItems(), paths, remain); + } + } + + for (XMLElement element: data.getRootItems()) + remain = applyXMLExpanded(dataTree, element, remain); + + if (remain <= 0) + Notification.show("Too many results! They are all shown, but only 50 have been auto-expanded.", + Notification.Type.TRAY_NOTIFICATION); + + return dataTree; + } + + // Transform XML data to a Vaadin treedata object + private static boolean addXMLToTree(TreeData data, XMLElement element, XMLElement parent, + Collection nodeQuery, Collection valueQuery) { + String name = element.getName().toLowerCase(); + boolean nodeOkay = nodeQuery.stream().filter(name::contains).count() == nodeQuery.size(); + boolean valueOkay = valueQuery.isEmpty(); + boolean okay = false; + + // Add element to tree + data.addItem(parent, element); + + // Add dummy XML attributes to mark expansion of nodes based on filters + if (parent == null) + element.withAttribute("root", "1"); + else if (!nodeQuery.isEmpty() || !valueQuery.isEmpty()) + parent.withAttribute("expand", "1"); + + // Once we have a match for node filter, we want all children to be visible, so clear node filter when recursing + if (nodeOkay && !nodeQuery.isEmpty()) + nodeQuery = Collections.emptyList(); + + // For value filter expand child nodes with matching terms + for (XMLElement child: element) { + String childText = child.stream().findAny().isPresent() ? null : child.getText().toLowerCase(); + if (childText != null && !valueQuery.isEmpty() && + valueQuery.stream().filter(childText::contains).count() == valueQuery.size()) { + element.withAttribute("expand", "1"); + valueQuery = Collections.emptyList(); + break; + } + } + + // Recurse for each child + for (XMLElement child: element) + if (addXMLToTree(data, child, element, nodeQuery, valueQuery)) + okay = true; + + okay = okay || (valueOkay && nodeOkay); + + // If we are filtered by node or value filter and none of our children are visible, remove ourselve + if (!okay) + data.removeItem(element); + + return okay; + } + + // Recursively apply element expansion to a tree based on meta-attributes set by addXMLToTree + private static int applyXMLExpanded(Tree tree, XMLElement element, int limit) { + if (element.getAttribute("expand").equals("1") && limit > 0) { + int limitBefore = limit; + tree.expand(element); + + for (XMLElement child: tree.getTreeData().getChildren(element)) + limit = applyXMLExpanded(tree, child, limit); + + if (limit == limitBefore) + --limit; + } + return limit; + } + + // Apply YANG schema filters to data tree + private static int expandXMLSelected(Tree tree, Iterable elements, List path, int limit) { + if (path.size() < 1 || limit < 1) + return limit; + + path = new LinkedList<>(path); + String hop = path.remove(0); + for (XMLElement element: elements) { + int limitBefore = limit; + if (element.getName().equals(hop)) { + tree.expand(element); + limit = expandXMLSelected(tree, tree.getTreeData().getChildren(element), new LinkedList<>(path), limit); + } + if (limit == limitBefore) + --limit; + } + return limit; + } + + // Render home view + private void showHomeScreen() { + sidebarPanel.removeAllComponents(); + + VerticalLayout capabilityLayout = new VerticalLayout(); + for (String capability: capabilities) + capabilityLayout.addComponent(new Label(capability)); + Panel capabilityPanel = new Panel("Capabilities", capabilityLayout); + capabilityPanel.setHeight(200, Unit.PIXELS); + sidebarPanel.addComponent(capabilityPanel); + + VerticalLayout warningLayout = new VerticalLayout(); + for (String warning: parser.getWarnings()) { + Label warningLabel = new Label(warning); + warningLabel.addStyleName(ValoTheme.LABEL_FAILURE); + warningLayout.addComponent(warningLabel); + } + Panel warningPanel = new Panel("Failed YANG models", warningLayout); + warningPanel.setHeight(200, Unit.PIXELS); + sidebarPanel.addComponent(warningPanel); + } + + // Show detail table for a selected YANG schema node + void showYangNode(WrappedYangNode node) { + selectedNode = node; + sidebarPanel.removeAllComponents(); + + LinkedList> parameters = new LinkedList<>(); + parameters.add(new AbstractMap.SimpleEntry<>("Name", node.getName())); + parameters.add(new AbstractMap.SimpleEntry<>("Namespace", node.getNamespace())); + parameters.add(new AbstractMap.SimpleEntry<>("Type", node.getType() + " (" + + (node.isConfiguration() ? "configuration" : "operational") + ")")); + + String type = node.getDataType(); + if (!type.isEmpty()) + parameters.add(new AbstractMap.SimpleEntry<>("Data Type", type)); + + String keys = node.getKeys().collect(Collectors.joining(" ")); + if (!keys.isEmpty()) + parameters.add(new AbstractMap.SimpleEntry<>("Keys", keys)); + + parameters.add(new AbstractMap.SimpleEntry<>("XPath", node.getXPath())); + parameters.add(new AbstractMap.SimpleEntry<>("Telemetry Path", node.getSensorPath())); + parameters.add(new AbstractMap.SimpleEntry<>("Maagic Path", node.getMaagic(false))); + parameters.add(new AbstractMap.SimpleEntry<>("Maagic QPath", node.getMaagic(true))); + + Grid> parameterGrid = new Grid<>("Parameters"); + parameterGrid.addColumn(AbstractMap.SimpleEntry::getKey).setCaption("Name"); + parameterGrid.addColumn(AbstractMap.SimpleEntry::getValue).setCaption("Value"); + parameterGrid.setItems(parameters); + parameterGrid.setHeightMode(HeightMode.UNDEFINED); + parameterGrid.setWidth("100%"); + sidebarPanel.addComponent(parameterGrid); + + TextArea descriptionLabel = new TextArea("Description"); + descriptionLabel.setValue(node.getDescription()); + descriptionLabel.setReadOnly(true); + descriptionLabel.setWidth("100%"); + descriptionLabel.setRows(2); + sidebarPanel.addComponent(descriptionLabel); + + TextArea subtreeFilter = new TextArea("Subtree Filter"); + node.createNetconfTemplate().map(XMLElement::toString).ifPresent(subtreeFilter::setValue); + subtreeFilter.setReadOnly(true); + subtreeFilter.setWidth("100%"); + subtreeFilter.setRows(3); + sidebarPanel.addComponent(subtreeFilter); + } + + @Override + public void enter(ViewChangeEvent event) { + + } + + @Override + public void beforeLeave(ViewBeforeLeaveEvent event) { + try { + client.close(); + } catch (NetconfException e) { + e.printStackTrace(); + } + } +} diff --git a/explorer/src/main/java/com/cisco/stbarth/netconf/anx/NetconfTools.java b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/NetconfTools.java new file mode 100644 index 0000000..9798f2a --- /dev/null +++ b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/NetconfTools.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anx; + +import com.cisco.stbarth.netconf.anc.Netconf; +import com.cisco.stbarth.netconf.anc.NetconfException; +import com.cisco.stbarth.netconf.anc.NetconfSession; +import com.cisco.stbarth.netconf.anc.XMLElement; +import com.vaadin.icons.VaadinIcons; +import com.vaadin.ui.*; + +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * NETCONF console utilities to run manual netconf commands + */ +public class NetconfTools { + private MainView view; + + NetconfTools(MainView view) throws NetconfException { + this.view = view; + } + + Component createComponent() { + HorizontalLayout netconfTools = new HorizontalLayout(); + netconfTools.setSizeUndefined(); + netconfTools.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); + + Button getCommand = new Button("NETCONF console", VaadinIcons.TOOLS); + getCommand.addClickListener(x -> showWindow()); + netconfTools.addComponent(getCommand); + return netconfTools; + } + + void showWindow() { + Window window = new Window("NETCONF console"); + window.setModal(true); + window.setWidth("1000px"); + window.setHeight("700px"); + + VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + layout.setSizeFull(); + + HorizontalLayout buttonLayout = new HorizontalLayout(); + Label prepareLabel = new Label("Prepare: "); + buttonLayout.addComponent(prepareLabel); + buttonLayout.setComponentAlignment(prepareLabel, Alignment.MIDDLE_LEFT); + Button prepareGet = new Button("", VaadinIcons.ARROW_CIRCLE_DOWN); + buttonLayout.addComponent(prepareGet); + Button prepareEdit = new Button(" (Merge)", VaadinIcons.EDIT); + buttonLayout.addComponent(prepareEdit); + Button prepareDelete = new Button(" (Delete)", VaadinIcons.FILE_REMOVE); + buttonLayout.addComponent(prepareDelete); + Button prepareCommit = new Button("", VaadinIcons.CHECK_CIRCLE); + buttonLayout.addComponent(prepareCommit); + layout.addComponent(buttonLayout); + + TextArea requestArea = new TextArea(); + requestArea.setSizeFull(); + layout.addComponent(requestArea); + layout.setExpandRatio(requestArea, 1.0f); + + HorizontalLayout submitLayout = new HorizontalLayout(); + Button submit = new Button("Send Request", VaadinIcons.ARROW_FORWARD); + submitLayout.addComponent(submit); + layout.addComponent(submitLayout); + + TextArea responseArea = new TextArea(); + responseArea.setSizeFull(); + layout.addComponent(responseArea); + layout.setExpandRatio(responseArea, 1.0f); + + requestArea.addValueChangeListener(x -> responseArea.clear()); + + submit.addClickListener(x -> { + try (NetconfSession session = view.client.createSession()) { + responseArea.setValue(session.call(new XMLElement(requestArea.getValue())).stream() + .map(XMLElement::toString).collect(Collectors.joining("\n"))); + } catch (NetconfException.RPCException e) { + responseArea.setValue(e.getRPCReply().stream() + .map(XMLElement::toString).collect(Collectors.joining("\n"))); + } catch (Exception e) { + Notification.show(e.getMessage(), Notification.Type.ERROR_MESSAGE); + } + }); + + prepareGet.addClickListener(x -> requestArea.setValue( + new XMLElement(Netconf.NS_NETCONF, "get", r -> Optional.ofNullable(view.selectedNode) + .flatMap(node -> node.createNetconfTemplate(null, view.selectedData)) + .ifPresent(r.createChild("filter")::withChild)).toString())); + + prepareEdit.addClickListener(x -> { + XMLElement pattern = new XMLElement(Netconf.NS_NETCONF, "edit-config"); + pattern.createChild("target").withChild("candidate"); + Optional.ofNullable(view.selectedNode).flatMap(n -> n.createNetconfTemplate("", view.selectedData)) + .ifPresent(f -> pattern.createChild("config").withChild(f)); + requestArea.setValue(pattern.toString()); + }); + + prepareDelete.addClickListener(x -> { + XMLElement pattern = new XMLElement(Netconf.NS_NETCONF, "edit-config"); + pattern.createChild("target").withChild("candidate"); + pattern.withTextChild("default-operation", "none"); + Optional.ofNullable(view.selectedNode).flatMap(n -> n.createNetconfTemplate("delete", view.selectedData)) + .ifPresent(f -> pattern.createChild("config").withChild(f)); + requestArea.setValue(pattern.toString()); + }); + + prepareCommit.addClickListener(x -> requestArea.setValue( + new XMLElement(Netconf.NS_NETCONF, "commit").toString())); + + window.setContent(layout); + UI.getCurrent().addWindow(window); + } +} diff --git a/explorer/src/main/java/com/cisco/stbarth/netconf/anx/RetrieverView.java b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/RetrieverView.java new file mode 100644 index 0000000..0417264 --- /dev/null +++ b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/RetrieverView.java @@ -0,0 +1,226 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anx; + +import com.cisco.stbarth.netconf.anc.*; +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.icons.VaadinIcons; +import com.vaadin.server.Responsive; +import com.vaadin.server.ThemeResource; +import com.vaadin.ui.*; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.themes.ValoTheme; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * View for logging in, retrieving and parsing YANG models + */ +@SuppressWarnings("serial") +public class RetrieverView extends VerticalLayout { + + public RetrieverView(MainUI ui) { + setSizeFull(); + + // Render login form + final VerticalLayout loginPanel = new VerticalLayout(); + loginPanel.addStyleName("v-login"); + loginPanel.setSizeUndefined(); + Responsive.makeResponsive(loginPanel); + + HorizontalLayout logo = new HorizontalLayout(); + logo.setSpacing(true); + + loginPanel.addComponent(logo); + + Label welcome = new Label("ANX Netconf Explorer"); + welcome.addStyleName("welcome"); + welcome.addStyleName(ValoTheme.LABEL_H1); + + VerticalLayout labels = new VerticalLayout(welcome); + labels.setComponentAlignment(welcome, Alignment.MIDDLE_CENTER); + loginPanel.addComponent(labels); + + Label subtitle = new Label("YANG model and data explorer for NETCONF devices"); + subtitle.setSizeUndefined(); + subtitle.addStyleName(ValoTheme.LABEL_H4); + subtitle.addStyleName(ValoTheme.LABEL_COLORED); + loginPanel.addComponent(subtitle); + + HorizontalLayout fields = new HorizontalLayout(); + fields.setSpacing(true); + fields.addStyleName("fields"); + + final Button connect = new Button("Login"); + connect.addStyleName(ValoTheme.BUTTON_PRIMARY); + connect.setClickShortcut(KeyCode.ENTER); + connect.setEnabled(false); + + final TextField hostname = new TextField("NETCONF Device"); + hostname.setIcon(VaadinIcons.SERVER); + hostname.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); + hostname.addStyleName("darkicon"); + hostname.focus(); + hostname.addValueChangeListener((e) -> connect.setEnabled(!hostname.getValue().isEmpty())); + + final TextField username = new TextField("Username"); + username.setIcon(VaadinIcons.USER); + username.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); + username.addStyleName("darkicon"); + + final PasswordField password = new PasswordField("Password"); + password.setIcon(VaadinIcons.LOCK); + password.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); + password.addStyleName("darkicon"); + + fields.addComponents(hostname, username, password, connect); + fields.setComponentAlignment(connect, Alignment.BOTTOM_LEFT); + + // Connect to device and retrieve YANG models + connect.addClickListener((ClickListener) event -> { + ui.name = ""; + ui.username = username.getValue(); + ui.password = password.getValue(); + int port = 22; + + try { + URI uri = new URI("http://" + hostname.getValue()); + if (uri.getHost() != null) + ui.name = uri.getHost(); + + if (uri.getPort() > 0) + port = uri.getPort(); + } catch (Exception f) { + + } + + ui.client = new NetconfSSHClient(ui.name, port, username.getValue()); + ui.client.setPassword(password.getValue()); + ui.client.setStrictHostKeyChecking(false); + ui.client.setTimeout(3600000); + ui.client.setKeepalive(15000); + + // Render login window + Window loadingWindow = new Window(); + loadingWindow.setModal(true); + loadingWindow.setResizable(false); + loadingWindow.setClosable(false); + loadingWindow.setDraggable(false); + loadingWindow.setWidth("900px"); + loadingWindow.setHeight("75px"); + + HorizontalLayout layout = new HorizontalLayout(); + layout.setMargin(true); + layout.setSizeFull(); + + ProgressBar progressBar = new ProgressBar(); + progressBar.setIndeterminate(true); + progressBar.setWidth("150px"); + Label label = new Label("Connecting..."); + label.addStyleName(ValoTheme.LABEL_BOLD); + layout.addComponents(progressBar, label); + layout.setComponentAlignment(progressBar, Alignment.MIDDLE_LEFT); + layout.setComponentAlignment(label, Alignment.MIDDLE_LEFT); + layout.setExpandRatio(label, 1.0f); + + loadingWindow.setContent(layout); + ui.addWindow(loadingWindow); + ui.push(); + + ui.parser = new YangParser(); + + try (NetconfSession session = ui.client.createSession()) { + // Use NETCONF monitoring to query available schemas for retriving from device + Collection query = Arrays.asList( + new XMLElement(Netconf.NS_NETCONF_MONITORING, "netconf-state").withChild("schemas")); + + float schemasProcessed = 0; + progressBar.setIndeterminate(false); + + ui.capabilities = session.getCapabilities().entrySet().stream() + .map(x -> x.getKey().concat(x.getValue())).sorted().collect(Collectors.toList()); + + Map schemas = new HashMap<>(); + session.get(query).withoutNamespaces() + .find("netconf-state/schemas/schema[format = 'yang']") + .forEach(x -> schemas.put(x.getText("identifier"), x.getText("version"))); + + // Workaround for NCS, it is not exporting some essential models so we provide those manually + if (schemas.containsKey("tailf-ncs-common") && !schemas.containsKey("tailf-common")) { + ClassLoader classLoader = this.getClass().getClassLoader(); + ui.parser.registerSource("tailf-common", "2017-08-23", + classLoader.getResource("tailf-common.yang")); + ui.parser.registerSource("tailf-meta-extensions", "2017-03-08", + classLoader.getResource("tailf-meta-extensions.yang")); + ui.parser.registerSource("tailf-cli-extensions", "2017-08-23", + classLoader.getResource("tailf-cli-extensions.yang")); + } + + // Iterate available YANG models, retrieve them using get-schema and add them to the ODL yangtools parser + for (Map.Entry entry : schemas.entrySet()) { + String identifier = entry.getKey(); + String version = entry.getValue(); + label.setValue(String.format("Retrieving schema %s@%s...", identifier, version)); + ui.push(); + + try { + ui.parser.registerSource(identifier, version, session.getSchema(identifier, version, "yang") + .getText().getBytes(StandardCharsets.UTF_8)); + } catch (NetconfException.RPCException f) { + ui.parser.addWarning(String.format("Failed to get schema for %s:%s (%s)\n", + identifier, version, f.getMessage())); + } catch (Exception e) { + e.printStackTrace(); + } finally { + progressBar.setValue(++schemasProcessed / schemas.size()); + } + } + + // Actually parse the YANG models using ODL yangtools + label.setValue(String.format("Analyzing schemas. This may take a minute...")); + progressBar.setIndeterminate(true); + ui.push(); + + ui.parser.parse(); + + if (ui.parser.getSchemaContext() == null) + throw new Exception("Failed to analyze schemas! Please verify that the YANG models of your agent are valid!"); + + // Switch to main view + ui.showMain(); + } catch (Exception e) { + Notification.show("Failed to connect: " + e.getMessage(), Notification.Type.ERROR_MESSAGE); + e.printStackTrace(); + } finally { + loadingWindow.close(); + ui.removeWindow(loadingWindow); + } + }); + loginPanel.addComponent(fields); + + addComponent(loginPanel); + setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER); + setExpandRatio(loginPanel, 1.0f); + } +} diff --git a/explorer/src/main/java/com/cisco/stbarth/netconf/anx/TelemetryTools.java b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/TelemetryTools.java new file mode 100644 index 0000000..c3d8ac3 --- /dev/null +++ b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/TelemetryTools.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anx; + +import com.cisco.stbarth.netconf.xrgrpc.XRGRPCClient; +import com.cisco.stbarth.netconf.xrgrpc.XRGRPCClient.SubscriptionEncoding; +import com.cisco.stbarth.netconf.xrgrpc.XRGRPCClient.XRException; +import com.cisco.stbarth.netconf.xrgrpc.XRGRPCClient.XRGRPCClientSecurity; +import com.cisco.stbarth.netconf.anc.*; +import com.cisco.stbarth.netconf.anc.Netconf.Datastore; +import com.vaadin.data.provider.Query; +import com.vaadin.event.ShortcutAction; +import com.vaadin.icons.VaadinIcons; +import com.vaadin.ui.*; +import com.vaadin.ui.themes.ValoTheme; +import elemental.json.*; +import elemental.json.impl.JsonUtil; +import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; +import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.net.ssl.SSLHandshakeException; + +/** + * Telemetry support tools + */ +public class TelemetryTools { + private MainView view; + private ComboBox sensorGroupSelect; + private static final String NS_TELEMETRY = "http://cisco.com/ns/yang/Cisco-IOS-XR-telemetry-model-driven-cfg"; + private static final String NS_EMS = "http://cisco.com/ns/yang/Cisco-IOS-XR-man-ems-cfg"; + + TelemetryTools(MainView view) { + this.view = view; + } + + // Update sensor group selector with current sensor groups + private void updateComponent() { + Optional selected = sensorGroupSelect.getSelectedItem().map(x -> x.getText("sensor-group-identifier")); + sensorGroupSelect.setItems(getSensorGroups()); + sensorGroupSelect.setSelectedItem(null); + sensorGroupSelect.getDataProvider().fetch(new Query<>()) + .filter(x -> x.getText("sensor-group-identifier").equals(selected.orElse(null))) + .findAny().ifPresent(sensorGroupSelect::setSelectedItem); + } + + // Render telemetry tools components for main view + Component createComponent() { + HorizontalLayout telemetryTools = new HorizontalLayout(); + telemetryTools.setSizeUndefined(); + telemetryTools.setDefaultComponentAlignment(Alignment.BOTTOM_LEFT); + + sensorGroupSelect = new ComboBox<>("Telemetry Tools"); + sensorGroupSelect.setIcon(VaadinIcons.DASHBOARD); + sensorGroupSelect.setEmptySelectionCaption("Select or input sensor group name"); + sensorGroupSelect.setWidth("400px"); + sensorGroupSelect.setItemCaptionGenerator(x -> x.getText("sensor-group-identifier")); + sensorGroupSelect.setNewItemHandler(name -> { + XMLElement group = new XMLElement(NS_TELEMETRY, "sensor-group") + .withTextChild("sensor-group-identifier", name) + .withChild("sensor-paths"); + List sensorGroups = sensorGroupSelect.getDataProvider().fetch(new Query<>()) + .collect(Collectors.toList()); + sensorGroups.add(group); + sensorGroupSelect.setItems(sensorGroups); + sensorGroupSelect.setSelectedItem(group); + }); + + Button sensorGroupEdit = new Button("Edit group", VaadinIcons.EDIT); + sensorGroupEdit.addClickListener(x -> showGroupEditor(sensorGroupSelect.getValue())); + sensorGroupEdit.setEnabled(false); + + Button sensorGroupSubscribe = new Button("Live data", VaadinIcons.PIE_BAR_CHART); + sensorGroupSubscribe.addClickListener(x -> showGroupSubscribe(sensorGroupSelect.getValue())); + sensorGroupSubscribe.setEnabled(false); + + sensorGroupSelect.addValueChangeListener(x -> { + sensorGroupEdit.setEnabled(!sensorGroupSelect.isEmpty()); + sensorGroupSubscribe.setEnabled(!sensorGroupSelect.isEmpty()); + }); + + updateComponent(); + telemetryTools.addComponents(sensorGroupSelect, sensorGroupEdit, sensorGroupSubscribe); + return telemetryTools; + } + + // Query currently configured sensor-groups from device + private Stream getSensorGroups() { + try (NetconfSession session = view.client.createSession()) { + return session.getConfig(Netconf.Datastore.RUNNING, + Arrays.asList(new XMLElement(NS_TELEMETRY, "telemetry-model-driven"))) + .getFirst(NS_TELEMETRY, "telemetry-model-driven").flatMap(x -> x.getFirst("sensor-groups")) + .map(x -> x.stream("sensor-group")).orElse(Stream.empty()); + } catch (NetconfException e) { + Notification.show("Failed to read sensor groups: " + e.getMessage(), Notification.Type.TRAY_NOTIFICATION); + return Stream.empty(); + } + } + + private void showGroupEditor(XMLElement sensorGroup) { + // Render sensor group editor and provide currently selected sensor group + String groupID = sensorGroup.getText("sensor-group-identifier"); + Window editorWindow = new Window("Sensor group editor: ".concat(groupID)); + editorWindow.setModal(true); + editorWindow.setResizable(false); + editorWindow.setDraggable(false); + editorWindow.setWidth("900px"); + editorWindow.setHeight("450px"); + + Set paths = sensorGroup.withoutNamespaces().find("sensor-paths/sensor-path/telemetry-sensor-path") + .map(XMLElement::getText).collect(Collectors.toSet()); + + VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + layout.setSizeFull(); + + ListSelect listSelect = new ListSelect<>(); + listSelect.setSizeFull(); + listSelect.setItems(paths); + layout.addComponent(listSelect); + layout.setExpandRatio(listSelect, 1.0f); + + Button removeButton = new Button("Remove path", VaadinIcons.ERASER); + removeButton.setEnabled(false); + removeButton.addClickListener(x -> { + paths.removeAll(listSelect.getSelectedItems()); + listSelect.setItems(paths); + }); + layout.addComponent(removeButton); + layout.setComponentAlignment(removeButton, Alignment.MIDDLE_RIGHT); + + HorizontalLayout addLayout = new HorizontalLayout(); + addLayout.setWidth("100%"); + TextField path = new TextField(); + path.setWidth("100%"); + path.focus(); + + listSelect.addSelectionListener(x -> { + x.getFirstSelectedItem().ifPresent(path::setValue); + removeButton.setEnabled(x.getFirstSelectedItem().isPresent()); + }); + + Button addButton = new Button("Add path", VaadinIcons.PLUS); + addButton.setEnabled(false); + addButton.addClickListener(x -> { + paths.add(path.getValue()); + listSelect.setItems(paths); + path.clear(); + path.focus(); + }); + addButton.setClickShortcut(ShortcutAction.KeyCode.ENTER); + addLayout.addComponent(path); + addLayout.addComponent(addButton); + addLayout.setExpandRatio(path, 1.0f); + layout.addComponent(addLayout); + + path.addValueChangeListener(x -> addButton.setEnabled(x.getValue() != null)); + + if (view.selectedNode != null) { + WrappedYangNode node = view.selectedNode; + if (node.getNode() instanceof LeafSchemaNode || node.getNode() instanceof LeafListSchemaNode) + node = node.getParent(); + path.setValue(node.getSensorPath()); + } + + HorizontalLayout buttonLayout = new HorizontalLayout(); + Button saveButton = new Button("Save sensor group", VaadinIcons.CHECK_CIRCLE); + saveButton.addStyleName(ValoTheme.BUTTON_FRIENDLY); + saveButton.addClickListener(x -> { + editorWindow.close(); + UI.getCurrent().removeWindow(editorWindow); + XMLElement replace = new XMLElement(NS_TELEMETRY, "telemetry-model-driven") + .withChild("sensor-groups", g -> g.createChild("sensor-group") + .withTextChild("sensor-group-identifier", groupID) + //.withChild("enable") + .withAttribute(Netconf.NS_NETCONF, "operation", "replace") + .withChild("sensor-paths", p -> listSelect.getDataProvider().fetch(new Query<>()) + .forEach(sensorPath -> p.createChild("sensor-path") + .withTextChild("telemetry-sensor-path", sensorPath)) + ) + ); + try (NetconfSession session = view.client.createSession()) { + session.editConfig(Netconf.Datastore.CANDIDATE, replace); + session.commit(); + updateComponent(); + Notification.show("Sensor group saved.", Notification.Type.TRAY_NOTIFICATION); + } catch (NetconfException e) { + Notification.show("Failed to save group: ".concat(e.getMessage()), Notification.Type.ERROR_MESSAGE); + e.printStackTrace(); + if (e instanceof NetconfException.RPCException) + System.err.println(((NetconfException.RPCException)e).getRPCReply().toString()); + } + }); + buttonLayout.addComponent(saveButton); + buttonLayout.setComponentAlignment(saveButton, Alignment.MIDDLE_LEFT); + + Button deleteButton = new Button("Delete sensor group", VaadinIcons.ERASER); + deleteButton.addStyleName(ValoTheme.BUTTON_DANGER); + deleteButton.addClickListener(x -> { + editorWindow.close(); + UI.getCurrent().removeWindow(editorWindow); + XMLElement deletion = new XMLElement(NS_TELEMETRY, "telemetry-model-driven") + .withChild("sensor-groups", g -> g.createChild("sensor-group") + .withTextChild("sensor-group-identifier", groupID) + .withAttribute(Netconf.NS_NETCONF, "operation", "remove")); + try (NetconfSession session = view.client.createSession()) { + session.editConfig(Netconf.Datastore.CANDIDATE, deletion, Netconf.EditConfigDefaultOperation.NONE); + session.commit(); + updateComponent(); + Notification.show("Sensor group deleted.", Notification.Type.TRAY_NOTIFICATION); + } catch (NetconfException e) { + Notification.show("Failed to delete group: ".concat(e.getMessage()), Notification.Type.ERROR_MESSAGE); + e.printStackTrace(); + if (e instanceof NetconfException.RPCException) + System.err.println(((NetconfException.RPCException)e).getRPCReply().toString()); + } + }); + buttonLayout.addComponent(deleteButton); + buttonLayout.setComponentAlignment(deleteButton, Alignment.MIDDLE_RIGHT); + + layout.addComponent(buttonLayout); + editorWindow.setContent(layout); + UI.getCurrent().addWindow(editorWindow); + } + + private Window showLoadingWindow(String caption) { + Window loadingWindow = new Window(); + loadingWindow.setModal(true); + loadingWindow.setResizable(false); + loadingWindow.setClosable(false); + loadingWindow.setDraggable(false); + loadingWindow.setWidth("900px"); + loadingWindow.setHeight("75px"); + + HorizontalLayout layout = new HorizontalLayout(); + layout.setMargin(true); + layout.setSizeFull(); + + ProgressBar progressBar = new ProgressBar(); + progressBar.setIndeterminate(true); + progressBar.setWidth("150px"); + Label label = new Label(caption); + label.addStyleName(ValoTheme.LABEL_BOLD); + layout.addComponents(progressBar, label); + layout.setComponentAlignment(progressBar, Alignment.MIDDLE_LEFT); + layout.setComponentAlignment(label, Alignment.MIDDLE_LEFT); + layout.setExpandRatio(label, 1.0f); + + loadingWindow.setContent(layout); + + UI.getCurrent().addWindow(loadingWindow); + UI.getCurrent().push(); + return loadingWindow; + } + + private void showGroupSubscribe(XMLElement sensorGroup) { + // Render sensor group subscription + + String groupID = sensorGroup.getText("sensor-group-identifier"); + String subscriptionID = String.format("anx-%d", System.currentTimeMillis()); + int grpcPort = 57400; + + XMLElement subscriptionConfig = new XMLElement(NS_TELEMETRY, "telemetry-model-driven") + .withChild("subscriptions", x -> x.createChild("subscription") + .withTextContent("subscription-identifier", subscriptionID) + .createChild("sensor-profiles").createChild("sensor-profile") + .withTextContent("sample-interval", "15000") + .withTextContent("sensorgroupid", groupID)); + XMLElement grpcConfig = new XMLElement(NS_EMS, "grpc").withChild("enable"); + + Window loadingWindow = showLoadingWindow("Configuring GRPC and Telemetry subscription..."); + + try (NetconfSession session = view.client.createSession()) { + XMLElement grpc = session.getConfig(Netconf.Datastore.RUNNING, + Arrays.asList(new XMLElement(NS_EMS, "grpc"))).getOrEmpty(NS_EMS, "grpc"); + grpcPort = Integer.parseInt(grpc.getText("port")); + + session.editConfig(Datastore.CANDIDATE, grpcConfig); + session.editConfig(Datastore.CANDIDATE, subscriptionConfig); + session.commit(); + + // If GRPC was not enabled, disable it afterwards + if (!grpc.getFirst("enable").isPresent()) + grpcConfig.getOrEmpty("enable").withAttribute(Netconf.NS_NETCONF, "operation", "remove"); + } catch (NetconfException e) { + Notification.show("Failed to enable GRPC or Telemetry subscription: " + e.getMessage(), + Notification.Type.ERROR_MESSAGE); + e.printStackTrace(); + } + + loadingWindow.close(); + + VerticalLayout liveLayout = new VerticalLayout(); + ComboBox measurements = new ComboBox<>("Measurement"); + TextArea data = new TextArea("Telemetry Data (JSON format)"); + data.setReadOnly(true); + data.setValue("Waiting for first measurement..."); + data.setSizeFull(); + + measurements.setWidth("100%"); + measurements.setEmptySelectionAllowed(false); + measurements.setTextInputAllowed(false); + measurements.setItemCaptionGenerator(x -> String.format("[%tT] %s", + (long)x.getNumber("msg_timestamp"), x.getString("encoding_path"))); + measurements.addValueChangeListener(x -> data.setValue(JsonUtil.stringify(x.getValue(), 2))); + + XRGRPCClient tlsClient = new XRGRPCClient(view.host, grpcPort, + view.username, view.password, XRGRPCClientSecurity.TLS_UNVERIFIED); + XRGRPCClient plainClient = new XRGRPCClient(view.host, grpcPort, + view.username, view.password, XRGRPCClientSecurity.PLAINTEXT); + + LinkedList telemetryData = new LinkedList<>(); + Consumer telemetryConsumer = x -> view.getUI().access(() -> { + telemetryData.add(Json.parse(new String(x, StandardCharsets.UTF_8))); + measurements.setItems(telemetryData); + + if (telemetryData.size() == 1) + measurements.setValue(telemetryData.get(0)); + }); + Consumer shutdownConsumer = new Consumer() { + @Override + public void accept(Throwable t) { + if (t instanceof XRException) { + Notification.show("Subscription error: " + t.getMessage()); + } else if (t != null && t.getCause() instanceof SSLHandshakeException) { + plainClient.createSubscription(subscriptionID, SubscriptionEncoding.JSON, + telemetryConsumer, this); + } else if (t != null) { + t.printStackTrace(); + } + } + }; + + tlsClient.createSubscription(subscriptionID, SubscriptionEncoding.JSON, telemetryConsumer, shutdownConsumer); + + Window liveWindow = new Window("Live Telemetry data: ".concat(groupID)); + liveWindow.setModal(true); + liveWindow.setResizable(false); + liveWindow.setDraggable(false); + liveWindow.setWidth("1000px"); + liveWindow.setHeight("700px"); + liveWindow.addCloseListener(c -> { + Window unloadingWindow = showLoadingWindow("Deconfiguring Telemetry subscription..."); + + try { + tlsClient.close(); + plainClient.close(); + } catch (Exception e) { + + } + + try (NetconfSession session = view.client.createSession()) { + session.editConfig(Datastore.CANDIDATE, new XMLElement(NS_TELEMETRY, "telemetry-model-driven") + .withChild("subscriptions", x -> x.createChild("subscription") + .withAttribute(Netconf.NS_NETCONF, "operation", "remove") + .withTextContent("subscription-identifier", subscriptionID))); + session.editConfig(Datastore.CANDIDATE, grpcConfig); + session.commit(); + } catch (NetconfException e) { + Notification.show("Failed to enable GRPC or Telemetry subscription: " + e.getMessage(), + Notification.Type.ERROR_MESSAGE); + e.printStackTrace(); + } + + unloadingWindow.close(); + }); + liveLayout.addComponents(measurements, data); + liveLayout.setExpandRatio(data, 1.0f); + liveLayout.setSizeFull(); + liveWindow.setContent(liveLayout); + UI.getCurrent().addWindow(liveWindow); + } + +} diff --git a/explorer/src/main/java/com/cisco/stbarth/netconf/anx/WrappedYangNode.java b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/WrappedYangNode.java new file mode 100644 index 0000000..97756bd --- /dev/null +++ b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/WrappedYangNode.java @@ -0,0 +1,340 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anx; + +import com.cisco.stbarth.netconf.anc.Netconf; +import com.cisco.stbarth.netconf.anc.XMLElement; +import com.vaadin.data.TreeData; +import com.vaadin.ui.Tree; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.model.api.*; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Optional; +import java.util.stream.Stream; + +/** + * wrapper utility class to work with ODL yangtools schema nodes + */ +class WrappedYangNode { + private Module module; + private DataSchemaNode node; + private WrappedYangNode parent; + private String namespace; + private String name; + private String description; + private boolean expand; + private boolean configuration; + private static HashMap prefixes = new HashMap<>(); + + WrappedYangNode(WrappedYangNode parent, DataSchemaNode node) { + this.parent = parent; + this.node = node; + this.namespace = node.getQName().getNamespace().toString(); + this.name = node.getQName().getLocalName(); + this.description = Optional.ofNullable(node.getDescription()).orElse(""); + this.configuration = node.isConfiguration(); + } + + WrappedYangNode(Module module) { + this.module = module; + this.namespace = module.getNamespace().toString(); + this.name = module.getName(); + this.description = Optional.ofNullable(module.getDescription()).orElse(""); + prefixes.put(namespace, module.getPrefix()); + } + + // Lookup YANG node from path + static Optional byPath(WrappedYangNode module, String path) { + Optional node = Optional.of(module); + for (String element: path.split("/")) { + //FIXME: we need to filter any choice-nodes here? + node = node.flatMap(n -> n.getChild(element)); + } + return node; + } + + String getName() { + return name; + } + + String getCaption() { + String caption = getName(); + if (parent != null && !parent.namespace.equals(namespace)) + caption += " (" + namespace + ")"; + return caption; + } + + String getSensorPath() { + String path = name; + for (WrappedYangNode node = this.parent; node != null; node = node.parent) + if (!(node.node instanceof ChoiceCaseNode) && !(node.node instanceof ChoiceSchemaNode)) + path = node.name + (node.module != null ? ':' : '/') + path; + return path; + } + + String getXPath() { + String path = String.format("%s:%s", prefixes.get(namespace), name); + for (WrappedYangNode node = this.parent; node != null && node.node != null; node = node.parent) { + if (!(node.node instanceof ChoiceCaseNode) && !(node.node instanceof ChoiceSchemaNode)) + path = String.format("%s:%s/%s", prefixes.get(node.namespace), node.name, path); + } + return "/" + path; + } + + String getMaagic(boolean qualified) { + String nodeName = name.replaceAll("[-.]", "_"); + if (node instanceof ListSchemaNode) + nodeName += "[...]"; + String path = !qualified ? nodeName : + String.format("%s__%s", prefixes.get(namespace).replaceAll("[-.]", "_"), nodeName); + for (WrappedYangNode node = this.parent; node != null && node.node != null; node = node.parent) { + if (!(node.node instanceof ChoiceCaseNode) && !(node.node instanceof ChoiceSchemaNode)) { + nodeName = node.name.replaceAll("[-.]", "_"); + if (node.node instanceof ListSchemaNode) + nodeName += "[...]"; + path = !qualified ? String.format("%s.%s", nodeName, path) : + String.format("%s__%s.%s", prefixes.get(node.namespace).replaceAll("[-.]", "_"), nodeName, path); + } + } + return path; + } + + String getType() { + if (node instanceof AnyXmlSchemaNode) + return "anyxml"; + else if (node instanceof ChoiceCaseNode) + return "case"; + else if (node instanceof ChoiceSchemaNode) + return "choice"; + else if (node instanceof ContainerSchemaNode) + return "container"; + else if (node instanceof LeafSchemaNode) + return "leaf"; + else if (node instanceof LeafListSchemaNode) + return "leaf-list"; + else if (node instanceof ListSchemaNode) + return "list"; + else + return "module"; + } + + String getDataType() { + return (node instanceof TypedSchemaNode) ? ((TypedSchemaNode)node).getType().getPath().getLastComponent().getLocalName() : ""; + } + + // Recursively transform YANG schema node into XML pattern (e.g. subtree filters) + private void addChildren(XMLElement element, DataSchemaNode node) { + if (node instanceof DataNodeContainer) { + DataNodeContainer container = (DataNodeContainer)node; + for (DataSchemaNode child: container.getChildNodes()) { + String childNS = child.getQName().getNamespace().toString(); + String childName = child.getQName().getLocalName(); + Optional dataChildElement = element.getFirst(childNS, childName); + XMLElement childElement = dataChildElement.isPresent() ? + dataChildElement.get() : element.createChild(childNS, childName); + + childElement.withAttribute("expand", null); + childElement.withAttribute("root", null); + + addChildren(childElement, child); + + if (!dataChildElement.isPresent()) { + if (child instanceof LeafSchemaNode || child instanceof LeafListSchemaNode) + childElement.withText(child.getDescription()); + + element.withComment(childElement.toString().replaceAll("\\s+$", "")); + childElement.remove(); + } + } + } + } + + // Create XML template (e.g. subtree filter) from current YANG node + Optional createNetconfTemplate(String operation, XMLElement data) { + XMLElement element = new XMLElement(namespace, name); + + if (operation != null && operation.isEmpty()) { + if (data != null) + element = data; + + // Remove any meta-attributes we may have added elsewhere + element.withAttribute("expand", null); + element.withAttribute("root", null); + addChildren(element, node); + } else if (operation != null || data != null) { + if (operation != null && !operation.isEmpty()) + element.withAttribute(Netconf.NS_NETCONF, "operation", operation); + + if (node instanceof ListSchemaNode) { + // For lists, we need to include key leafs + for (QName key : ((ListSchemaNode) node).getKeyDefinition()) { + String keyNS = key.getNamespace().toString(); + String keyName = key.getLocalName(); + Optional keyE = Optional.ofNullable(data).flatMap(x -> x.getFirst(keyNS, keyName)); + if (keyE.isPresent()) + element.withChild(keyE.get().clone()); + else + element.createChild(keyNS, keyName); + } + } + } + + // If we have associated data from the peer populate it in the XML template + for (WrappedYangNode node = this.parent; node != null && node.node != null; node = node.parent) { + if (!(node.node instanceof ChoiceCaseNode) && !(node.node instanceof ChoiceSchemaNode)) { + if (data != null) + data = data.getParent(); + + element = new XMLElement(node.namespace, node.name).withChild(element); + if (node.node instanceof ListSchemaNode) { + ListSchemaNode listNode = (ListSchemaNode)node.node; + for (QName key: listNode.getKeyDefinition()) { + String keyName = key.getLocalName(); + String keyNS = key.getNamespace().toString(); + + Optional keyV = Optional.ofNullable(data).flatMap(d -> d.getFirst(keyNS, keyName)); + if (keyV.isPresent()) + element.withChild(keyV.get().clone()); + else + element.withChild(keyNS, keyName); + } + } + } + } + + return Optional.ofNullable(module == null ? element : null); + } + + Optional createNetconfTemplate() { + return createNetconfTemplate(null, null); + } + + // Get the names of the key leafs + Stream getKeys() { + return (node instanceof ListSchemaNode) + ? ((ListSchemaNode)node).getKeyDefinition().stream().map(QName::getLocalName) : Stream.empty(); + } + + boolean isKey() { + return parent != null && parent.node instanceof ListSchemaNode && + ((ListSchemaNode)parent.node).getKeyDefinition().contains(node.getQName()); + } + + boolean isNotKey() { + return isKey(); + } + + DataSchemaNode getNode() { + return node; + } + + WrappedYangNode getParent() { + return parent; + } + + Module getModule() { + WrappedYangNode node; + for (node = this; node.module == null; node = node.getParent()); + return node.module; + } + + // Populate YANG schema nodes, based on a filter applied to names and descriptions + boolean addToTree(TreeData data, Collection filter) { + String nodeName = name.toLowerCase(); + String nodeDescription = description.toLowerCase(); + boolean okay = filter.stream().filter(nodeName::contains).count() == filter.size() || + filter.stream().filter(nodeDescription::contains).count() == filter.size(); + + data.addItem(parent, this); + + if (!filter.isEmpty()) { + if (parent != null) + parent.expand = true; + + if (okay) + filter = Collections.emptyList(); + } + + // Recursively add child nodes to YANG schema tree + if (module != null) { + for (Module submodule: module.getSubmodules()) { + for (DataSchemaNode childNode: submodule.getChildNodes()) { + if (new WrappedYangNode(this, childNode).addToTree(data, filter)) + okay = true; // if children matches filter, populate match up to current element + } + } + } + + DataNodeContainer container = module != null ? module : + node instanceof DataNodeContainer ? (DataNodeContainer)node : null; + if (container != null) { + for (DataSchemaNode childNode : container.getChildNodes()) { + if (new WrappedYangNode(this, childNode).addToTree(data, filter)) + okay = true; + } + } + + // If neither current element nor children match filter, remove current + if (!okay) + data.removeItem(this); + + return okay; + } + + String getDescription() { + return description; + } + + boolean isConfiguration() { + return configuration; + } + + String getNamespace() { + return namespace; + } + + Stream getChildren() { + DataNodeContainer container = module != null ? module : + node instanceof DataNodeContainer ? (DataNodeContainer)node : null; + return (container == null) ? Stream.empty() : + container.getChildNodes().stream().map(n -> new WrappedYangNode(this, n)); + } + + Optional getChild(String name) { + return getChildren().filter(node -> node.getName().equals(name)).findAny(); + } + + // Apply limited expansion + int applyExpand(Tree tree, int limit) { + if (expand && limit > 0) { + int limitBefore = limit; + tree.expand(this); + + for (WrappedYangNode child: tree.getTreeData().getChildren(this)) + limit = child.applyExpand(tree, limit); + + if (limit == limitBefore) + --limit; + } + return limit; + } +} \ No newline at end of file diff --git a/explorer/src/main/java/com/cisco/stbarth/netconf/anx/YangParser.java b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/YangParser.java new file mode 100644 index 0000000..7fdffa6 --- /dev/null +++ b/explorer/src/main/java/com/cisco/stbarth/netconf/anx/YangParser.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cisco.stbarth.netconf.anx; + +import com.google.common.io.ByteSource; +import com.google.common.io.Resources; +import com.google.common.util.concurrent.CheckedFuture; +import com.google.common.util.concurrent.Futures; +import org.opendaylight.yangtools.yang.model.api.ModuleImport; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException; +import org.opendaylight.yangtools.yang.model.repo.api.*; +import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource; +import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider; +import org.opendaylight.yangtools.yang.model.repo.util.InMemorySchemaSourceCache; +import org.opendaylight.yangtools.yang.parser.repo.SharedSchemaRepository; +import org.opendaylight.yangtools.yang.parser.util.ASTSchemaSource; +import org.opendaylight.yangtools.yang.parser.util.TextToASTTransformer; + +import java.io.IOException; +import java.net.URL; +import java.util.*; +import java.util.stream.Collectors; + +/** + * Wrapper for ODL yangtools parser + */ +public class YangParser implements SchemaSourceProvider { + private HashMap sources; + private SharedSchemaRepository repository; + private SchemaContext schemaContext; + private InMemorySchemaSourceCache cache; + private List warnings; + private Map blacklist; + + YangParser() { + //System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "debug"); + sources = new HashMap<>(); + repository = new SharedSchemaRepository("yang-context-resolver"); + repository.registerSchemaSourceListener(TextToASTTransformer.create(repository, repository)); + cache = InMemorySchemaSourceCache.createSoftCache(repository, ASTSchemaSource.class); + warnings = new LinkedList<>(); + blacklist = new HashMap<>(); + + // Some Openconfig YANG models use YANG 1.1 feature, but claim to be YANG 1.0 + // exclude those, since they mess up the parser + blacklist.put("openconfig-telemetry", "2017-02-20"); + blacklist.put("openconfig-bgp", "2016-06-06"); + blacklist.put("openconfig-bgp-policy", "2016-06-06"); + blacklist.put("openconfig-mpls-rsvp", "2016-12-15"); + blacklist.put("openconfig-mpls-te", "2016-12-15"); + blacklist.put("openconfig-if-ip", "2016-12-22"); + } + + public Collection getSources() { + return sources.values(); + } + + public void registerSource(String identifier, String version, URL url) + throws SchemaSourceException, IOException, YangSyntaxErrorException { + registerSource(identifier, version, Resources.asByteSource(url)); + } + + public void registerSource(String identifier, String version, byte[] bytes) + throws SchemaSourceException, IOException, YangSyntaxErrorException { + registerSource(identifier, version, YangTextSchemaSource.wrap(bytes)); + } + + public void registerSource(String identifier, String version, ByteSource byteSource) + throws SchemaSourceException, IOException, YangSyntaxErrorException { + YangTextSchemaSource source = YangTextSchemaSource.delegateForByteSource( + RevisionSourceIdentifier.create(identifier, version), byteSource); + ASTSchemaSource ast = TextToASTTransformer.transformText(source); + SourceIdentifier actualIdentifier = ast.getIdentifier(); + + + // Apply blacklist + String blacklistVersion = blacklist.get(identifier); + if (blacklistVersion != null && version.compareTo(blacklistVersion) < 0) { + warnings.add(String.format("%s@%s blacklisted: not YANG compliant", identifier, version)); + System.err.printf("%TF %TT: %s\n", System.currentTimeMillis(), System.currentTimeMillis(), + warnings.get(warnings.size() - 1)); + return; + } + + // Fixup YANG source identifier if the provided YANG model has a different actual identifier + if (!source.getIdentifier().equals(actualIdentifier)) + source = YangTextSchemaSource.delegateForByteSource(actualIdentifier, byteSource); + + cache.schemaSourceEncountered(ast); + + sources.put(source.getIdentifier(), source); + repository.registerSchemaSource(this, PotentialSchemaSource.create( + source.getIdentifier(), YangTextSchemaSource.class, PotentialSchemaSource.Costs.IMMEDIATE.getValue())); + } + + public void parse() { + SchemaContextFactory factory = repository.createSchemaContextFactory(SchemaSourceFilter.ALWAYS_ACCEPT); + Collection requiredSources = new HashSet<>(sources.keySet()); + // Parse all available YANG models, if we fail remove failed model and retry with remaining models + while (!requiredSources.isEmpty()) { + try { + schemaContext = factory.createSchemaContext(requiredSources).checkedGet(); + break; + } catch (SchemaResolutionException e) { + if (!e.getUnsatisfiedImports().isEmpty()) { + for (SourceIdentifier id : e.getUnsatisfiedImports().keySet()) { + String imports = e.getUnsatisfiedImports().get(id).stream() + .map(ModuleImport::getModuleName).collect(Collectors.joining(", ")); + warnings.add(String.format("%s tries to imports missing model: %s", + id.toYangFilename(), imports)); + System.err.printf("%TF %TT: %s\n", System.currentTimeMillis(), System.currentTimeMillis(), + warnings.get(warnings.size() - 1)); + } + } + + if (e.getFailedSource() != null) { + requiredSources.remove(e.getFailedSource()); + warnings.add(String.format("%s failed to parse as a valid YANG model", + e.getFailedSource().toYangFilename())); + System.err.printf("%TF %TT: %s\n", System.currentTimeMillis(), System.currentTimeMillis(), + warnings.get(warnings.size() - 1)); + } else { + requiredSources = new HashSet<>(e.getResolvedSources()); + } + + e.printStackTrace(); + } + } + } + + public SchemaContext getSchemaContext() { + return schemaContext; + } + + public Collection getWarnings() { + return warnings; + } + + public void addWarning(String warning) { + warnings.add(warning); + } + + @Override + public CheckedFuture getSource(SourceIdentifier sourceIdentifier) { + YangTextSchemaSource source = sources.get(sourceIdentifier); + return source != null ? Futures.immediateCheckedFuture(source) : Futures.immediateFailedCheckedFuture( + new MissingSchemaSourceException("URL for " + sourceIdentifier + " not registered", sourceIdentifier)); + } +} diff --git a/explorer/src/main/resources/README b/explorer/src/main/resources/README new file mode 100644 index 0000000..faabc74 --- /dev/null +++ b/explorer/src/main/resources/README @@ -0,0 +1 @@ +Please add your static resources here diff --git a/explorer/src/main/resources/config.properties b/explorer/src/main/resources/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/explorer/src/main/resources/tailf-cli-extensions.yang b/explorer/src/main/resources/tailf-cli-extensions.yang new file mode 100644 index 0000000..e25c2bc --- /dev/null +++ b/explorer/src/main/resources/tailf-cli-extensions.yang @@ -0,0 +1,3433 @@ +submodule tailf-cli-extensions { + + belongs-to tailf-common { + prefix tailf; + } + + include tailf-meta-extensions { + revision-date 2017-03-08; + } + + organization "Tail-f Systems"; + + description + "This module defines all Tail-f YANG extensions statements + related to CLI customization. + + See also the 'display-' statements and the 'alt-name' statement + in tailf-common.yang."; + + revision 2017-08-23 { + description + "Released as part of Confd-6.4.3 / NCS-4.4.3. + + Added tailf:cli-only-in-autowizard for leafs with sensitive data."; + } + + revision 2017-03-08 { + description + "Released as part of Confd-6.4 / NCS-4.4. + + Included latest revision of the tailf-meta-extensions submodule."; + } + + revision 2017-01-26 { + description + "Released as part of Confd-6.3.1 / NCS-4.3.1. + + Added tailf:cli-reset-full for user ordered lists."; + } + + revision 2016-11-24 { + description + "Released as part of Confd-6.3 / NCS-4.3. + + Added cli-diff-before. + Added cli-diff-set-before. + Added cli-diff-create-before. + Added cli-diff-modify-before. + Added cli-diff-delete-before. + Added cli-diff-after. + Added cli-diff-set-after. + Added cli-diff-create-after. + Added cli-diff-modify-after. + Added cli-diff-delete-after."; + } + + revision 2016-05-04 { + description + "Released as part of Confd-6.2 / NCS-4.2. + Added cli-suppress-warning."; + } + + revision 2016-04-08 { + description + "Released as part of ConfD-5.4 / NCS-3.4. + + Added cli-suppress-quotes."; + } + + revision 2015-03-19 { + description + "Released as part of ConfD-5.4 / NCS-3.4. + + Added cli-show-obu-comments. + Added cli-batch-confirm-default."; + } + + revision 2014-11-13 { + description + "Released as part of ConfD-5.3 / NCS-3.3. + + Added cli-strict-leafref. + Added cli-trigger-on-*. + Allow cli-boolean-no in typedef."; + } + + revision 2013-11-07 { + description + "Released as part of ConfD-5.0. + + Added cli-disabled-info. + Added cli-suppress-shortenabled. + Added cli-no-keyword. + Added cli-case-sensitive and cli-case-insensitive."; + } + + revision 2012-11-08 { + description + "Released as part of ConfD-4.1. + + Added cli-delete-when-empty. + Added cli-diff-dependency. + Added cli-ignore-modified."; + } + + revision 2012-08-23 { + description + "Released as part of ConfD-4.0.1. + + Allow tailf:cli-operational-mode and tailf:cli-configure-mode in + rpc."; + } + + revision 2012-06-14 { + description + "Released as part of ConfD-4.0. + + Do not allow tailf:cli-drop-node-name and tailf:cli-sequence-commands + inside tailf:action. + Added tailf:cli-configure-mode. + Added tailf:cli-operational-mode."; + } + + revision 2012-05-24 { + description + "Released as part of ConfD-3.9.2. + + Added tailf:cli-no-value-on-delete. + Added tailf:cli-no-name-on-delete. + Added tailf:cli-replace-all. + Allow tailf:cli-remove-before-change in leaf."; + } + + revision 2012-03-08 { + description + "Released as part of ConfD-3.9. + + Allow tailf:cli-range-list-syntax in lists with one integer based + key."; + } + + revision 2011-12-08 { + description + "Released as part of ConfD-3.8. + + Added tailf:cli-min-column-with."; + } + + revision 2011-09-22 { + description + "Released as part of ConfD-3.7. + + Added tailf:cli-disallow-value. + Added tailf:cli-multi-word. + Added tailf:cli-before-key. + Allow tailf:cli-flatten-container in list."; + } + + revision 2011-08-25 { + description + "Released as part of ConfD-3.6.2. + + Added cli-suppress-silent-no. + Added cli-range-delimiters. + Removed duplicate tailf:use-in statement from cli-show-config."; + } + + revision 2011-06-30 { + description + "Released as part of ConfD-3.6.1. + + Added cli-reversed. + Added cli-range-list-syntax."; + } + + revision 2011-05-26 { + description + "Released as part of ConfD-3.6. + + Added cli-allow-join-with-key. + Added cli-display-joined."; + } + revision 2011-02-24 { + description + "Released as part of ConfD-3.5. + + Added cli-boolean-no. + Added cli-exit-command. + Added cli-custom-range-enumerator. + Added cli-reset-siblings. + Added cli-reset-all-siblings. + Added cli-reset-container. + Added cli-hide-in-submode. + Added cli-prefix-key. + Added cli-show-with-default. + + Added 'commasep' and 'show:' filter in + cli-template-string. + + Removed deprecated tailf:cli-default-order."; + } + + revision 2010-12-02 { + description + "Released as part of ConfD-3.4.1. + + Added cli-flatten-container."; + } + + revision 2010-11-04 { + description + "Released as part of ConfD-3.4. + + Added cli-key-format. + Added cli-list-syntax. + Added cli-flat-list-syntax. + + The following statements were added in ConfD-3.3.3: + + Added cli-suppress-list-no. + Added cli-suppress-no. + Added cli-full-no. + Added cli-incomplete-no."; + } + + revision 2010-09-16 { + description + "Released as part of ConfD-3.3.2. + + Added cli-autowizard. + Added cli-multi-word-key. + Added cli-no-match-completion."; + } + + revision 2010-08-19 { + description + "Released as part of ConfD-3.3.1. + + Added cli-show-template-footer. + Added cli-run-template-footer. + Added cli-table-footer. + Changed cli-table-legend to be a template."; + } + + revision 2010-06-17 { + description + "Released as part of ConfD-3.3. + + Added cli-display-empty-config. + + Added cli-expose-key-name. + + Added cli-value-display-template. + + Added cli-run-template. + Added cli-run-template-legend. + Added cli-run-template-enter. + + Added cli-suppress-key-sort. + + Added cli-suppress-validation-warning-prompt. + + Added 'hex' and 'hexlist' as display parameters in the + type cli-template-string. + + Deprecated tailf:cli-default-order."; + } + + revision 2010-03-18 { + description + "Released as part of ConfD-3.2."; + } + + extension cli-suppress-quotes { + tailf:use-in "leaf"; + description + "Specifies that configuration data for a leaf should never be wrapped + with quotes. All internal data will be escaped to make sure it + can be presented correctly. + + Can't be used for keys. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-show-no { + tailf:use-in "leaf"; + tailf:use-in "list"; + tailf:use-in "leaf-list"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + tailf:use-in "container"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that an optional leaf node or presence container + should be displayed as 'no ' when it does not exist. + For example, if a leaf 'shutdown' has this property and + does not exist, 'no shutdown' is displayed. + + Used in I- and C-style CLIs."; + } + + extension cli-disallow-value { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + description + "Specifies that a pattern for invalid values. + + Used in I- and C-style CLIs."; + } + + extension cli-boolean-no { + tailf:use-in "typedef"; + tailf:use-in "leaf"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + tailf:substatement "tailf:cli-reversed"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that a leaf of type boolean should be displayed as + '' if set to true, and 'no ' if set to + false. + + Cannot be used in conjunction with tailf:cli-hide-in-submode + or tailf:cli-compact-syntax. + + Used in I- and C-style CLIs."; + } + + extension cli-reversed { + tailf:use-in "tailf:cli-boolean-no"; + description + "Specified that true should be displayed as 'no ' and + false as 'name'. + + Used in I- and C-style CLIs."; + } + + extension cli-autowizard { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the autowizard should include this leaf even + if the leaf is optional. + + One use case is when implementing pre-configuration of devices. + A config false node can be defined for showing if the + configuration is active or not (preconfigured). + + Used in J-, I- and C-style CLIs."; + } + + extension cli-show-config { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + description + "Specifies that the node will be included when doing a 'show + running-configuration', even if it is a non-config node. + + Used in I- and C-style CLIs."; + } + + + extension cli-display-empty-config { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the node will be included when doing a 'show + stats', even if it is a non-config node, provided + that the list contains at least one non-config node. + + Used in J-style CLI."; + } + + extension cli-mode-name { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies a custom mode name, instead of the default which is the + name of the list or container node. + + Can be used in config nodes only. If used in a container, the + container must also have a tailf:cli-add-mode statement, and if + used in a list, the list must not also have a + tailf:cli-suppress-mode statement. + + Variables for the list keys in the current mode are available. + For examples, 'config-foo-xx$(name)' (privided the key leaf + is called 'name'). + + Used in I- and C-style CLIs."; + } + + extension cli-show-order-taglist { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies a custom display order for nodes with the + tailf:cli-show-order-tag attribute. Nodes will be displayed + in the order indicated in the list. Nodes without a tag will + be displayed after all nodes with a tag have been displayed. + + The scope of a taglist is until a new taglist is encountered. + + Used in I- and C-style CLIs."; + } + + extension cli-show-order-tag { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies a custom display order for nodes with the + tailf:cli-show-order-tag attribute. Nodes will be displayed + in the order indicated by a cli-show-order-taglist attribute in + a parent node. + + The scope of a tag reaches until a new taglist is encountered. + + Used in I- and C-style CLIs."; + } + + extension cli-mode-name-actionpoint { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that a custom function will be invoked to find out the mode + name, instead of using the default with is the name of the list + or container node. + + The argument is the name of an actionpoint, which must be + implemented by custom code. In the actionpoint, the command() + callback function will be invoked, and it must return a string + with the mode name. See confd_lib_dp(3) for details. + + Can be used in config nodes only. If used in a container, the + container must also have a tailf:cli-add-mode statement, and if + used in a list, the list must not also have a + tailf:cli-suppress-mode statement. + + Used in I- and C-style CLIs."; + } + + extension cli-add-mode { + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Creates a mode of the container. + + Can be used in config nodes only. + + Used in I- and C-style CLIs."; + } + + extension cli-flatten-container { + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Allows the CLI to exit the container and continue to input + from the parent container when all leaves in the current + container has been set. + + Can be used in config nodes only. + + Used in I- and C-style CLIs."; + } + + extension cli-suppress-mode { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Instructs the CLI engine to not make a mode of the list node. + + Can be used in config nodes only. + + Used in I- and C-style CLIs."; + } + + extension cli-delete-when-empty { + tailf:use-in "list"; + tailf:use-in "container"; + description + "Instructs the CLI engine to delete the list when the last list + instance is deleted'. Requires that cli-suppress-mode is set. + + The behavior is recursive. If all optional leafs in a list + instance are deleted the list instance itself is deleted. If + that list instance happens to be the last list instance in a + list it is also deleted. And so on. Used in I- and C-style + CLIs."; + } + + extension cli-remove-before-change { + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Instructs the CLI engine to generate a no-commnd before + modifying an existing instance. It only applies when + generating diffs, eg 'show configuration' in C-style."; + } + + extension cli-no-value-on-delete { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "When displaying the deleted version of this leaf do not + include the old value. + + Applies to C-style"; + } + + extension cli-no-name-on-delete { + tailf:use-in "leaf"; + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "When displaying the deleted version of this element do not + include the name. + + Applies to C-style"; + } + + extension cli-embed-no-on-delete { + tailf:use-in "leaf"; + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Embed no in front of the element name insead of at the + beginning of the line. + + Applies to C-style"; + } + + extension cli-recursive-delete { + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "When generating configuration diffs delete all contents + of a container or list before deleting the node. + + Applies to C-style"; + } + + extension cli-diff-before { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any changes made to this node + before any changes made to the target node(s). + + Thus, the dependency will trigger when any changes + (created, modified or deleted) has been made to this node + while any changes (created, modified or deleted) has been made + to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-delete-before { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any delete operations made on this node + before any changes made to the target node(s). + + Thus, the dependency will trigger when this node has been deleted + while any changes (created, modified or deleted) has been made + to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-set-before { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any set operations (created or modified) made on this node + before any changes made to the target node(s). + + Thus, the dependency will trigger when this node has been set + (created or modified) while any changes (created, modified or deleted) + has been made to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-create-before { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any create operations made on this node + before any changes made to the target node(s). + + Thus, the dependency will trigger when this node has been created + while any changes (created, modified or deleted) has been made + to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-modify-before { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any modify operations made on this node + before any changes made to the target node(s). + + Thus, the dependency will trigger when this node has been modified + (not created or deleted) while any changes (created, modified or deleted) + has been made to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-after { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any changes made to this node + after any changes made to the target node(s). + + Thus, the dependency will trigger when any changes + (created, modified or deleted) has been made to this node + while any changes (created, modified or deleted) has been made + to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-delete-after { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any delete operations made on this node + after any changes made to the target node(s). + + Thus, the dependency will trigger when this node has been deleted + while any changes (created, modified or deleted) has been made + to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-set-after { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any set operations (created or modified) made on this node + after any changes made to the target node(s). + + Thus, the dependency will trigger when this node has been set + (created or modified) while any changes (created, modified or deleted) + has been made to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-create-after { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any create operations made on this node + after any changes made to the target node(s). + + Thus, the dependency will trigger when this node has been created + while any changes (created, modified or deleted) has been made + to the target node(s). + + Applies to C-style"; + } + + extension cli-diff-modify-after { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-when-target-set"; + tailf:substatement "tailf:cli-when-target-create"; + tailf:substatement "tailf:cli-when-target-modify"; + tailf:substatement "tailf:cli-when-target-delete"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "When displaying C-style configuration diffs, + display any modify operations made on this node + after any changes made to the target node(s). + + Thus, the dependency will trigger when this node has been modified + (not created or deleted) while any changes (created, modified or deleted) + has been made to the target node(s). + + Applies to C-style"; + } + + extension cli-when-target-set { + tailf:use-in "tailf:cli-diff-before"; + tailf:use-in "tailf:cli-diff-delete-before"; + tailf:use-in "tailf:cli-diff-set-before"; + tailf:use-in "tailf:cli-diff-create-before"; + tailf:use-in "tailf:cli-diff-modify-before"; + tailf:use-in "tailf:cli-diff-after"; + tailf:use-in "tailf:cli-diff-delete-after"; + tailf:use-in "tailf:cli-diff-set-after"; + tailf:use-in "tailf:cli-diff-create-after"; + tailf:use-in "tailf:cli-diff-modify-after"; + description + "Specify that the dependency should trigger when the target node(s) + has been set (created or modified). + Note; using this sub-statement is equivalent with using + both tailf:cli-when-target-create and tailf:cli-when-target-modify"; + } + + extension cli-when-target-create { + tailf:use-in "tailf:cli-diff-before"; + tailf:use-in "tailf:cli-diff-delete-before"; + tailf:use-in "tailf:cli-diff-set-before"; + tailf:use-in "tailf:cli-diff-create-before"; + tailf:use-in "tailf:cli-diff-modify-before"; + tailf:use-in "tailf:cli-diff-after"; + tailf:use-in "tailf:cli-diff-delete-after"; + tailf:use-in "tailf:cli-diff-set-after"; + tailf:use-in "tailf:cli-diff-create-after"; + tailf:use-in "tailf:cli-diff-modify-after"; + description + "Specify that the dependency should trigger when the target node(s) + has been created"; + } + + extension cli-when-target-modify { + tailf:use-in "tailf:cli-diff-before"; + tailf:use-in "tailf:cli-diff-delete-before"; + tailf:use-in "tailf:cli-diff-set-before"; + tailf:use-in "tailf:cli-diff-create-before"; + tailf:use-in "tailf:cli-diff-modify-before"; + tailf:use-in "tailf:cli-diff-after"; + tailf:use-in "tailf:cli-diff-delete-after"; + tailf:use-in "tailf:cli-diff-set-after"; + tailf:use-in "tailf:cli-diff-create-after"; + tailf:use-in "tailf:cli-diff-modify-after"; + description + "Specify that the dependency should trigger when the target node(s) + has been modified (not created or deleted)"; + } + + extension cli-when-target-delete { + tailf:use-in "tailf:cli-diff-before"; + tailf:use-in "tailf:cli-diff-delete-before"; + tailf:use-in "tailf:cli-diff-set-before"; + tailf:use-in "tailf:cli-diff-create-before"; + tailf:use-in "tailf:cli-diff-modify-before"; + tailf:use-in "tailf:cli-diff-after"; + tailf:use-in "tailf:cli-diff-delete-after"; + tailf:use-in "tailf:cli-diff-set-after"; + tailf:use-in "tailf:cli-diff-create-after"; + tailf:use-in "tailf:cli-diff-modify-after"; + description + "Specify that the dependency should trigger when the target node(s) + has been deleted"; + } + + extension cli-diff-dependency { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:xpath-root"; + tailf:substatement "tailf:cli-trigger-on-set"; + tailf:substatement "tailf:cli-trigger-on-delete"; + tailf:substatement "tailf:cli-trigger-on-all"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:occurence "*"; + description + "Tells the 'show configuration' command, and the diff generator + that this node depends on another node. When removing the node + with this declaration, it should be removed before the node + it depends on is removed, ie the declaration controlls the ordering + of the commands in the 'show configuration' output. + + Applies to C-style"; + } + + extension cli-trigger-on-set { + tailf:use-in "tailf:cli-diff-dependency"; + description + 'Specify that the dependency should trigger on set/modify of + the target path, but deletion of the target will trigger the + current node to be placed in front of the target. + + The annotation can be used to get the diff behavior where + one leaf is first deleted before the other leaf is set. + For example, having the data model below: + + container X { + leaf A { + tailf:cli-diff-dependency "../B" { + tailf:cli-trigger-on-set; + } + type empty; + } + leaf B { + tailf:cli-diff-dependency "../A" { + tailf:cli-trigger-on-set; + } + type empty; + } + } + + produces the following diffs when setting one leaf + and deleting the other + + no X A + X B + + and + + no X B + X A + + this can also be done with list instances, for example + + list a { + key id; + + leaf id { + tailf:cli-diff-dependency "/c[id=current()/../id]" { + tailf:cli-trigger-on-set; + } + type string; + } + } + + list c { + key id; + leaf id { + tailf:cli-diff-dependency "/a[id=current()/../id]" { + tailf:cli-trigger-on-set; + } + type string; + } + } + + we get + + no a foo + c foo + ! + + and + + no c foo + a foo + ! + + In the above case if we have the same id in list "a" and "c" + and we delete the instance in one list, and add it in the other, + then the deletion will always preceed the create. + '; + } + + extension cli-trigger-on-delete { + tailf:use-in "tailf:cli-diff-dependency"; + description + "This annotation can be used togeter with tailf:cli-trigger-on-set + to also get the behavior that when deleting the target display + changes to this node first. For exmaple: + + container settings { + tailf:cli-add-mode; + + leaf opmode { + tailf:cli-no-value-on-delete; + + type enumeration { + enum nat; + enum transparent; + } + } + + leaf manageip { + when \"../opmode = 'transparent'\"; + mandatory true; + tailf:cli-no-value-on-delete; + tailf:cli-diff-dependency '../opmode' { + tailf:cli-trigger-on-set; + tailf:cli-trigger-on-delete; + } + + type string; + } + } + + What we are trying to achieve here is that if manageip is + deleted, it should be displayed before opmode, but if we + configure both opmode and manageip, we should display opmode + first, ie get the diffs: + + settings + opmode transparent + manageip 1.1.1.1 + ! + + and + + settings + no manageip + opmode nat + ! + + and + + settings + no manageip + no opmode + ! + + The cli-trigger-on-set annotation will cause the 'no manageip' + command to be displayed before setting opmode. The + tailf:cli-trigger-on-delete will cause 'no manageip' to be + placed before 'no opmode' when both are deleted. + + In the first diff where both are created, opmode will come first + due to the diff-dependency setting, regardless of the + cli-trigger-on-delete and cli-trigger-on-set. + "; + + } + + + extension cli-trigger-on-all { + tailf:use-in "tailf:cli-diff-dependency"; + description + "Specify that the dependency should always trigger. It is the + same as placing one element before another in the data model. + For example, given the data model: + + container X { + leaf A { + tailf:cli-diff-dependency '../B' { + tailf:cli-trigger-on-all; + } + type empty; + } + leaf B { + type empty; + } + } + + We get the diffs + + X B + X A + + and + + no X B + no X A + "; + } + + + extension cli-ignore-modified { + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Tells the cdb_cli_diff_iterate system call to not generate + a CLI string when this container is modified. The string will + instead be generated for the modified sub-element. + + Applies to C-style and I-style"; + } + + extension cli-show-long-obu-diffs { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + tailf:substatement "tailf:cli-reset-full" { + tailf:occurence "?"; + } + description + "Instructs the CLI engine to not generate 'insert' comments + when displaying configuration changes of ordered-by user + lists, but instead explicitly remove old instances with 'no' + and then add the instances following a newly inserted instance. + Should not be used together with tailf:cli-show-obu-comments"; + } + + extension cli-reset-full { + tailf:use-in "tailf:cli-show-long-obu-diffs"; + description + "Indicates that the list should be fully printed out on change."; + } + + extension cli-show-obu-comments { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Enforces the CLI engine to generate 'insert' comments + when displaying configuration changes of ordered-by user + lists. Should not be used together with tailf:cli-show-long-obu-diffs"; + } + + extension cli-allow-join-with-key { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-display-joined"; + description + "Indicates that the list name may be written together + with the first key, without requiring a whitespace + in between, ie allowing both + interface ethernet1/1 + and + interface ethernet 1/1 + + Used in I- and C-style CLIs."; + } + + extension cli-allow-join-with-value { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-display-joined"; + description + "Indicates that the leaf name may be written together + with the value, without requiring a whitespace + in between, ie allowing both + interface ethernet1/1 + and + interface ethernet 1/1 + + Used in I- and C-style CLIs."; + } + + + extension cli-display-joined { + tailf:use-in "tailf:cli-allow-join-with-key"; + tailf:use-in "tailf:cli-allow-join-with-value"; + description + "Specifies that the joined version should be used when displaying + the configuration in C- and I- mode."; + } + + extension cli-exit-command { + argument value { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + tailf:substatement "tailf:info"; + description + "Tells the CLI to add an explicit exit-from-submode command. + The tailf:info substatement can be used for adding a custom + info text for the command. + + Used in I- and C-style CLIs."; + } + + extension cli-explicit-exit { + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + description + "Tells the CLI to add an explicit exit command when displaying + the configuration. It will not be added if cli-exit-command + is defined as well. The annotation is inherited by all + sub-modes. + + Used in I- and C-style CLIs."; + } + + + extension cli-key-format { + argument value { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "The format string is used when parsing a key value and when + generating a key value for an existing configuration. The key + items are numbered from 1-N and the format string should + indicate how they are related by using $(X) (where X is the + key number). For example: + + tailf:cli-key-format '$(1)-$(2)' means that the first key + item is concatenated with the second key item by a '-'. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-suppress-key-sort { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Instructs the CLI engine to not sort the keys in alphabetical order + when presenting them to the user during TAB completion. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-suppress-table { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Instructs the CLI engine to not print the list as a table in + the 'show' command. + + Can be used in non-config nodes only. + + Used in I- and C-style CLIs."; + } + + extension cli-suppress-validation-warning-prompt { + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "container"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Instructs the CLI engine to not prompt the user whether to proceed + or not if a warning is generated for this node. + + Used in I- and C-style CLIs."; + } + + + extension cli-suppress-key-abbreviation { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Key values cannot be abbreviated. The user must always give + complete values for keys. + + In the J-style CLI this is relevant when using the commands + 'delete' and 'edit'. + + In the I- and C-style CLIs this is relevant when using the + commands 'no', 'show configuration' and for commands to enter + submodes. + + See also /confdConfig/cli/allowAbbrevKeys in confd.conf(5)."; + } + + extension cli-allow-key-abbreviation { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Key values can be abbreviated. + + In the J-style CLI this is relevant when using the commands + 'delete' and 'edit'. + + In the I- and C-style CLIs this is relevant when using the + commands 'no', 'show configuration' and for commands to enter + submodes. + + See also /confdConfig/cli/allowAbbrevKeys in confd.conf(5)."; + } + + extension cli-table-legend { + argument value { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies a template string to be printed before all list entries are + printed. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-table-footer { + argument value { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies a template string to be printed after all list entries are + printed. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-completion-actionpoint { + argument value { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "leaf-list"; + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-completion-id"; + description + "Specifies that completion for the leaf values is done through a + callback function. + + The argument is the name of an actionpoint, which must be + implemented by custom code. In the actionpoint, the completion() + callback function will be invoked. See confd_lib_dp(3) for details. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-completion-id { + argument value { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "tailf:cli-completion-actionpoint"; + tailf:use-in "tailf:cli-custom-range-actionpoint"; + description + "Specifies a string which is passed to the callback when invoked. + This makes it possible to use the same callback at several + locations and still keep track of which point it is invoked + from."; + } + + extension cli-allow-caching { + tailf:use-in "tailf:cli-custom-range-actionpoint"; + tailf:use-in "tailf:cli-custom-range-enumerator"; + description + "Allow caching of the evaluation results between different parent paths."; + } + + extension cli-multi-line-prompt { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Tells the CLI to automatically enter multi-line mode when prompting + the user for a value to this leaf. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-multi-word-key { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-max-words"; + description + "Specifies that the key should allow multiple tokens for the + value. Proper type restrictions needs to be used to limit + the range of the leaf value. + + Can be used in key leafs only. + + Note: This extension isn't applicable in actions + + Used in J-, I- and C-style CLIs."; + } + + extension cli-max-words { + argument value { + tailf:arg-type { + type uint32; + } + } + tailf:use-in "tailf:cli-multi-word-key"; + tailf:use-in "tailf:cli-multi-word"; + tailf:use-in "tailf:cli-multi-value"; + description + "Specifies the maximum number of allowed words for the key or value."; + } + + extension cli-allow-range { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Means that the non-integer key should allow range expressions. + + Can be used in key leafs only. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-range-delimiters { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Allows for custom delimiters to be defined for range expressions. + By default only / is considered a delimiter, ie when processing + a key like 1/2/3 then each of 1, 2 and 3 will be matched separately + agains range expressions, ie given the expression 1-3/5-6/7,8 + 1 will be matched with 1-3, 2 with 5-6, and 3 with 7,8. If, for + example, the delimiters value is set to '/.' then both '/' and + '.' will be considered delimiters and an key such as 1/2/3.4 will + consist of the enteties 1,2,3,4, all matched separately. + + Used in J-, I- and C-style CLIs."; + } + + + extension cli-suppress-range { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Means that the integer key should not allow range expressions. + + Can be used in key leafs only. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-custom-range { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-range-type" { + tailf:occurence "1"; + } + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that the key should support ranges. A type matching the + range expression must be supplied. + + Can be used in key leafs only. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-custom-range-actionpoint { + argument value { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-completion-id"; + tailf:substatement "tailf:cli-allow-caching"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that the list supports range expressions and that a custom + function will be invoked to determine if an instance belong in + the range or not. At least one key element needs a + cli-custom-range statement. + + The argument is the name of an actionpoint, which must be + implemented by custom code. In the actionpoint, the + completion() callback function will be invoked. See + confd_lib_dp(3) for details. + + When a range expression value which matches the type is given in + the CLI, the CLI engine will invoke the callback with each + existing list entry instance. If the callback returns CONFD_OK, + it matches the range expression, and if it returns CONFD_ERR, it + doesn't match. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-custom-range-enumerator { + argument value { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-completion-id"; + tailf:substatement "tailf:cli-allow-caching"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies a callback to invoke to get an array of + instances matching a regular expression. This is used + when instances should be allowed to be created using + a range expression in set. + + The callback is not used for delete or show operations. + + The callback is allowed to return a superset of all matching + instances since the instances will be filtered using the + range expression afterwards. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-range-type { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:cli-custom-range"; + description + "This statement contains the name of a derived type, possibly + with a prefix. If no prefix is given, the type must be defined in + the local module. For example: + + cli-range-type p:my-range-type; + + All range expressions must match this type, and a valid key + value must not match this type."; + } + + extension cli-allow-wildcard { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Means that the list allows wildcard expressions in the 'show' pattern. + + See also /confdConfig/cli/allowWildcard in confd.conf(5). + + Used in J-, I- and C-style CLIs."; + } + + extension cli-suppress-wildcard { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Means that the list does not allow wildcard expressions in the 'show' + pattern. + + See also /confdConfig/cli/allowWildcard in confd.conf(5). + + Used in J-, I- and C-style CLIs."; + } + + extension cli-suppress-warning { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:cli-run-template-enter"; + tailf:use-in "tailf:cli-sequence-commands"; + tailf:use-in "tailf:cli-hide-in-submode"; + tailf:use-in "tailf:cli-boolean-no"; + tailf:use-in "tailf:cli-compact-syntax"; + tailf:use-in "tailf:cli-break-sequence-commands"; + tailf:use-in "tailf:cli-show-long-obu-diffs"; + tailf:use-in "tailf:cli-show-obu-comments"; + tailf:use-in "tailf:cli-suppress-range"; + tailf:use-in "tailf:cli-suppress-mode"; + tailf:use-in "tailf:cli-custom-range"; + tailf:use-in "tailf:cli-custom-range-actionpoint"; + tailf:use-in "tailf:cli-custom-range-enumerator"; + tailf:use-in "tailf:cli-drop-node-name"; + tailf:use-in "tailf:cli-add-mode"; + tailf:use-in "tailf:cli-mode-name"; + tailf:use-in "tailf:cli-incomplete-command"; + tailf:use-in "tailf:cli-full-command"; + tailf:use-in "tailf:cli-mode-name-actionpoint"; + tailf:use-in "tailf:cli-optional-in-sequence"; + tailf:use-in "tailf:cli-prefix-key"; + tailf:use-in "tailf:cli-show-no"; + tailf:use-in "tailf:cli-show-order-tag"; + tailf:use-in "tailf:cli-diff-dependency"; + tailf:use-in "container"; + description + "Avoid involving specific CLI-extension related YANG statements in + warnings related to certain yanger error codes. For a list of + yanger error codes do 'yanger -e'. + + Used in I- and C-style CLIs."; + } + + extension cli-configure-mode { + tailf:use-in "tailf:action"; + tailf:use-in "rpc"; + description + "An action or rpc with this attribute will be available in + configure mode, but not in operational mode. + + The default is that the action or rpc is available in both + configure and operational mode. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-operational-mode { + tailf:use-in "tailf:action"; + tailf:use-in "rpc"; + description + "An action or rpc with this attribute will be available in + operational mode, but not in configure mode. + + The default is that the action or rpc is available in both + configure and operational mode. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-mount-point { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:action"; + tailf:use-in "rpc"; + description + "By default actions are mounted under the 'request' + command in the J-style CLI and at the top-level in + the I- and C-style CLIs. This annotation allowes + the action to be mounted under other top level commands"; + } + + extension cli-batch-confirm-default { + argument name { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "tailf:confirm-text"; + description + "Specifies if the default is to proceed or abort the action during batch + processing in the CLI (e.g. non-interactive mode) when a confirm-text is + set. If this value is not specified, the default value may instead be + provdied by tailf:confirm-default or by the ConfD global default if + specified in a clispec(5)."; + } + + extension cli-delayed-auto-commit { + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Enables transactions while in a specific submode (or submode of that + mode). The modifications performed in that mode will not take effect + until the user exits that submode. + + Can be used in config nodes only. If used in a container, the + container must also have a tailf:cli-add-mode statement, and if + used in a list, the list must not also have a + tailf:cli-suppress-mode statement. + + Used in I- and C-style CLIs."; + } + + extension cli-preformatted { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Suppresses quoting of non-config elements when displaying them. + Newlines will be preserved in strings etc. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-disabled-info { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies an info string that will be used as a descriptive text for the + value 'disable' (false) of boolean-typed leafs when the confd.conf(5) + setting /confdConfig/cli/useShortEnabled is set to 'true'. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-suppress-shortenabled { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Suppresses the confd.conf(5) setting /confdConfig/cli/useShortEnabled. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-trim-default { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + status deprecated; + description + "Do not display value if it is same as default. + + Used in I- and C-style CLIs."; + } + + extension cli-expose-key-name { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Force the user to enter the name of the key and display the + key name when displaying the running-configuration. + + Used in J-, I- and C-style CLIs."; + } + + + extension cli-enforce-table { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Forces the generation of a table for a list element node regardless of + whether the table will be too wide or not. This applies to the + tables generated by the auto-rendred show commands for non-config data. + + Used in I- and C-style CLIs."; + } + + extension cli-drop-node-name { + tailf:use-in "leaf"; + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that the name of a node is not present in the CLI. + + If tailf:cli-drop-node-name is given on a child to a list node, + we recommend that you also use tailf:cli-suppress-mode on that + list node, otherwise the CLI will be very confusing. + + For example, consider this data model, from the tailf-aaa module: + + list alias { + key name; + leaf name { + type string; + } + leaf expansion { + type string; + mandatory true; + tailf:cli-drop-node-name; + } + } + + If you type 'alias foo' in the CLI, you would end up in the + 'alias' submode. But since the expansion is dropped, you would + end up specifying the expansion value without typing any command. + + If, on the other hand, the 'alias' list had a + tailf:cli-suppress-mode statement, you would set an expansion + 'bar' by typing 'alias foo bar'. + + tailf:cli-drop-node-name cannot be used inside tailf:action. + + Used in I- and C-style CLIs."; + } + + extension cli-no-keyword { + tailf:use-in "leaf"; + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the name of a node is not present in the CLI. + + + Note that is must be used with some care, just + like tailf:cli-drop-node-name. The resulting data model must still + be possible to parse deterministically. + For example, consider the data model + + container interfaces { + list traffic { + tailf:cli-no-keyword; + key id; + leaf id { type string; } + leaf mtu { type uint16; } + } + list management { + tailf:cli-no-keyword; + key id; + leaf id { type string; } + leaf mtu { type uint16; } + } + } + + In this case it is impossible to determine if the config + + interfaces { + eth0 { + mtu 1400; + } + } + + Means that there should be an traffic interface instance named + 'eth0' or a management interface instance maned 'eth0'. If, on + the other hand, a restriction on the type was used, for example + + container interfaces { + list traffic { + tailf:cli-no-keyword; + key id; + leaf id { type string; pattern 'eth.*'; } + leaf mtu { type uint16; } + } + list management { + tailf:cli-no-keyword; + key id; + leaf id { type string; pattern 'lo.*';} + leaf mtu { type uint16; } + } + } + + then the problem would disappear. + + Used in the J-style CLIs."; + } + + extension cli-compact-syntax { + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Instructs the CLI engine to use the compact representation for this + node in the 'show running-configuration' command. The compact + representation means that all leaf elements are shown on a + single line. + + Cannot be used in conjunction with tailf:cli-boolean-no. + + Used in I- and C-style CLIs."; + } + + extension cli-compact-stats { + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-wrap"; + tailf:substatement "tailf:cli-width"; + tailf:substatement "tailf:cli-delimiter"; + tailf:substatement "tailf:cli-prettify"; + tailf:substatement "tailf:cli-spacer"; + description + "Instructs the CLI engine to use the compact representation for this + node. The compact representation means that all leaf elements + are shown on a single line. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-wrap { + tailf:use-in "tailf:cli-compact-stats"; + description + "If present, the line will be wrapped at screen width."; + } + + extension cli-width { + argument value { + tailf:arg-type { + type uint32; + } + } + tailf:use-in "tailf:cli-compact-stats"; + description + "Specifies a fixed terminal width to use before wrapping line. It is + only used when tailf:cli-wrap is present. If a width is not + specified the line is wrapped when the terminal width is + reached."; + } + + extension cli-delimiter { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:cli-compact-stats"; + description + "Specifies a string to print between the leaf name and its value + when displaying leaf values."; + } + + extension cli-prettify { + tailf:use-in "tailf:cli-compact-stats"; + description + "If present, dashes (-) and underscores (_) in leaf names are replaced + with spaces."; + } + + extension cli-spacer { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:cli-compact-stats"; + description + "Specifies a string to print between the nodes."; + } + + + extension cli-column-stats { + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + description + "Display leafs in the container as columns, i.e., do not repeat + the name of the container on each line, but instead indent each + leaf under the container. + + Used in I- and C-style CLIs."; + } + + extension cli-column-width { + argument value { + tailf:arg-type { + type uint32; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Set a fixed width for the column in the auto-rendered tables. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-min-column-width { + argument value { + tailf:arg-type { + type uint32; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Set a minimum width for the column in the auto-rendered tables. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-column-align { + argument value { + tailf:arg-type { + type enumeration { + enum left; + enum center; + enum right; + } + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies the alignment of the data in the column in the + auto-rendered tables. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-list-syntax { + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-multi-word"; + description + "Specifies that each entry in a leaf-list should be displayed as + a separate element. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-multi-word { + tailf:use-in "tailf:cli-list-syntax"; + tailf:substatement "tailf:cli-max-words"; + description + "Specifies that a multi-word value may be entered without quotes."; + } + + extension cli-flat-list-syntax { + tailf:use-in "leaf-list"; + tailf:substatement "tailf:cli-replace-all"; + tailf:use-in "refine"; + description + "Specifies that elements in a leaf-list should be entered without + surrounding brackets. Also, multiple elements can be added to a list + or deleted from a list. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-only-in-autowizard { + tailf:use-in "leaf"; + description + "Force leaf values to be entered in the autowizard. This + is intended to prevent users from entering passwords and + other sensitive information in plain text. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-replace-all { + tailf:use-in "leaf-list"; + tailf:use-in "tailf:cli-flat-list-syntax"; + tailf:use-in "refine"; + description + "Specifies that the new leaf-list value(s) should replace the old, + as opposed to be added to the old leaf-list."; + } + + extension cli-range-list-syntax { + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "refine"; + description + "Specifies that elements in a leaf-list or a list should be entered + without surrounding brackets and presented as ranges. The + element in the list should be separated by a comma. For + example: + + vlan 1,3,10-20,30,32,300-310 + + When this statement is used for lists, the list must have a + single key. The elements are be presented as ranges as above. + + The type of the list key, or the leaf-list, must be integer based. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-incomplete-command { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that an auto-rendered command should be considered + incomplete. Can be used to prevent from appearing in + the completion list for optional internal nodes, for example, or + to ensure that the user enters all leaf values in a container + (if used in combination with cli-sequence-commands). + + Used in I- and C-style CLIs."; + } + + extension cli-full-command { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that an auto-rendered command should be considered complete, + ie, no additional leaves or containers can be entered on the same + command line. + + Used in I- and C-style CLIs."; + } + + extension cli-sequence-commands { + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-reset-siblings"; + tailf:substatement "tailf:cli-reset-all-siblings"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that an auto-rendered command should only accept arguments + in the same order as they are specified in the YANG model. + This, in combination with tailf:cli-drop-node-name, can be used + to create CLI commands for setting multiple leafs in a container + without having to specify the leaf names. + + In almost all cases this annotation should be accompanied by the + tailf:cli-compact-syntax annotation. Otherwise the output from + 'show running-config' will not be correct, and the sequence + 'save xx' 'load override xx' will not work. + + Used in I- and C-style CLIs."; + } + + extension cli-reset-siblings { + tailf:use-in "tailf:cli-sequence-commands"; + description + "Specifies that all sibling leaves in the sequence should be reset + whenever the first leaf in the sequence is set."; + } + + extension cli-reset-all-siblings { + tailf:use-in "tailf:cli-sequence-commands"; + description + "Specifies that all sibling leaves in the container should be reset + whenever the first leaf in the sequence is set."; + } + + extension cli-reset-container { + tailf:use-in "leaf"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that all sibling leaves in the container should be + reset when this element is set. + + When used on a container its content is cleared when set."; + } + + extension cli-display-separated { + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Tells CLI engine to display this container as a separate + line item even when it has children. Only applies to + presence containers. + + Applicable for optional containers in the C- and I- style CLIs."; + } + + extension cli-delete-container-on-delete { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the parent container should be deleted when +. this leaf is deleted."; + } + + extension cli-break-sequence-commands { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that previous cli-sequence-command declaration should + stop at this point. Only applicable when a cli-sequence-command + declaration has been used in the parent container. + + Used in I- and C-style CLIs."; + } + + extension cli-strict-leafref { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the leaf should only be allowed to be assigned + references to existing instances when the command is executed. + Without this annotation the requirement is that the instance + exists on commit time. + + Used in I- and C-style CLIs."; + } + + extension cli-optional-in-sequence { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies that this element is optional in the sequence. If it + is set it must be set in the right sequence but may be skipped. + + Used in I- and C-style CLIs."; + } + + extension cli-incomplete-show-path { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-min-keys"; + description + "Specifies that a path to the show command is considered incomplete, + i.e., it needs more elements added to the path. It can also be used + to specify a minimum number of keys to be given for lists. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-min-keys { + argument value { + tailf:arg-type { + type uint32; + } + } + tailf:use-in "tailf:cli-incomplete-show-path"; + description + "Specifies the minimum number of required keys for the show command."; + } + + extension cli-hide-in-submode { + tailf:use-in "leaf"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Hide leaf when submode has been entered. Mostly useful when + leaf has to be entered in order to enter a submode. Also works + for flattened containers. + + Cannot be used in conjunction with tailf:cli-boolean-no. + + Used in I- and C-style CLIs."; + } + + extension cli-expose-ns-prefix { + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "When used force the CLI to display namespace prefix of all children."; + } + + extension cli-prefix-key { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:use-in "leaf-list"; + tailf:substatement "tailf:cli-before-key"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "This leaf has to be given as a prefix before entering the actual + list keys. Very backwards but a construct that exists in some + Cisco CLIs. + + The construct can be used also for leaf-lists but only when + then tailf:cli-range-list-syntax is also used. + + Used in I- and C-style CLIs."; + } + + extension cli-before-key { + argument value { + tailf:arg-type { + type uint32; + } + } + tailf:use-in "tailf:cli-prefix-key"; + description + "Specifies before which key the prefix element should be inserted. + The first key has number 1."; + } + + extension cli-show-with-default { + tailf:use-in "leaf"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + description + "This leaf will be displayed even when it has its default value. + Note that this will somewhat result in a slightly different behaviour + when you save a config and then load it again. With this setting + in place a leaf that has not been configured will be configured + after the load. + + Used in I- and C-style CLIs."; + } + + extension cli-oper-info { + argument text { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "rpc"; + tailf:use-in "identity"; + tailf:use-in "tailf:action"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "This statement works exactly as tailf:info, with the exception + that it is used when displaying the element info in the context + of stats. + + Both tailf:info and tailf:cli-oper-info can be present at the same + time."; + } + + extension cli-case-sensitive { + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + description + "Specifies that this node is case-sensitive. + If applied to a container or a list, any nodes below will + also be case-sensitive. + + This negates the cli-case-insensitive extension (see below). + + Note that this will override any case-sensitivity settings + configured in confd.conf"; + } + + extension cli-case-insensitive { + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + description + "Specifies that node is case-insensitive. If applied to a container or + a list, any nodes below will also be case-insensitive. + + Node names are discovered without care of the case. Also affect + matching of key values in lists. However it doesn't affect the + storing of a leaf value. E.g. a modification of a leaf value from + upper case to lower case is still considered a modification of + data. + + Note that this will override any case-insensitivity settings + configured in confd.conf"; + } + + extension cli-custom-error { + argument text { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "This statement specifies a custom error message to be displayed + when the user enters an invalid value."; + } + + extension cli-full-show-path { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-max-keys"; + description + "Specifies that a path to the show command is considered complete, i.e., + no more elements can be added to the path. It can also be used to + specify a maximum number of keys to be given for lists. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-max-keys { + argument value { + tailf:arg-type { + type uint32; + } + } + tailf:use-in "tailf:cli-full-show-path"; + description + "Specifies the maximum number of allowed keys for the show command."; + } + + extension cli-suppress-show-path { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "Specifies that the show command cannot be invoked with the path, + ie the path is suppressed when auto-rendering show commands for + config='false' data. + + Used in J-, I- and C-style CLIs."; + } + + + extension cli-suppress-show-match { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "Specifies that a specific completion match (i.e., a filter match that + appear at list nodes as an alternative to specifying a single + instance) to the show command should not be available. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-suppress-list-no { + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the CLI should not accept deletion of the entire list + or leaf-list. Only specific instances should be deletable not the + entire list in one command. ie, 'no foo ' should be allowed + but not 'no foo'. + + Used in I- and C-style CLIs."; + } + + extension cli-suppress-no { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "Specifies that the CLI should not auto-render 'no' commands for + this element. An element with this annotation will not appear in the + completion list to the 'no' command. + + Used in I- and C-style CLIs."; + } + + extension cli-suppress-silent-no { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "Specifies that the confd.cnof directive cSilentNo should be + suppressed for a leaf and that a custom error message should + be displayed when the user attempts to delete a non-existing + element. + + Used in I- and C-style CLIs."; + } + + + extension cli-full-no { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "Specifies that an auto-rendered 'no'-command should be considered complete, + ie, no additional leaves or containers can be entered on the same + command line. + + Used in I- and C-style CLIs."; + } + + extension cli-incomplete-no { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that an auto-rendered 'no'-command should not be considered + complete, ie, additional leaves or containers must be entered on the same + command line. + + Used in I- and C-style CLIs."; + } + + extension cli-no-match-completion { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the CLI engine should not provide match completion + for the key leafs in the list. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-suppress-show-conf-path { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the show running-config command cannot be invoked with + the path, ie the path is suppressed when auto-rendering show running- + config commands for config='true' data. + + Used in J-, I- and C-style CLIs."; + } + + + extension cli-no-key-completion { + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies that the CLI engine should not perform completion for key + leafs in the list. This is to avoid querying the data provider + for all existing keys. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-instance-info-leafs { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "This statement is used to specifiy how list entries are displayed + when doing completion in the CLI. By default, a list entry is + displayed by listing its key values, and the value of a leaf + called 'description', if such a leaf exists in the list entry. + + The 'cli-instance-info-leafs' statement takes as its argument a + space separated string of leaf names. When a list entry is + displayed, the values of these leafs are concatenated with a + space character as separator and shown to the user. + + For example, when asked to specify an interface the CLI will + display a list of possible interface instances, say 1 2 3 4. If + the cli-instance-info-leafs property is set to 'description' then + the CLI might show: + + Possible completions: + 1 - internet + 2 - lab + 3 - dmz + 4 - wlan + + Used in J-, I- and C-style CLIs."; + } + + extension cli-multi-value { + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-max-words"; + description + "Specifies that all remaining tokens on the command line + should be considered a value for this leaf. This prevents + the need for quoting values containing spaces, but also + prevents multiple leaves from being set on the same command + line once a multi-value leaf has been given on a line. + + If the tailf:cli-max-words substatements is used then + additional leaves may be entered. + + Note: This extension isn't applicable in actions + + Used in I- and C-style CLIs."; + } + + extension cli-value-display-template { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "leaf"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies a template string to be used when formating the + value of a leaf for display. Note that other leaves cannot + be referenced from a display template of one leaf. The only + value accessible is the leaf's own value, accessed through + $(.). + + See the defintion of cli-template-string for more info. + + Used in J-, I- and C-style CLIs."; + } + + + extension cli-show-template { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-auto-legend"; + description + "Specifies a template string to be used by the 'show' command in + operational mode. It is primarily intended for displaying + non-config data but config data may be included in the template + as well. + + See the defintion of cli-template-string for more info. + + Some restrictions includes not applying templates on a leaf that + is the key in a list. It is recommended to use the template + directly on the list to format the whole list instead. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-auto-legend { + tailf:use-in "tailf:cli-show-template"; + description + "Specifies that the legend should be automatically rendered if not " + +"already displayed. Useful when using templates for rendering " + +"tables."; + } + + extension cli-show-template-legend { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "list"; + tailf:use-in "refine"; + description + + "Specifies a template string to be printed before all list entries are + printed. + + See the defintion of cli-template-string for more info. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-show-template-enter { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies a template string to be printed before each list entry is + printed. + + See the defintion of cli-template-string for more info. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-show-template-footer { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + + "Specifies a template string to be printed after all list entries are + printed. + + See the defintion of cli-template-string for more info. + + Used in J-, I- and C-style CLIs."; + } + + extension cli-run-template { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Specifies a template string to be used by the 'show running-config' + command in operational mode. It is primarily intended for displaying + config data but non-config data may be included in the template + as well. + + See the defintion of cli-template-string for more info. + + Used in I- and C-style CLIs."; + } + + extension cli-run-template-legend { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + + "Specifies a template string to be printed before all list entries are + printed. + + See the defintion of cli-template-string for more info. + + Used in I- and C-style CLIs."; + } + + extension cli-run-template-enter { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:cli-suppress-warning" { + tailf:occurence "*"; + } + description + "Specifies a template string to be printed before each list entry is + printed. + + When used on a container it only has effect when the container + also has a tailf:cli-add-mode, and when tailf:cli-show-no isn't + used on the container. + + See the defintion of cli-template-string for more info. + + The variable .reenter is set to 'true' when the 'show configuration' + command is executed and the list or container isn't created. This + allow, for example, to display + + create foo + + when an instance is created + + edit foo + + when something inside the instance is modified. + + Used in I- and C-style CLIs."; + } + + extension cli-run-template-footer { + argument value { + yin-element true; + tailf:arg-type { + type tailf:cli-template-string; + } + } + tailf:use-in "list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + + "Specifies a template string to be printed after all list entries are + printed. + + See the defintion of cli-template-string for more info. + + Used in I- and C-style CLIs."; + } + + typedef cli-template-string { + type string; + description + "A template is a text string which is expanded by the CLI engine, + and then displayed to the user. + + The template may contain a mix of text and expandable entries. + Expandable entries all start with $( and end with a matching ). + Parentheses and dollar signs need to be quoted in plain text. + + (Disclaimer: tailf:cli-template-string will not respect + all CLI YANG extensions existing from expandable entries. + For instance, tailf:cli-no-name-on-delete will have no + effect when the value of a node with this extension is + fetched as a result of expanding CLI templates.) + + The template is expanded as follows: + + A parameter is either a relative or absolute path to a leaf + element (eg /foo/bar, foo/bar), or one of the builtin variables: + .selected, .entered, .legend_shown, .user, .groups, .ip, + .display_groups, .path, .ipath or .licounter. In addition the + variables .spath and .ispath are available when a command + is executed from a show path. + + .selected + + The .selected variable contains the list of selected paths + to be shown. The show template can inspect this element to + determine if a given element should be displayed or + not. For example: + + $(.selected~=hwaddr?HW Address) + + .entered + + The .entered variable is true if the \"entered\" text has + been displayed (either the auto generated text or a + showTemplateEnter). This is useful when having a non-table + template where each instance should have a text. + + $(.entered?:host $(name)) + + .legend_shown + + The .legend_shown variable is true if the \"legend\" text has + been displayed (either the auto generated table header or + a showTemplateLegend). This is useful to inspect when + displaying a table row. If the user enteres the path to a + specific instance the builtin table header will not be + displayed and the showTemplateLegend will not be invoked + and it may be useful to render the legend specifically + for this instance. + + $(.legend_shown!=true?Address Interface) + + .user + + The .user variable contains the name of the current + user. This can be used for differentiating the content + displayed for a specific user, or in paths. For exapmle: + + $(user{$(.user)}/settings) + + .groups + + The .groups variable contains the a list of groups that the + user belongs to. + + .display_groups + + The .display_groups variable contains a list of selected + display groups. This can be used to display different + content depending on the selected display group. For + example: + + $(.display_groups~=details?details...) + + .ip + + The .ip variable contains the ip address that the user + connected from. + + .path + + The .path variable contains the path to the entry, + formated in CLI style. + + .ipath + + The .ipath variable contains the path to the entry, + formated in template style. + + .spath + + The .spath variable contains the show path, + formated in CLI style. + + .ispath + + The .ispath variable contains the show path, + formated in template style. + + .licounter + + The .licounter variable contains a counter that is + incremented for each instance in a list. This means that + it will be 0 in the legend, contain the total number of + list instances in the footer and something in between in + the basic show template. + + $(parameter) + + The value of 'parameter' is substituted. + + $(cond?word1:word2) + + The expansion of 'word1' is substituted if 'cond' + evaluates to true, otherwise the expansion of 'word2' is + substituted. + + 'cond' may be one of + + parameter + + Evaluates to true if the node exists. + + parameter == + + Evaluates to true if the value of the parameter equals + . + + parameter != + + Evalutes to true if the value of the parameter does not + equal + + parameter ~= + + Provided that the value of the parameter is a list + (i.e., the node that the parameter refers to is a + leaf-list), this expression evaluates to true if + is a member of the list. + + Note that it is also possible to omit ':word2' in + order to print the entire statement, or nothing. + As an example $(conf?word1) will print 'word1' if conf + exists, otherwise it will print nothing. + + $(cond??word1) + + Double question marks can be used to achieve the same effect + as above, but with the distinction that the 'cond' variable + needs to be explicitly configured, in order to be evaluated + as existing. This is needed in the case of evaluating leafs + with default values, where the single question mark operator + would evaluate to existing even if not explicitly configured. + + $(parameter|filter) + + The value of 'parameter' processed by 'filter' is + substituted. Filters may be either one of the + built-ins or a customized filter defined in a + callback. See /confdConfig/cli/templateFilter. + + A built-in 'filter' may be one of: + + capfirst + + Capitalizes the first character of the value. + + lower + + Converts the value into lowercase. + + upper + + Converts the value into uppercase. + + filesizeformat + + Formats the value in a human-readable format (e.g., + '13 KB', '4.10 MB', '102 bytes' etc), where K + means 1024, M means 1024*1024 etc. + + When used without argument the default number of + decimals displayed is 2. When used with a numeric + integer argument, filesizeformat will display the + given number of decimal places. + + humanreadable + + Similar to filesizeformat except no bytes suffix + is added (e.g., '13.00 k', '4.10 M' '102' etc), + where k means 1000, M means 1000*1000 etc. + + When used without argument the default number of + decimals displayed is 2. When used with a numeric + integer argument, humanreadable will display the + given number of decimal places. + + commasep + + Separate the numerical values into groups of three + digits using a comma (e.g., 1234567 -> 1,234,567) + + hex + + Display integer as hex number. An argument can be + used to indicate how many digits should be used in + the output. If the hex number is too long it will + be truncated at the front, if it is too short it will + be padded with zeros at the front. If the width is + a negative number then at most that number of digits + will be used, but short numbers will not be padded + with zeroes. Another argument can be given to indicate + if the hex numbers should be written with lower + or upper case. + + For example: + + value Template Output + 12345 {{ value|hex }} 3039 + 12345 {{ value|hex:2 }} 39 + 12345 {{ value|hex:8 }} 00003039 + 12345 {{ value|hex:-8 }} 3039 + 14911 {{ value|hex:-8:upper }} 3A3F + 14911 {{ value|hex:-8:lower }} 3a3f + + hexlist + + Display integer as hex number with : between pairs. An + argument can be used to indicate how many digits should + be used in the output. If the hex number is too long it + will be truncated at the front, if it is too short it will + be padded with zeros at the front. If the width is + a negative number then at most that number of digits + will be used, but short numbers will not be padded + with zeroes. Another argument can be given to indicate + if the hex numbers should be written with lower + or upper case. + + For example: + + value Template Output + 12345 {{ value|hexlist }} 30:39 + 12345 {{ value|hexlist:2 }} 39 + 12345 {{ value|hexlist:8 }} 00:00:30:39 + 12345 {{ value|hexlist:-8 }} 30:39 + 14911 {{ value|hexlist:-8:upper }} 3A:3F + 14911 {{ value|hexlist:-8:lower }} 3a:3f + + floatformat + + Used for type 'float' in tailf-xsd-types. We recommend + that the YANG built-in type 'decimal64' is used instead of + 'float'. + + When used without an argument, rounds a floating-point + number to one decimal place -- but only if there is a + decimal part to be displayed. + + For example: + + value Template Output + 34.23234 {{ value|floatformat }} 34.2 + 34.00000 {{ value|floatformat }} 34 + 34.26000 {{ value|floatformat }} 34.3 + + If used with a numeric integer argument, floatformat + rounds a number to that many decimal places. For example: + + value Template Output + 34.23234 {{ value|floatformat:3 }} 34.232 + 34.00000 {{ value|floatformat:3 }} 34.000 + 34.26000 {{ value|floatformat:3 }} 34.260 + + If the argument passed to floatformat is negative, it will + round a number to that many decimal places -- but only if + there's a decimal part to be displayed. For example: + + value Template Output + 34.23234 {{ value|floatformat:-3 }} 34.232 + 34.00000 {{ value|floatformat:-3 }} 34 + 34.26000 {{ value|floatformat:-3 }} 34.260 + + Using floatformat with no argument is equivalent to using + floatformat with an argument of -1. + + ljust:width + + Left-align the value given a width. + + rjust:width + + Right-align the value given a width. + + trunc:width + + Truncate value to a given width. + + lower + + Convert the value into lowercase. + + upper + + Convert the value into uppercase. + + show: + + Substitutes the result of invoking the default display + function for the parameter. The dictionary can be used + for introducing own variables that can be accessed in + the same manner as builtin variables. The user defined + variables overrides builtin variables. The dictionary + is specified as a string on the following form: + + (key=value)(:key=value)* + + For example, with the following expression: + + $(foo|show:myvar1=true:myvar2=Interface) + + the user defined variables can be accessed like this: + + $(.myvar1!=true?Address) $(.myvar2) + + A special case is the dict variable 'indent'. It + controls the indentation level of the displayed path. + The current indent level can be incremented and + decremented using =+ and =-. + + For example: + + $(foobar|show:indent=+2) + $(foobar|show:indent=-1) + $(foobar|show:indent=10) + + Another special case is he dict variable 'noalign'. + It may be used to suppress the default aligning that + may occur when displaying an element. + + For example: + + $(foobar|show:noalign) + + dict: + + Translates the value using the dictionary. Can for + example be used for displaying on/off instead of + true/false. The dictionary is specified as a string on + the following form: + + (key=value)(:key=value)* + + For example, with the following expression: + + $(foo|dict:true=on:false=off) + + if the leaf 'foo' has value 'true', it is displayed as 'on', and + if its value is 'false' it is displayed as 'off'. + + Nested invocations are allowed, ie it is possible to have expressions + like $((state|dict:yes=Yes:no=No)|rjust:14), or $(/foo{$(../bar)}) + + + For example: + + list interface { + key name; + leaf name { ... } + leaf status { ... } + container line { + leaf status { ... } + } + leaf mtu { ... } + leaf bw { ... } + leaf encapsulation { ... } + leaf loopback { ... } + tailf:cli-show-template + '$(name) is administratively $(status),' + + ' line protocol is $(line/status)\\n' + + 'MTU $(mtu) bytes, BW $(bw|humanreadable)bit, \\n' + + 'Encap $(encapsulation|upper), $(loopback?:loopback not set)\\n'; + }"; + } +} diff --git a/explorer/src/main/resources/tailf-common.yang b/explorer/src/main/resources/tailf-common.yang new file mode 100644 index 0000000..fe04ec3 --- /dev/null +++ b/explorer/src/main/resources/tailf-common.yang @@ -0,0 +1,3505 @@ +module tailf-common { + namespace "http://tail-f.com/yang/common"; + prefix tailf; + + include tailf-meta-extensions { + revision-date 2017-03-08; + } + + include tailf-cli-extensions { + revision-date 2017-08-23; + } + + organization "Tail-f Systems"; + + description + "This module defines all Tail-f YANG extensions statements + and common YANG types."; + + revision 2017-08-23 { + description + "Released as part of ConfD-6.4.3 / NCS-4.4.3. + + Included latest revision of tailf-cli-extensions."; + } + + revision 2017-03-08 { + description + "Released as part of ConfD-6.4 / NCS-4.4. + + Added tailf:ned-ignore-compare-config. + + Added tailf:ned-default-handling. + + Corrected the pattern for the tailf:size typedef. + + Updated the description for tailf:meta-data and tailf:meta-value. + + Included latest revision of tailf-cli-extensions and + tailf-meta-extensions submodules."; + } + + revision 2017-01-26 { + description + "Released as part of ConfD-6.3 / NCS-4.3. + + Included latest revision of tailf-cli-extensions."; + } + + revision 2016-11-24 { + description + "Released as part of ConfD-6.3 / NCS-4.3. + + Included latest revision of tailf-cli-extensions and + tailf-meta-extensions submodules."; + } + + revision 2016-11-17 { + description + "Released as part of ConfD-6.2.2 / NCS-4.2.2. + + Changed tailf:ned-data."; + } + + revision 2016-05-27 { + description + "Released as part of ConfD-6.2.1 / NCS-4.2.1. + + Added tailf:override-auto-dependencies. + + Added tailf:ned-data. + + Allow 'grouping', 'if-feature', and 'typedef' as substatements + to tailf:action."; + } + + revision 2016-05-04 { + description + "Released as part of ConfD-6.2 / NSO-4.2 + + Added tailf:meta-data. + Added tailf:meta-value. + + Added tailf:no-leafref-check. + + Allow tailf:ncs-device-type as substatement to 'module'. + + Allow multiple tailf:display-when statments. + + Updated the description of des3-cbc-encrypted-string and + aes-cfb-128-encrypted-string."; + } + + revision 2015-11-24 { + description + "Released as part of ConfD-6.1 / NCS-4.1. + + Allow reference as substatement to tailf:action."; + } + + revision 2015-05-22 { + description + "Released as part of ConfD-5.4.2 / NCS-3.4.2. + + Allow tailf:export and tailf:unique-selector in + tailf:annotate-module."; + } + + revision 2015-03-19 { + description + "Released as part of ConfD-5.4 / NCS-3.4. + + Added if-feature as substatement to tailf:annotate. + + Added tailf:no-dependency. + + Updated the description for tailf:dependency. + + Allow tailf:id-value as substatement to 'module', + tailf:annotate-module, 'choice', and 'case'."; + } + + revision 2014-11-13 { + description + "Released as part of ConfD-5.3 / NCS-3.3. + + Added tailf:export."; + } + + revision 2014-06-30 { + description + "Released as part of ConfD-5.2 / NCS-3.2. + + Added tailf:sha-256-digest-string and tailf:sha-512-digest-string."; + } + + revision 2014-03-27 { + description + "Released as part of ConfD-5.1 / NCS-3.1. + + Added tailf:actionpoint as substatement to refine. + Removed must as substatement to tailf:symlink."; + } + + revision 2014-02-20 { + description + "Released as part of ConfD-5.0.2 / NCS-3.0.2. + + Added tailf:snmp-ned-recreate-when-modified."; + } + + revision 2013-12-23 { + description + "Released as part of ConfD-5.0.1 / NCS-3.0.1. + + Allow 'unique' in tailf:annotate and tailf:annotate-statement. + + Added tailf:snmp-ned-delete-before-create."; + } + + revision 2013-11-07 { + description + "Released as part of ConfD-5.0 / NCS-3.0. + + Allow tailf:code-name as substatement to 'bit'. + + Disallow tailf:id-value as substatement to 'enum'. Use the + standard YANG 'value' statement instead. + + Deprecated tailf:hex-list. Use yang:hex-string instead. + There are no plans to remove tailf:hex-list. + + Added the types tailf:ipv4-address-and-prefix-length, + tailf:ipv6-address-and-prefix-length, and + tailf:ip-address-and-prefix-length,"; + } + + revision 2013-09-05 { + description + "Released as part of ConfD-4.3. + + Added tailf:auto-compact as substatement to tailf:indexed-view."; + } + + revision 2013-06-14 { + description + "Released as part of ConfD-4.3. + + Deprecated tailf:symlink. Use tailf:link instead. + + Allow tailf:alt-name as substatement to tailf:action and rpc. + + Allow status as substatement to tailf:action. + + Allow description in tailf:annotate and tailf:annotate-statement."; + } + + revision 2013-05-16 { + description + "Released as part of ConfD-4.2.2. + + Added tailf:link"; + } + + revision 2013-03-07 { + description + "Released as part of ConfD-4.2. + + Allow 'pattern' in tailf:annotate-statement."; + } + + revision 2012-11-08 { + description + "Released as part of ConfD-4.1. + + Added tailf:unique-selector and tailf:unique-leaf. + + Allow tailf:info in bit. + + Allow tailf:code-name as substatement to all statements that + define data nodes in the schema tree and the 'rpc', + 'notification', 'identity', and 'tailf:action' statements. + + Allow status in tailf:symlink"; + } + + revision 2012-08-23 { + description + "Released as part of ConfD-4.0.1. + + Allow tailf:cli-operational-mode and tailf:cli-configure-mode in + rpc."; + } + + revision 2012-06-14 { + description + "Released as part of ConfD-4.0. + + Added tailf:display-hint."; + } + + revision 2012-05-24 { + description + "Released as part of ConfD-3.9.2."; + } + + revision 2012-03-08 { + description + "Released as part of ConfD-3.9. + + Added tailf:timeout. + Added tailf:non-strict-leafref."; + } + + revision 2011-12-08 { + description + "Released as part of ConfD-3.8. + + Allow validation statements in tailf:annotate and + tailf:annotate-statement. + + Allow tailf:validate in must, in order to override the evaluation + of the must expression with a callback function. + + Disallow tailf:info in range, length and pattern. + + Added tailf:snmp-ned-* statements to control the SNMP NED + behavior in NCS."; + } + + revision 2011-10-20 { + description + "Released as part of ConfD-3.7.1. + + Added tailf:priority."; + } + + revision 2011-09-22 { + description + "Released as part of ConfD-3.7. + + Allow tailf:typepoint as substatement to leaf and leaf-list. + Allow tailf:id as substatement to tailf:annotate-module. + Allow tailf:sort-priority as substatement to tailf:symlink. + Added tailf:interruptibale. + Added tailf:error-info. + Added tailf:snmp-delete-value and tailf:snmp-send-delete-value. + Added tailf:step. + Added tailf:annotate-statement. + + Clarified how tailf:display-when is evaluated for lists."; + } + + revision 2011-08-25 { + description + "Released as part of ConfD-3.6.2. + + Included latest tailf-cli-extension submodule."; + } + + revision 2011-06-30 { + description + "Released as part of ConfD-3.6.1. + + Clarified what statements are allowed in tailf:annotate and + tailf:annotate-module. Specifically, that 'symlink' and 'action' + are not allowed."; + } + + revision 2011-05-26 { + description + "Released as part of ConfD-3.6. + + Allow multiple tailf:snmp-name on leafs that represent MIB scalars."; + } + + revision 2011-03-31 { + description + "Released as part of ConfD-3.5.1. + + Allow tailf:alt-name as substatement to tailf:symlink."; + } + + revision 2011-02-24 { + description + "Released as part of ConfD-3.5. + + Allow tailf:info as substatement to type. + Added tailf:writable. + Removed the deprecated tailf:cli-default-order statement. + Removed the deprecated tailf:instance-info-leafs statement."; + } + + revision 2010-11-04 { + description + "Released as part of ConfD-3.4. + + Added tailf:snmp-exclude-object. + Allow tailf:hidden as substatement to tailf:symlink. + Allow multiple tailf:hidden statements to be specified on a node. + Allow special value '*' ar argument to tailf:annotate."; + } + + + revision 2010-09-16 { + description + "Released as part of ConfD-3.3.2. + + Included latest tailf-cli-extension submodule."; + } + + revision 2010-08-19 { + description + "Released as part of ConfD-3.3.1. + + Allow multiple tailf:snmp-name statements, and expanded the + semantic meaning of this statement."; + } + + revision 2010-07-21 { + description + "Released as part of ConfD-3.3.0.3. + + Added tailf:sort-priority."; + } + + revision 2010-06-17 { + description + "Released as part of ConfD-3.3. + + Added tailf:value-length. + + Added tailf:info-html. + + Added tailf:display-default-order, and deprecated + tailf:cli-default-order. + + Added tailf:dependency as a substatement to when. + + Removed the deprecated statements tailf:constant-leaf and + tailf:constant-value."; + } + + revision 2010-04-22 { + description + "Released as part of ConfD-3.2.1. + + Added tailf:invocation-mode, + + Fixed bug in tailf:octet-list pattern."; + } + + revision 2010-03-18 { + description + "Released as part of ConfD-3.2. + + Split this module into the main module and two submodules, + tailf-meta-extensions, and tailf-cli-extensions. + + Added many tailf:cli- statements in the submodule + tailf-cli-extensions. + + Added tailf:info. + + Allow tailf:display-when in tailf:action. + + Added tailf:snmp-lax-type-check. + + Deprecated tailf:instance-info-leafs. Use + tailf:cli-instance-info-leafs instead. + + Removed the argument in tailf:cli-show-no to better match + all the other tailf:cli- statements."; + } + + revision 2010-01-28 { + description + "Released as part of ConfD-3.1.1. + + Allow tailf:snmp-oid and tailf:snmp-name in tailf:symlink. + + Added tailf:key-default. + + Allow tailf:suppress-echo in leaf and leaf-list."; + } + + revision 2009-12-17 { + description + "Released as part of ConfD-3.1. + + Added tailf:dependency as a substatement to must. + + Added must and tailf:display-when as children to tailf:symlink. + + Added tailf:interrupt to tailf:exec. + + Allow many tailf statement as substatements to 'refine'. + + Allow tailf:symlink statement in 'augment' and 'case'. + + Added tailf:internal to tailf:actionpoint. + + Deprecated tailf:constant-leaf and tailf:constant-value."; + } + + revision 2009-11-06 { + description + "Released as part of ConfD-3.0.1. + + Added tailf:annotate-module statement. + + Added tailf:code-name statement. + + Clarified the tailf:path-filters statement, and added + tailf:no-subtree-match."; + } + + revision 2009-10-01 { + description + "Released as part of ConfD-3.0. + + Clarified that tailf:annotate is applied on the expanded tree. + Bugfixes in some typedef patterns."; + } + + revision 2009-03-17 { + description + "Released as part of ConfD-2.8. + + Changed module name from tailf-extensions to reflect the content + better."; + } + + /* + * Common types, natively supported by ConfD. + */ + + typedef size { + type string { + pattern + 'S(\d+G)?(\d+M)?(\d+K)?(\d+B)?'; + } + description + "A value that represents a number of bytes. An example could be + S1G8M7K956B; meaning 1GB + 8MB + 7KB + 956B = 1082138556 bytes. + The value must start with an S. Any byte magnifier can be left + out, e.g. S1K1B equals 1025 bytes. The order is significant + though, i.e. S1B56G is not a valid byte size. + + In ConfD, a 'size' value is represented as an uint64."; + } + + typedef octet-list { + type string { + pattern '(\d*(.\d*)*)?'; + } + description + "A list of dot-separated octets e.g. '192.168.255.1.0'. + + The statement tailf:value-length can be used to restrict the number + of octets. Note that using the 'length' restriction limits the + number of characters in the lexical representation."; + } + + typedef md5-digest-string { + type string; + description + "The md5-digest-string type automatically computes a MD5 digest for + a value adhering to this type. + + This is best explained using an example. Suppose we have a + leaf: + + leaf key { + type tailf:md5-digest-string; + } + + A valid configuration is: + + $0$In god we trust. + + The '$0$' prefix signals that this is plain text. When a plain + text value is received by the server, an MD5 digest is + calculated, and the string '$1$$' is prepended to the + result, where is a random eight character salt used to + generate the digest. This value is stored in the configuration + data store. + + When a value of this type is read, the computed MD5 value is + always returned. In the example above, the following value + could be returned: + + $1$fB$ndk2z/PIS0S1SvzWLqTJb. + + If a value starting with '$1$' is received, the server + knows that the value already represents an MD5 digest, and + stores it as is in the data store. + + A value adhering to this type must have a '$0$' or a + '$1$$' prefix. + + If a default value is specified, it must have a '$1$$' prefix. + + The digest algorithm used is the same as the md5 crypt function + used for encrypting passwords for various UNIX systems, see e.g. + http://www.freebsd.org/cgi/cvsweb.cgi/~checkout/~/src/lib/libcrypt/crypt.c + "; + reference + "IEEE Std 1003.1-2008 - crypt() function + RFC 1321 - The MD5 Message-Digest Algorithm"; + } + + typedef sha-256-digest-string { + type string { + pattern + '$0$.*' + + '|$5$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{43}'; + } + description + "The sha-256-digest-string type automatically computes a SHA-256 + digest for a value adhering to this type. + + A value of this type matches one of the forms: + + $0$ + $5$$ + $5$rounds=$$ + + The '$0$' prefix signals that this is plain text. When a plain + text value is received by the server, a SHA-256 digest is + calculated, and the string '$5$$' is prepended to the + result, where is a random 16 character salt used to + generate the digest. This value is stored in the configuration + data store. The algorithm can be tuned via the + /confdConfig/cryptHash/rounds parameter, which if set to a number + other than the default will cause '$5$rounds=$$' to + be prepended instead of only '$5$$'. + + If a value starting with '$5$' is received, the server + knows that the value already represents a SHA-256 digest, and + stores it as is in the data store. + + If a default value is specified, it must have a '$5$' prefix. + + The digest algorithm used is the same as the SHA-256 crypt function + used for encrypting passwords for various UNIX systems, see e.g. + http://www.akkadia.org/drepper/SHA-crypt.txt"; + reference + "IEEE Std 1003.1-2008 - crypt() function + FIPS.180-3.2008: Secure Hash Standard"; + } + + typedef sha-512-digest-string { + type string { + pattern + '$0$.*' + + '|$6$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{86}'; + } + + description + "The sha-512-digest-string type automatically computes a SHA-512 + digest for a value adhering to this type. + + A value of this type matches one of the forms: + + $0$ + $6$$ + $6$rounds=$$ + + The '$0$' prefix signals that this is plain text. When a plain + text value is received by the server, a SHA-512 digest is + calculated, and the string '$6$$' is prepended to the + result, where is a random 16 character salt used to + generate the digest. This value is stored in the configuration + data store. The algorithm can be tuned via the + /confdConfig/cryptHash/rounds parameter, which if set to a number + other than the default will cause '$6$rounds=$$' to + be prepended instead of only '$6$$'. + + If a value starting with '$6$' is received, the server + knows that the value already represents a SHA-512 digest, and + stores it as is in the data store. + + If a default value is specified, it must have a '$6$' prefix. + + The digest algorithm used is the same as the SHA-512 crypt function + used for encrypting passwords for various UNIX systems, see e.g. + http://www.akkadia.org/drepper/SHA-crypt.txt"; + reference + "IEEE Std 1003.1-2008 - crypt() function + FIPS.180-3.2008: Secure Hash Standard"; + } + + typedef des3-cbc-encrypted-string { + type string; + description + "The des3-cbc-encrypted-string type automatically encrypts a value + adhering to this type using DES in CBC mode followed by a base64 + conversion. If the value isn't encrypted already, that is. + + This is best explained using an example. Suppose we have a leaf: + + leaf enc { + type tailf:des3-cbc-encrypted-string; + } + + A valid configuration is: + + $0$In god we trust. + + The '$0$' prefix signals that this is plain text. When a plain + text value is received by the server, the value is DES3/Base64 + encrypted, and the string '$7$' is prepended. The resulting + string is stored in the configuration data store. + + When a value of this type is read, the encrypted value is always + returned. In the example above, the following value could be + returned: + + $7$Qxxsn8BVzxphCdflqRwZm6noKKmt0QoSWnRnhcXqocg= + + If a value starting with '$7$' is received, the server knows + that the value is already encrypted, and stores it as is in the + data store. + + A value adhering to this type must have a '$0$' or a '$7$' prefix. + + ConfD uses a configurable set of encryption keys to encrypt the + string. For details, see 'encryptedStrings' in the + confd.conf(5) manual page."; + } + + typedef aes-cfb-128-encrypted-string { + type string; + description + "The aes-cfb-128-encrypted-string works exactly like + des3-cbc-encrypted-string but AES/128bits in CFB mode is used to + encrypt the string. The prefix for encrypted values is '$8$'."; + } + + typedef ipv4-address-and-prefix-length { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-address-and-prefix-length type represents a combination + of an IPv4 address and a prefix length. The prefix length is given + by the number following the slash character and must be less than + or equal to 32."; + } + + typedef ipv6-address-and-prefix-length { + type string { + pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' + + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-address-and-prefix-length type represents a combination + of an IPv6 address and a prefix length. The prefix length is given + by the number following the slash character and must be less than + or equal to 128."; + } + + typedef ip-address-and-prefix-length { + type union { + type tailf:ipv4-address-and-prefix-length; + type tailf:ipv6-address-and-prefix-length; + } + description + "The ip-address-and-prefix-length type represents a combination of + an IP address and a prefix length and is IP version neutral. The + format of the textual representations implies the IP version."; + } + + + /* + * Meta extensions + */ + + extension export { + argument agent { + tailf:arg-type { + type union { + type enumeration { + enum "none"; + enum "netconf"; + enum "rest"; + enum "cli"; + enum "snmp"; + enum "webui"; + } + type string; + } + } + } + tailf:use-in "module"; + tailf:occurence "*"; + + description + "Makes this data model visible in the northbound interface 'agent'. + + This statement makes it possible to have a data model visible + through some northbound interface but not others. For example, + if a MIB is used to generate a YANG module, the resulting YANG + module can be exposed through SNMP only. + + Use the special agent 'none' to make the data model completely + hidden to all notherbound interfaces. + + The agent can also be a free-form string. In this case, the data + model will be visible to maapi applications using this string as its + 'context'."; + } + + extension annotate { + argument target { + tailf:arg-type { + type string; + } + } + tailf:use-in "module"; + tailf:use-in "submodule"; + tailf:occurence "*"; + + tailf:substatement "tailf:annotate" { + tailf:occurence "*"; + } + tailf:substatement "if-feature" { + tailf:occurence "*"; + } + description + "Annotates an existing statement with a 'tailf' statement or a + validation statement. This is useful in order to add tailf + statements to a module without touching the module source. + Annotation statements can be put in a separate annotation + module, and then passed to 'confdc' (or 'pyang') when the + original module is compiled. + + Any 'tailf' statement, except 'symlink' and 'action' can be + annotated. The statements 'symlink' and 'action' modifies the + data model, and are thus not allowed. + + The validation statements 'must', 'min-elements', + 'max-elements', 'mandatory', 'unique', and 'when' can also be + annotated. + + A 'description' can also be annotated. + + 'tailf:annotate' can occur on the top-level in a module, or in + another 'tailf:annotate' statement. + + The argument is a 'schema-nodeid', i.e. the same as for + 'augment', or a '*'. It identifies a target node in the schema + tree to annotate with new statements. The special value '*' can + be used within another 'tailf:annotate' statetement, to select all + children for annotation. + + The target node is searched for after 'uses' and 'augment' + expansion. All substatements to 'tailf:annotate' are treated as + if they were written inline in the target node, with the + exception of any 'tailf:annotate' substatements. These are + treated recursively. For example, the following snippet adds + one callpoint to /x and one to /x/y: + + tailf:annotate /x { + tailf:callpoint xcp; + tailf:annotate y { + tailf:callpoint ycp; + } + } + "; + } + + extension annotate-module { + argument module-name { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "module"; + tailf:occurence "*"; + + tailf:substatement "tailf:snmp-oid"; + tailf:substatement "tailf:snmp-mib-module-name"; + tailf:substatement "tailf:id"; + tailf:substatement "tailf:id-value"; + tailf:substatement "tailf:export"; + tailf:substatement "tailf:unique-selector"; + tailf:substatement "tailf:annotate-statement" { + tailf:occurence "*"; + } + description + "Annotates an existing module or submodule statement with a 'tailf' + statement. This is useful in order to add tailf statements to a + module without touching the module source. Annotation + statements can be put in a separate annotation module, and then + passed to 'confdc' (or 'pyang') when the original module is + compiled. + + 'tailf:annotate-module' can occur on the top-level in a module, + and is used to add 'tailf' statements to the module statement + itself. + + The argument is a name of the module or submodule to annotate."; + } + + extension annotate-statement { + argument statement-path { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:annotate-module"; + tailf:use-in "tailf:annotate-statement"; + tailf:occurence "*"; + + tailf:substatement "tailf:annotate-statement" { + tailf:occurence "*"; + } + description + "Annotates an existing statement with a 'tailf' statement, a + validation statement, or a type restrcition statement. This is + useful in order to add tailf statements to a module without + touching the module source. Annotation statements can be put in + a separate annotation module, and then passed to 'confdc' (or + 'pyang') when the original module is compiled. + + Any 'tailf' statement, except 'symlink' and 'action' can be + annotated. The statements 'symlink' and 'action' modifies the + data model, and are thus not allowed. + + The validation statements 'must', 'min-elements', + 'max-elements', 'mandatory', 'unique', and 'when' can also be + annotated. + + The type restriction statement 'pattern' can also be annotated. + + A 'description' can also be annotated. + + The argument is an XPath-like expression that selects a + statement to annotate. The syntax is: + + ( '[' '=' ']' ) + + where is the name of the statement to annotate, + and if there are more than one such statement in the parent, + is the quoted value of the statement's argument. + + All substatements to 'tailf:annotate-statement' are treated as + if they were written inline in the target node, with the + exception of any 'tailf:annotate-statement' substatements. + These are treated recursively. + + For example, given the grouping: + + grouping foo { + leaf bar { + type string; + } + leaf baz { + type string; + } + } + + the following snippet adds a callpoint to the leaf 'baz': + + tailf:annotate-statement grouping[name='foo'] { + tailf:annotate-statement leaf[name='baz'] { + tailf:callpoint xcp; + } + } + "; + } + + /* + * Type restriction statements + */ + + extension value-length { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "type"; + tailf:substatement "error-message"; + tailf:substatement "error-app-tag"; + description + "Used only for the types: + yang:object-identifier + yang:object-identifier-128 + yang:phys-address + yang:hex-string + tailf:hex-list + tailf:octet-list + xs:hexBinary + + This type restriction is used to limit the length of the + value-space value of the type. Note that since all these types are + derived from 'string', the standard 'length' statement restricts the + lexical representation of the value. + + The argument is a length expression string, with the same syntax as + for the standard YANG 'length' statement."; + } + + extension path-filters { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "type"; + tailf:substatement "tailf:no-subtree-match"; + description + "Used for type 'instance-identifier' only. + + The argument is a space separated list of absolute or relative XPath + expressions. + + This statement declares that the instance-identifier value must match + one of the specified paths, according to the following rules: + + 1. each XPath expression is evaluated, and returns a node set. + + 2. if there is no 'tailf:no-subtree-match' statement, the + instance-identifier matches if it refers to a node in this + node set, or if it refers to any descendant node of this + node set. + + 3. if there is a 'tailf:no-subtree-match' statement, the + instance-identifier matches if it refers to a node in this + node set. + + For example: + + The value /a/b[key='k1']/c matches the XPath expression + /a/b[key='k1']/c. + + The value /a/b[key='k1']/c matches the XPath expression /a/b/c. + + The value /a/b[key='k1']/c matches the XPath expression /a/b, if + there is no 'tailf:no-subtree-match' statement. + + The value /a/b[key='k1'] matches the XPath expression /a/b, if + there is a 'tailf:no-subtree-match' statement. + "; + } + + extension step { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "range"; + description + "Used to further restrict the range of integer and decimal types. The + argument is a positive integer or decimal value greater than + zero. The allowed values for the type is further restricted to + only those values that matches the expression: + + 'low' + n * 'step' + + where 'low' is the lowest allowed value in the range, n is a + non-negative integer. + + For example, the following type: + + type int32 { + range '-2 .. 9' { + tailf:step 3; + } + } + + has the value space { -2, 1, 4, 7 }"; + } + + /* + * Data implementation statements + */ + + extension callpoint { + argument id { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:use-in "grouping"; + tailf:occurence "*"; + + tailf:substatement "description"; + tailf:substatement "tailf:config"; + tailf:substatement "tailf:transform"; + tailf:substatement "tailf:set-hook"; + tailf:substatement "tailf:transaction-hook"; + tailf:substatement "tailf:cache"; + tailf:substatement "tailf:opaque"; + tailf:substatement "tailf:internal"; + description + "Identifies a callback in a data provider. A data provider implements + access to external data, either configuration data in a database or + operational data. By default ConfD uses the embedded database + (CDB) to store all data. However, some or all of + the configuration data may be stored in an external source. In + order for ConfD to be able to manipulate external data, a data + provider registers itself using the callpoint id as described in + confd_lib_dp(3). + + A callpoint is inherited to all child nodes unless another + 'callpoint' or an 'cdb-oper' is defined."; + } + + extension config { + argument value { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "tailf:callpoint"; + description + "If this statement is present, the callpoint is applied to nodes with a + matching value of their 'config' property."; + } + + extension transform { + argument value { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "tailf:callpoint"; + description + "If set to 'true', the callpoint is a transformation callpoint. How + transformation callpoints are used is described in the + 'Transformations, Hooks, Hidden Data and Symlinks' chapter + in the User's Guide."; + } + + extension set-hook { + argument value { + tailf:arg-type { + type enumeration { + enum subtree; + enum object; + enum node; + } + } + } + tailf:use-in "tailf:callpoint"; + description + "Set hooks are a means to associate user code to the + transaction. Whenever an element gets written, created, or + deleted, user code gets invoked and can optionally write more + data into the same transaction. + + The difference between set- and transaction hooks are that set + hooks are invoked immediately when a write operation is requested + by a north bound agent, and transaction hooks are invoked at + commit time. + + The value 'subtree' means that all nodes in the configuration + below where the hook is defined are affected. + + The value 'object' means that the hook only applies to the list + where it is defined, i.e. it applies to all child nodes that + are not themselves lists. + + The value 'node' means that the hook only applies to + the node where it is defined and none of its children. + + For more details on hooks, + see the 'Transformations, Hooks, Hidden Data and Symlinks' + chapter in the User's Guide."; + } + + extension transaction-hook { + argument value { + tailf:arg-type { + type enumeration { + enum subtree; + enum object; + enum node; + } + } + } + tailf:use-in "tailf:callpoint"; + tailf:substatement "tailf:invocation-mode"; + description + "Transaction hooks are a means to associate user code to the + transaction. Whenever an element gets written, created, or + deleted, user code gets invoked and can optionally write more + data into the same transaction. + + The difference between set- and transaction hooks are that set + hooks are invoked immediately when an element is modified, but + transaction hooks are invoked at commit time. + + The value 'subtree' means that all nodes in the configuration + below where the hook is defined are affected. + + The value 'object' means that the hook only applies to the list + where it is defined, i.e. it applies to all child nodes that + are not themselves lists. + + The value 'node' means that the hook only applies to + the node where it is defined and none of its children. + + For more details on hooks, + see the 'Transformations, Hooks, Hidden Data and Symlinks' + chapter in the User's Guide."; + } + + extension invocation-mode { + argument value { + tailf:arg-type { + type enumeration { + enum per-operation; + enum per-transaction; + } + default per-operation; + } + } + tailf:use-in "tailf:transaction-hook"; + description + "By default, the node-specific write callbacks (create(), set_elem(), + etc) for a transaction hook are invoked for the invidual data nodes + that are modified in the transaction. If 'tailf:invocation-mode' is + set to 'per-transaction', there will instead be a single invocation + of a generic write callback (write_all())."; + } + + extension cache { + argument value { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "tailf:callpoint"; + tailf:substatement "tailf:timeout"; + description + "If set to 'true', the operational data served by the callpoint will + be cached by ConfD. If set to 'true' in a node that represents + configuration data, the statement 'tailf:config' must be present + and set to 'false'. This feature is further described in the section + 'Caching operational data' in the 'Operational data' chapter in + the User's Guide."; + } + + extension timeout { + argument value { + tailf:arg-type { + type uint64; + } + } + tailf:use-in "tailf:cache"; + description + "Specifies how long the operational data will be cached, in seconds. + This value will override the global value specified via + /confdConfig/opcache/timeout in the confd.conf(5) file."; + } + + extension opaque { + argument value { + tailf:arg-type { + type string { + length "1..255"; + } + } + } + tailf:use-in "tailf:callpoint"; + tailf:use-in "tailf:validate"; + tailf:use-in "tailf:actionpoint"; + description + "Defines an opaque string which is passed to the callback function + in the context."; + } + + extension id { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "module"; + description + "This statement is used when old confspec models are translated to + YANG. It needs to be present if systems deployed with data + based on confspecs are updated to YANG based data models. + + In confspec, the 'id' of a data model was a string that never + would change, even if the namespace URI would change. It is not + needed in YANG, since the namespace URi cannot change as a module + is updated. + + This statement is typically present in YANG modules generated by + cs2yang. If no live upgrade needs to be done from a confspec + based system to a YANG based system, this statement can be + removed from such a generated module."; + } + + extension cdb-oper { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:substatement "description"; + tailf:substatement "tailf:persistent"; + description + "Indicates that operational data nodes below this node are stored in + CDB."; + } + + extension persistent { + argument value { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "tailf:cdb-oper"; + description + "If it is set to 'true', the operational data is stored on disk. If + set to 'false', the operational data is not persistent across + ConfD restarts. The default is 'false'."; + } + + extension id-value { + argument value { + tailf:arg-type { + type uint32 { + range "1..4294967294"; + } + } + } + tailf:use-in "module"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:use-in "identity"; + tailf:use-in "notification"; + tailf:use-in "choice"; + tailf:use-in "case"; + tailf:use-in "tailf:action"; + description + "This statement lets you specify a hard wired numerical id value to + associate with the parent node. This id value is normally auto + generated by confdc and is used when working with the ConfD API + to refer to a tag name, to avoid expensive string comparison. + Under certain rare circumstances this auto generated hash value + may collide with a hash value generated for a node in another + data model. Whenever such a collision occurs the ConfD daemon + fails to start and instructs the developer to use the 'id-value' + statement to resolve the collision. + + + A thorough discussion on id-value can be found in the section Hash + Values and the id-value Statement in the YANG chapter in the User + Guide."; + } + + extension default-ref { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "refine"; + description + "This statement defines a dynamic default value. It is a reference to + some other leaf in the datamodel. If no value has been set for + this leaf, it defaults to the value of the leaf that the + 'default-ref' argument points to. + + The textual format of a 'default-ref' is an XPath location path with + no predicates. + + The type of the leaf with a 'default-ref' will be set to the + type of the referred leaf. This means that the type statement in + the leaf with the 'default-ref' is ignored, but it SHOULD match the + type of the referred leaf. + + Here is an example, where a group without a 'hold-time' will get as + default the value of another leaf up in the hierarchy: + + leaf hold-time { + mandatory true; + type int32; + } + list group { + key 'name'; + leaf name { + type string; + } + leaf hold-time { + type int32; + tailf:default-ref '../../hold-time'; + } + } + "; + } + + extension sort-order { + argument how { + tailf:arg-type { + type enumeration { + enum normal { + description + "Entries are sorted on the key values."; + } + enum snmp { + description + "All string key values are considered to + start with a length byte for the purpose of sorting."; + } + enum snmp-implied { + description + "As 'snmp', but uses a length byte for all except the last key."; + } + enum unsorted { + description + "Entries do not have any special order. Note that it is + not possible to use the function 'find_next' on an + unsorted list. If an unsorted list is filtered (e.g., + in the CLI, the entire list must be traversed. + + If this value is given for a list stored in CDB, it + has no effect."; + } + } + default normal; + } + } + tailf:use-in "list"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:secondary-index"; + description + "This statement can be used for 'ordered-by system' lists and + leaf-lists only. It indicates in which way the list entries + are sorted."; + } + + extension link { + argument target { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:substatement "tailf:inherit-set-hook"; + description + "This statement specifies that the data node should be + implemented as a link to another data node, called the target + data node. This means that whenever the node is modified, the + system modifies the target data node instead, and whenever the + data node is read, the system returns the value of target data + node. + + Note that if the data node is a leaf, the target node MUST also + be a leaf, and if the data node is a leaf-list, the target node + MUST also be a leaf-list. + + Note that the type of the data node MUST be the same as the + target data node. Currently the compiler cannot check this. + + The argument is an XPath absolute location path. If + the target lies within lists, all keys must be specified. + A key either has a value, or is a reference to a key in the path of the + source node, using the function current() as starting + point for an XPath location path. For example: + + /a/b[k1='paul'][k2=current()/../k]/c"; + } + + extension lower-case { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + description + "Use for config false leafs and leaf-lists only. + + This extension serves as a hint to the system that the + leaf's type has the implict pattern '[^A-Z]*', i.e., all + strings returned by the data provider are lower case (in + the 7-bit ASCII range). + + The CLI uses this hint when it is run in case-insensitive mode + to optimize the lookup calls towards the data provider."; + } + + extension inherit-set-hook { + argument value { + tailf:arg-type { + type boolean; + default "false"; + } + } + tailf:use-in "tailf:symlink"; + tailf:use-in "tailf:link"; + description + "This statement specifies that a 'tailf:set-hook' statement should + survive through symlinks. If set to true a set hook gets called as + soon as the value is set via a symlink but also during commit. The + normal behaviour is to only call the set hook during commit time."; + } + + extension secondary-index { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "list"; + tailf:occurence "*"; + tailf:substatement "tailf:index-leafs" { + tailf:occurence "1"; + } + tailf:substatement "tailf:sort-order"; + tailf:substatement "tailf:display-default-order"; + description + "This statement creates a secondary index with a given name in the + parent list. The secondary index can be used to control the + displayed sort order of the instances of the list. + + Read more about sort order in 'The ConfD Command-Line Interface + (CLI)' chapters in the User Guide, confd_lib_dp(3), and + confd_lib_maapi(3). + + NOTE: Currently secondary-index is not supported for config false + data stored in CDB."; + } + + extension index-leafs { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:secondary-index"; + tailf:occurence "1"; + description + "This statement contains a space separated list of leaf names. Each + such leaf must be a direct child to the list. The secondary + index is kept sorted according to the values of these leafs."; + } + + extension typepoint { + argument id { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "typedef"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:occurence "*"; + description + "If a typedef, leaf, or leaf-list has a 'typepoint' statement, a + user-defined type is specified, as opposed to a derivation or + specification of an existing type. The implementation of a + user-defined type must be provided in the form of a shared object + with C callback functions that is loaded into the ConfD daemon at + startup time. Read more about user-defined types in the + confd_types(3) manual page. + + The argument defines the ID associated with a typepoint. This + ID is provided by the shared object, and used by the ConfD + daemon to locate the implementation of a specific user-defined + type."; + } + + /* + * Validation related statements + */ + + extension unique-selector { + argument context-path { + tailf:arg-type { + type string; + } + } + tailf:use-in "module"; + tailf:use-in "submodule"; + tailf:use-in "grouping"; + tailf:use-in "augment"; + tailf:use-in "container"; + tailf:use-in "list"; + tailf:occurence "*"; + + tailf:substatement "tailf:unique-leaf" { + tailf:occurence "+"; + } + description + "The standard YANG statement 'unique' can be used to check for + uniqueness within a single list only. Specifically, it cannot + be used to check for uniqueness of leafs within a sublist. + + For example: + + container a { + list b { + ... + unique 'server/ip server/port'; + list server { + ... + leaf ip { ... }; + leaf port { ... }; + } + } + } + + The unique expression above is not legal. The intention is + that there must not be any two 'server' entries in any 'b' with + the same combination of ip and port. This would be illegal: + + + + b1 + + 10.0.0.1 + 80 + + + + b2 + + 10.0.0.1 + 80 + + + + + With 'tailf:unique-selector' and 'tailf:unique-leaf', this kind + of constraint can be defined. + + The argument to 'tailf:unique-selector' is an XPath descendant + location path (matches the rule 'descendant-schema-nodeid' in + RFC 6020). The first node in the path MUST be a list node, and + it MUST be defined in the same module as the + tailf:unique-selector. For example, the following is illegal: + + module y { + ... + import x { + prefix x; + } + tailf:unique-selector '/x:server' { // illegal + ... + } + } + + For each instance of the node where the selector is defined, it + is evaluated, and for each node selected by the selector, a + tuple is constructed by evaluating the 'tailf:unique-leaf' + expression. All such tuples must be unique. If a + 'tailf:unique-leaf' expression refers to a non-existing leaf, + the corresponding tuple is ignored. + + In the example above, the unique expression can be replaced by: + + container a { + tailf:unique-selector 'b/server' { + tailf:unique-leaf 'ip'; + tailf:unique-leaf 'port'; + } + list b { + ... + } + } + + For each container 'a', the XPath expression 'b/server' is + evaluated. For each such server, a 2-tuple is constructed with + the 'ip' and 'port' leafs. Each such 2-tuple is guaranteed to + be unique."; + } + + extension unique-leaf { + argument leaf-expr { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:unique-selector"; + tailf:occurence "+"; + description + "See 'tailf:unique-selector' for a description of how this statement + is used. + + The argument is an XPath descendant location path (matches the + rule 'descendant-schema-nodeid' in RFC 6020), and it MUST refer to + a leaf."; + } + + extension validate { + argument id { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "grouping"; + tailf:use-in "refine"; + tailf:use-in "must"; + tailf:occurence "*"; + tailf:substatement "description"; + tailf:substatement "tailf:call-once"; + tailf:substatement "tailf:dependency" { + tailf:occurence "*"; + } + tailf:substatement "tailf:opaque"; + tailf:substatement "tailf:internal"; + tailf:substatement "tailf:priority"; + description + "Identifies a validation callback which is invoked when a configuration + value is to be validated. The callback validates a value and + typically checks it towards other values in the data store. + Validation callbacks are used when the YANG built-in validation + constructs ('must', 'unique') are not expressive enough. + + Callbacks use the API described in confd_lib_maapi(3) to + access whatever other configuration values needed to perform the + validation. + + Validation callbacks are typically assigned to individual nodes + in the data model, but it may be feasible to use a single + validation callback on a root node. In that case the callback + is responsible for validation of all values and their + relationships throughout the data store. + + The 'validate' statment should in almost all cases have a + 'tailf:dependency' substatement. If such a statement is not + given, the validate function is evaluated at every commit, + leading to overall performance degradation. + + If the 'validate' statement is defined in a 'must' statement, + validation callback is called instead of evaluating the must + expression. This is useful if the evaluation of the must statement + uses too much resources, and the condition expressed with the must + statement is easier to check with a validation callback function."; + } + + extension call-once { + argument value { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "tailf:validate"; + description + "This optional statement can be used only if the parent statement is + a list. If 'call-once' is 'true'. the validation callback is + only called once even though there exists many list entries in + the data store. This is useful if we have a huge amount of + instances or if values assigned to each instance have to be + validated in comparison with its siblings."; + } + + extension dependency { + argument path { + tailf:arg-type { + type string; + } + } + tailf:use-in "must"; + tailf:use-in "when"; + tailf:use-in "tailf:validate"; + tailf:substatement "tailf:xpath-root"; + tailf:occurence "*"; + description + "This statement is used to specify that the must or when expression + or validation function depends on a set of subtrees in the data + store. Whenever a node in one of those subtrees are modified, + the must or when expression is evaluated, or validation code executed. + + The textual format of a 'dependency' is an XPath location path with + no predicates. + + If the node that declares the dependency is a leaf, there is an + implicit dependency to the leaf itself. + + For example, with the leafs below, the validation code for'vp' + will be called whenever 'a' or 'b' is modified. + + leaf a { + type int32; + tailf:validate vp { + tailf:dependency '../b'; + } + } + leaf b { + type int32; + } + + For 'when' and 'must' expressions, the compiler can derive the + dependencies automatically from the XPath expression in most + cases. The exception is if any wildcards are used in the expression. + + For 'when' expressions to work, a 'tailf:dependency' statement + must be given, unless the compiler can figure out the dependency + by itself. + + Note that having 'must' expressions or a 'tailf:validate' + statement without dependencies impacts the overall performance + of the system, since all such 'must' expressions or validation + functions are evaluated at every commit."; + } + + extension no-dependency { + tailf:use-in "must"; + tailf:use-in "tailf:validate"; + tailf:occurence "?"; + description + "This optional statements can be used to explicitly say that a 'must' + expression or a validation function is evaluated at every + commit. Use this with care, since the overall performance of + the system is impacted if this statement is used."; + } + + extension override-auto-dependencies { + tailf:use-in "must"; + tailf:use-in "when"; + description + "This optional statement can be used to instruct the compiler to + use the provided tailf:dependency statements instead of the + dependencies that the compiler calculates from the expression. + + Use with care, and only if you are sure that the provided dependecies + are correct."; + } + + extension priority { + tailf:use-in "tailf:validate"; + argument value { + tailf:arg-type { + type uint32; + } + } + description + "This extension takes an integer parameter specifying the order + validation code will be evaluated, in order of increasing + priority. + + The default priority is 0."; + } + + extension no-subtree-match { + tailf:use-in "tailf:path-filters"; + description + "See tailf:path-filters."; + } + + + /* + * User interface related statements + */ + + extension info { + argument text { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "typedef"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:use-in "identity"; + tailf:use-in "type"; + tailf:use-in "enum"; + tailf:use-in "bit"; + tailf:use-in "length"; + tailf:use-in "pattern"; + tailf:use-in "range"; + tailf:use-in "refine"; + tailf:use-in "action"; + tailf:use-in "tailf:action"; + tailf:use-in "tailf:symlink"; + tailf:use-in "tailf:cli-exit-command"; + description + "Contains a textual description of the definition, suitable for + being presented to the CLI and WebUI users. + + The first sentence of this textual description is used in the + CLI as a summary, and displayed to the user when a short + explanation is presented. + + The 'description' statement is related, but targeted to the module + reader, rather than the CLI or WebUI user. + + The info string may contain a ';;' keyword. It is used in type + descriptions for leafs when the builtin type info needs to be + customized. A 'normal' info string describing a type is assumed + to contain a short textual description. When ';;' is present it + works as a delimiter where the text before the keyword is + assumed to contain a short description and the text after the + keyword a long(er) description. In the context of completion in + the CLI the text will be nicely presented in two columns where + both descriptions are aligned when displayed."; + } + + extension info-html { + argument text { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:use-in "identity"; + tailf:use-in "tailf:action"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "This statement works exactly as 'tailf:info', with the exception + that it can contain HTML markup. The WebUI will display the + string with the HTML markup, but the CLI will remove all HTML markup + before displaying the string to the user. In most cases, + using this statement avoids using special descriptions in webspecs + and clispecs. + + If this statement is present, 'tailf:info' cannot be given at the same + time."; + } + + extension sort-priority { + argument value { + tailf:arg-type { + type int32; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "This extension takes an integer parameter specifying the order and + can be placed on leafs, containers, lists and leaf-lists. + When showing, or getting configuration, leaf values will be returned + in order of increasing sort-priority. + + The default sort-priority is 0."; + } + + extension writable { + argument value { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "leaf"; + description + "This extension makes operational data (i.e., config false data) + writable. Only valid for leafs."; + } + + extension suppress-echo { + argument value { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "typedef"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + description + "If this statetement is set to 'true', leafs of this type will not have + their values echoed when input in the webui or when the CLI prompts + for the value. The value will also not be included in the audit + log in clear text but will appear as ***."; + } + + extension hidden { + argument tag { + tailf:arg-type { + type string { + pattern '[^\*].*|..+'; // must not be single '*' +// YANG 1.1: +// pattern '\*' { +// modifier invert-match; +// } + } + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:action"; + tailf:use-in "refine"; + tailf:use-in "tailf:symlink"; + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:occurence "*"; + + description + "This statement can be used to hide a node from some, or all, + northbound interfaces. All nodes with the same value are + considered a hide group and are treated the same with regards to + being visible or not in a northbound interface. + + A node with an hidden property is not shown in the northbound + user interfaces (CLI and Web UI) unless an 'unhide' operation has + been performed in the user interface. + + The hidden value 'full' indicates that the node should be hidden + from all northbound interfaces, including programmatical interfaces + such as NETCONF. + + The value '*' is not valid. + + A hide group can be unhidden only if this has been explicitly + allowed in the confd.conf(5) daemon configuration. + + Multiple hide groups can be specified by giving this statement + multiple times. The node is shown if any of the specified hide groups + has been given in the 'unhide' operation. + + Note that if a mandatory node is hidden, a hook callback + function (or similar) might be needed in order to set the + element."; + } + + extension display-when { + argument condition { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + tailf:occurence "*"; + tailf:substatement "tailf:xpath-root"; + description + "The argument contains an XPath expression which specifies when + the node should be displayed in the CLI and WebUI. For example, + when the CLI performs completion, and one of the candidates is + a node with a 'display-when' expression, the expression is + evaluated by the CLI. If the XPath expression evaluates to + true, the node is shown as a possible completion candidate, + otherwise not. + + For a list, the display-when expression is evaluated once for the + entire list. In this case, the XPath context node is the list's parent + node. + + This feature is further described in the 'Transformations, Hooks, + Hidden Data and Symlinks' chapter in the User Guide."; + } + + extension display-groups { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "This property is used in the CLI when 'enableDisplayGroups' has been + set to true in the confd.conf(5) file. Display groups are used + to control which elements should be displayed by the show command. + + The argument is a space-separated string of tags. + + In the J-style CLI the 'show status', 'show table' and 'show + all' commands use display groups. In the C- and I-style + CLIs the 'show ' command uses display groups. + + If no display groups are specified when running the commands, the + node will be displayed if it does not have the 'display-groups' + property, or if the property value includes the special value 'none'. + + If display groups are specified when running the command, then + the node will be displayed only if its 'display-group' + property contains one of the specified display groups."; + } + + extension display-default-order { + tailf:use-in "tailf:secondary-index"; + description + "Specifies that the list should be displayed sorted according + to this secondary index in the show command. + + If the list has more than one secondary index, + 'display-default-order' must be present in one index only. + + Used in J-, I- and C-style CLIs and WebUI."; + } + + extension alt-name { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "This property is used to specify an alternative name for the + node in the CLI. It is used instead of the node name in the CLI, + both for input and output."; + } + + extension display-status-name { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "This property is used to specify an alternative name for the + element in the CLI. It is used when displaying status + information in the C- and I-style CLIs."; + } + + extension display-column-name { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "refine"; + description + "This property is used to specify an alternative column name for the + leaf in the CLI. It is used when displaying the leaf in a + table in the CLI."; + } + + extension display-hint { + argument hint { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "typedef"; + description + "This statement can be used to add a display-hint to a leaf or + typedef of type binary. The display-hint is used in the CLI + and WebUI instead of displaying the binary as a base64-encoded + string. It is also used for input. + + The value of a 'display-hint' is defined in RFC 2579. + + For example, with the display-hint value '1x:', the value is + printed and inputted as a colon-separated hex list."; + } + + /* + * SNMP mapping statements + */ + + extension snmp-oid { + argument oid { + tailf:arg-type { + type tailf:tailf-oid; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "module"; + tailf:use-in "refine"; + description + "Used when the YANG module is mapped to an SNMP module. + + If this statement is present as a direct child to 'module', + it indicates the top level OID for the module. + + When the parent node is mapped to an SNMP object, this statement + specifies the OID of the SNMP object. It may be either a full + OID or just a suffix (a period, followed by an integer). In the + latter case, a full OID must be given for some ancestor element. + + NOTE: when this statement is set in a list, it refers to the OID of + the correspondig table, not the table entry."; + } + + extension snmp-name { + argument name { + tailf:arg-type { + type tailf:snmp-identifier; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "enum"; + tailf:use-in "refine"; + tailf:occurence "*"; + description + "Used when the YANG module is mapped to an SNMP module. + + When the parent node is mapped to an SNMP object, this statement + specifies the name of the SNMP object. + + If the parent node is mapped to multiple SNMP objects, this + statement can be given multiple times. The first statement + specifies the primary table. + + In a list, the argument is interpreted as: + + [MIB-MODULE-NAME:]TABLE-NAME + + For a leaf representing a table column, it is interpreted as: + + [[MIB-MODULE-NAME:]TABLE-NAME:]NAME + + For a leaf representing a scalar variable, it is interpreted as: + + [MIB-MODULE-NAME:]NAME + + If a YANG list is mapped to multiple SNMP tables, each such SNMP + table must be specified with a 'tailf:snmp-name' statement. If + the table is defined in another MIB than the MIB specified in + 'tailf:snmp-mib-module-name', the MIB name must be specified in this + argument. + + A leaf in a list that is mapped to multiple SNMP tables must specify + the name of the table it is mapped to if it is different from the + primary table. + + In the following example, a single YANG list 'interface' is mapped + to the MIB tables ifTable, ifXTable, and ipv4InterfaceTable: + + list interface { + key index; + tailf:snmp-name 'ifTable'; // primary table + tailf:snmp-name 'ifXTable'; + tailf:snmp-name 'IP-MIB:ipv4InterfaceTable'; + + leaf index { + type int32; + } + leaf description { + type string; + tailf:snmp-name 'ifDescr'; // mapped to primary table + } + leaf name { + type string; + tailf:snmp-name 'ifXTable:ifName'; + } + leaf ipv4-enable { + type boolean; + tailf:snmp-name + 'IP-MIB:ipv4InterfaceTable:ipv4InterfaceEnableStatus'; + } + ... + } + + When emitting a mib from yang, enum labels are used as-is if they + follow the SMI rules for labels (no '.' or '_' characters and beginning + with a lowercase letter). Any label that doesn't satisfy the SMI rules + will be converted as follows: + + An initial uppercase character will be downcased. + + If the initial character is not a letter it will be prepended with + an 'a'. + + Any '.' or '_' characters elsewhere in the label will be substituted + with '-' characters. + + In the resulting label, any multiple '-' character sequence will be + replaced with a single '-' character. + + If this automatic conversion is not suitable, snmp-name can be used + to specify the label to use when emitting a MIB."; + } + + extension snmp-mib-module-name { + argument name { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "module"; + tailf:use-in "refine"; + description + "Used when the YANG module is mapped to an SNMP module. + + Specifies the name of the SNMP MIB module where the SNMP objects + are defined. + + This property is inherited by all child nodes."; + } + + extension snmp-row-status-column { + argument value { + tailf:arg-type { + type uint32 { + range "1..max"; + } + } + } + tailf:use-in "list"; + tailf:use-in "refine"; + description + "Used when an SNMP module is generated from the YANG module. + + When the parent list node is mapped to an SNMP table, this + statement specifies the column number of the generated RowStatus + column. If it is not specified, the generated RowStatus column + will be the last in the table."; + } + + extension snmp-lax-type-check { + argument value { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "leaf"; + description + "Normally, the ConfD MIB compiler checks that the data type of an SNMP + object matches the data type of the corresponding YANG leaf. If + both objects are writeble, the data types need to precisely + match, but if the SNMP object is read-only, or if + snmp-lax-type-check is set to 'true', the compiler accepts the + object if the SNMP type's value space is a superset of the YANG + type's value space. + + If snmp-lax-type-check is true and the MIB object is writable, the SNMP + agent will reject values outside the YANG data type range in runtime."; + } + + extension snmp-exclude-object { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + description + "Used when an SNMP MIB is generated from a YANG module, using + the --generate-oids option to confdc. + + If this statement is present, confdc will exclude this object + from the resulting MIB."; + } + + extension snmp-delete-value { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:substatement "tailf:snmp-send-delete-value"; + description + "This statement is used to define a value to be used in SNMP + to delete an optional leaf. The argument to this statement is the + special value. This special value must not be part of the value + space for the YANG leaf. + + If the optional leaf does not exists, reading it over SNMP returns + 'noSuchInstance', unless the statement 'tailf:snmp-send-delete-value' + is used, in which case the same value as used to delete the node + is returned. + + For example, the YANG leaf: + + leaf opt-int { + type int32 { + range '1..255'; + } + tailf:snmp-delete-value 0 { + tailf:snmp-send-delete-value; + } + } + + can be mapped to a SMI object with syntax: + + SYNTAX Integer32 (0..255) + + Setting such an object to '0' over SNMP will delete the node + from the datastore. If the node does not exsist, reading it over + SNMP will return '0'."; + } + + extension snmp-send-delete-value { + tailf:use-in "tailf:snmp-delete-value"; + description + "See tailf:snmp-delete-value."; + } + + /* + * SNMP NED statements + */ + + extension snmp-ned-set-before-row-modification { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + description + "If this statement is present on a leaf, it tells the SNMP NED + that if a column in the row is modified, and it is marked with + 'tailf:snmp-ned-modification-dependent', then the column marked + with 'tailf:snmp-ned-set-before-modification' needs to be set to + before the other column is modified. After all such + columns have been modified, the column marked with + 'tailf:snmp-ned-set-before-modification' is reset to its initial + value."; + } + + extension snmp-ned-modification-dependent { + tailf:use-in "leaf"; + description + "This statement is used on all columns in a table that + require the usage of the column marked with + tailf:snmp-ned-set-before-row-modification. + + This statement can be used on any column in a table where one + leaf is marked with tailf:snmp-ned-set-before-row-modification, + or a table that AUGMENTS such a table, or a table with a + foreign index in such a table."; + } + + extension snmp-ned-accessible-column { + argument leaf-name { + tailf:arg-type { + type union { + type tailf:identifier; + type int32; + } + } + } + tailf:use-in "list"; + description + "The name or subid number of an accessible column that is + instantiated in all table entries in a table. The column does + not have to be writable. The SNMP NED will use this column + when it uses GET-NEXT to loop through the list entries, and + when doing existence tests. + + If this column is not given, the SNMP NED uses the following + algorithm: + + 1. If there is a RowStatus column, it will be used. + 2. If an INDEX leaf is accessible, it will be used. + 3. Otherwise, use the first accessible column returned + by the SNMP agent."; + } + + extension snmp-ned-delete-before-create { + tailf:use-in "list"; + description + "This statement is used in a list to make the SNMP NED always send + deletes before creates. Normally, creates are sent before deletes."; + } + + extension snmp-ned-recreate-when-modified { + tailf:use-in "list"; + description + "This statement is used in a list to make the SNMP NED delete + and recreate the row when a column in the row is modified."; + } + + /* + * Java code generation statements + */ + + extension java-class-name { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "refine"; + description + "Used to give another name than the default name to generated Java + classes. This statemement is typically used to avoid name conflicts + in the Java classes."; + } + + /* + * Common code generation statemements + */ + + extension code-name { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "enum"; + tailf:use-in "bit"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:use-in "identity"; + tailf:use-in "notification"; + tailf:use-in "tailf:action"; + description + "Used to give another name to the enum or node name in generated + header files. This statement is typically used to avoid name + conflicts if there is a data node with the same name as the + enumeration, if there are multiple enumerations in different + types with the same name but different values, or if there are + multiple node names that are mapped to the same name in the + header file."; + } + + /* + * Data modeling extensions + */ + + extension action { + argument name { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "augment"; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "grouping"; + tailf:occurence "*"; + + tailf:substatement "description"; + tailf:substatement "grouping"; + tailf:substatement "if-feature"; + tailf:substatement "reference"; + tailf:substatement "input"; + tailf:substatement "output"; + tailf:substatement "status"; + tailf:substatement "typedef"; + tailf:substatement "tailf:actionpoint"; + tailf:substatement "tailf:alt-name"; + tailf:substatement "tailf:cli-mount-point"; + tailf:substatement "tailf:cli-configure-mode"; + tailf:substatement "tailf:cli-operational-mode"; + tailf:substatement "tailf:cli-oper-info"; + tailf:substatement "tailf:code-name"; + tailf:substatement "tailf:confirm-text"; + tailf:substatement "tailf:display-when"; + tailf:substatement "tailf:exec"; + tailf:substatement "tailf:hidden"; + tailf:substatement "tailf:info"; + tailf:substatement "tailf:info-html"; + description + "Defines an action (method) in the data model. + + When the action is invoked, the instance on which the action is + invoked is explicitly identified by an hierarchy of + configuration or state data. + + The action statement can have either a 'tailf:actionpoint' or a + 'tailf:exec' substatement. If the action is implemented as a + callback in an application daemon, 'tailf:actionpoint' is used, + whereas 'tailf:exec' is used for an action implemented as a + standalone executable (program or script). Additionally, 'action' + can have the same substatements as the standard YANG 'rpc' + statement, e.g., 'description', 'input', and 'output'. + + For example: + + container sys { + list interface { + key name; + leaf name { + type string; + } + tailf:action reset { + tailf:actionpoint my-ap; + input { + leaf after-seconds { + mandatory false; + type int32; + } + } + } + } + } + + We can also add a 'tailf:confirm-text', which defines a string to + be used in the user interfaces to prompt the user for + confirmation before the action is executed. The optional + 'tailf:confirm-default' and 'tailf:cli-batch-confirm-default' can be set + to control if the default is to proceed or to abort. The latter will only + be used during batch processing in the CLI (e.g. non-interactive mode). + + tailf:action reset { + tailf:actionpoint my-ap; + input { + leaf after-seconds { + mandatory false; + type int32; + } + } + tailf:confirm-text 'Really want to do this?' { + tailf:confirm-default true; + } + } + + The 'tailf:actionpoint' statement can have a 'tailf:opaque' + substatement, to define an opaque string that is passed to the + callback function. + + tailf:action reset { + tailf:actionpoint my-ap { + tailf:opaque 'reset-interface'; + } + input { + leaf after-seconds { + mandatory false; + type int32; + } + } + } + + When we use the 'tailf:exec' substatement, the argument to exec + specifies the program or script that should be executed. For + example: + + tailf:action reboot { + tailf:exec '/opt/sys/reboot.sh' { + tailf:args '-c $(context) -p $(path)'; + } + input { + leaf when { + type enumeration { + enum now; + enum 10secs; + enum 1min; + } + } + } + }"; + } + + extension actionpoint { + argument name { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:use-in "tailf:action"; + tailf:use-in "refine"; + tailf:substatement "tailf:opaque"; + tailf:substatement "tailf:internal"; + description + "Identifies the callback in a data provider that implements the + action. See confd_lib_dp(3) for details on the API."; + } + + extension confirm-text { + argument text { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:use-in "tailf:action"; + tailf:substatement "tailf:confirm-default"; + tailf:substatement "tailf:cli-batch-confirm-default"; + description + "A string which is used in the user interfaces to prompt the user for + confirmation before the action is executed. The optional + 'confirm-default' and 'cli-batch-confirm-default' can be set to control + if the default is to proceed or to abort. The latter will only + be used during batch processing in the CLI (e.g. non-interactive mode)."; + } + + extension confirm-default { + argument name { + tailf:arg-type { + type boolean; + } + } + tailf:use-in "tailf:confirm-text"; + description + "Specifies if the default is to proceed or abort the action when a + confirm-text is set. If this value is not specified, a ConfD + global default value can be set in clispec(5)."; + } + + extension indexed-view { + tailf:use-in "list"; + tailf:substatement "tailf:auto-compact"; + description + "This element can only be used if the list has a single key of + an integer type. + + It is used to signal that lists instances uses an indexed view, + i.e., making it possible to insert a new list entry at a certain + position. If a list entry is inserted at a certain position, list + entries following this position are automatically renumbered by the + system, if needed, to make room for the new entry. + + This statement is mainly provided for backwards compatibility with + confspecs. New data models should consider using YANG's ordered-by + user statement instead."; + } + + extension auto-compact { + tailf:use-in "tailf:indexed-view"; + description + "If an indexed-view list is marked with this statement, it means that + the server will automatically renumber entires after a delete + operation so that the list entries are strictly monotonically + increasing, starting from 1, with no holes. New list entries + can either be insterted anywhere in the list, or created at the + end; but it is an error to try to create a list entry with a + key that would result in a hole in the sequence. + + For example, if the list has entries 1,2,3 it is an error to + create entry 5, but correct to create 4."; + } + + extension key-default { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "leaf"; + description + "Must be used for key leafs only. + + Specifies a value that the CLI and WebUI will use when a list entry is + created, and this key leaf is not given a value. + + If one key leaf has a key-default value, all key leafs that + follow this key leaf must also have key-default values."; + } + + extension error-info { + tailf:use-in "module"; + tailf:use-in "submodule"; + tailf:occurence "?"; + + tailf:substatement "description"; + tailf:substatement "leaf" { + tailf:occurence "*"; + } + tailf:substatement "leaf-list" { + tailf:occurence "*"; + } + tailf:substatement "list" { + tailf:occurence "*"; + } + tailf:substatement "container" { + tailf:occurence "*"; + } + tailf:substatement "choice" { + tailf:occurence "*"; + } + tailf:substatement "uses" { + tailf:occurence "*"; + } + description + "Declares a set of data nodes to be used in the NETCONF + element. + + A data provider can use one of the + confd_*_seterr_extended_info() functions (see confd_lib_dp(3)) + to set these data nodes on errors. + + This statement may be used multiple times. + + For example: + + tailf:error-info { + leaf severity { + type enumeration { + enum info; + enum error; + enum critical; + } + } + container detail { + leaf class { + type uint8; + } + leaf code { + type uint8; + } + } + }"; + } + + extension non-strict-leafref { + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:substatement "path" { + tailf:occurence "1"; + } + description + "This statement can be used in leafs and leaf-lists similar + to 'leafref', but allows reference to non-existing leafs, + and allows reference from config to non-config. + + This statement takes no argument, but expects the core YANG + statement 'path' as a substatement. The function 'deref' cannot + be used in the path, since it works on nodes of type leafref + only. + + The type of the leaf or leaf-list must be exactly the same + as the type of the target. + + This statement can be viewed as a substitute for a standard + 'require-instance false' on leafrefs, which isn't allowed. + + The CLI uses this statement to provide completion with + existing values, and the WebUI uses it to provide a + drop-down box with existing values."; + } + + extension no-leafref-check { + tailf:use-in "type"; + description + "This statement can be used to let 'leafref' type statements + reference non-existing leafs. While similar to the + 'tailf:non-strict-leafref' statement, this does not allow + reference from config to non-config."; + } + + /* + * RPC and action implementation statements + */ + + extension exec { + argument cmd { + tailf:arg-type { + type string; + } + } + tailf:use-in "rpc"; + tailf:use-in "action"; + tailf:use-in "tailf:action"; + + tailf:substatement "tailf:args"; + tailf:substatement "tailf:uid"; + tailf:substatement "tailf:gid"; + tailf:substatement "tailf:wd"; + tailf:substatement "tailf:global-no-duplicate"; + tailf:substatement "tailf:raw-xml"; + tailf:substatement "tailf:interruptible"; + tailf:substatement "tailf:interrupt"; + description + "Specifies that the rpc or action is implemented as an OS executable. + The argument 'cmd' is the path to the executable file. If the + command is in the $PATH of ConfD, the 'cmd' can be just the name + of the executable."; + } + + extension args { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:exec"; + description + "Specifies arguments to send to the executable when it is invoked by + ConfD. The argument 'value' is a space separated list of + argument strings. It may contain variables on the form + $(variablename). These variables will be expanded before the + command is executed. The following variables are always available: + + $(user) The name of the user which runs the operation. + + $(groups) A comma separated string of the names of the groups + the user belongs to. + + $(ip) The source ip address of the user session. + + $(uid) The user id of the user. + + $(gid) The group id of the user. + + When the parent 'exec' statement is a substatement of 'action', the + following additional variablenames are available: + + $(keypath) The path that identifies the parent container of 'action' + in string keypath form, e.g., + '/sys:host{earth}/interface{eth0}'. + + $(path) The path that identifies the parent container of 'action' + in CLI path form, e.g., 'host earth interface eth0'. + + $(context) cli | webui | netconf | any string provided by MAAPI + + For example: + args '-user $(user) $(uid)'; + might expand to: + -user bob 500 + "; + } + + extension raw-xml { + tailf:use-in "tailf:exec"; + tailf:substatement "tailf:batch"; + description + "Specifies that ConfD should not convert the RPC XML parameters to + command line arguments. Instead, ConfD just passes the raw XML on + stdin to the program. + + This statement is not allowed in 'tailf:action'."; + } + + extension interruptible { + argument value { + tailf:arg-type { + type boolean; + default "true"; + } + } + tailf:use-in "tailf:exec"; + description + "Specifies whether the client can abort the + execution of the executable."; + } + + extension interrupt { + argument signal { + tailf:arg-type { + type enumeration { + enum sigkill; + enum sigint; + enum sigterm; + } + default "sigkill"; + } + } + tailf:use-in "tailf:exec"; + description + "This statement specifies which signal is sent to executable by ConfD + in case the client terminates or aborts the execution. + + If not specified, 'sigkill' is sent."; + } + + + extension uid { + argument value { + tailf:arg-type { + type union { + type enumeration { + enum confd { + description + "The command is run as the same user id as the ConfD daemon."; + } + enum user { + description + "The command is run as the same user id as the user logged + in to ConfD. This user id MUST exist as an actual user id + in the underlying operating system."; + } + enum root { + description + "The command is run as root."; + } + } + type uint32; + } + } + } + tailf:use-in "tailf:exec"; + description + "Specifies which user id to use when executing the command. + + If 'uid' is an integer value, the command is run as the user with + this user id. + + If 'uid' is set to either 'user', 'root' or an integer user id, the + ConfD daemon must have been started as root (or setuid), or the + ConfD executable program 'cmdwrapper' must have setuid root + permissions."; + } + + extension gid { + argument value { + tailf:arg-type { + type union { + type enumeration { + enum confd { + description + "The command is run as the same group id as the ConfD daemon."; + } + enum user { + description + "The command is run as the same group id as the user logged + in to ConfD. This group id MUST exist as an actual group id + in the underlying operating system."; + } + enum root { + description + "The command is run as root."; + } + } + type uint32; + } + } + } + tailf:use-in "tailf:exec"; + description + "Specifies which group id to use when executing the command. + + If 'gid' is an integer value, the command is run as the group with + this group id. + + If 'gid' is set to either 'user', 'root' or an integer group id, the + ConfD daemon must have been started as root (or setuid), or the + ConfD executable program 'cmdwrapper' must have setuid root + permissions."; + } + + extension wd { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:exec"; + description + "Specifies which working directory to use when executing the + command. If not given the command is executed from the homedir + of the user logged in to ConfD."; + } + + extension global-no-duplicate { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:exec"; + description + "Specifies that only one instance with the same name can be run at any + one time in the system. The command can be started either from + the CLI, the WebUI or through NETCONF. If a client tries to + execute this command while another operation with the same + 'global-no-duplicate' name is running, a 'resource-denied' error is + generated."; + } + + extension batch { + tailf:use-in "tailf:raw-xml"; + description + "Specifies that the command returns immediately, but still runs in the + background."; + } + + /* + * Deprecated types + */ + + typedef hex-list { + type string { + pattern '(([0-9a-fA-F]){2}(:([0-9a-fA-F]){2})*)?'; + } + status deprecated; + description + "DEPRECATED: Use yang:hex-string instead. There are no plans to remove + tailf:hex-list. + + A list of colon-separated hexa-decimal octets e.g. '4F:4C:41:71'. + + The statement tailf:value-length can be used to restrict the number + of octets. Note that using the 'length' restriction limits the + number of characters in the lexical representation."; + } + + /* + * Deprecated statements + */ + + extension symlink { + argument name { + tailf:arg-type { + type tailf:identifier; + } + } + status deprecated; + tailf:use-in "list"; + tailf:use-in "container"; + tailf:use-in "module"; + tailf:use-in "submodule"; + tailf:use-in "augment"; + tailf:use-in "case"; + tailf:occurence "*"; + + tailf:substatement "status"; + tailf:substatement "tailf:alt-name"; + tailf:substatement "tailf:cli-add-mode"; + tailf:substatement "tailf:cli-allow-join-with-key"; + tailf:substatement "tailf:cli-allow-join-with-value"; + tailf:substatement "tailf:cli-allow-key-abbreviation"; + tailf:substatement "tailf:cli-allow-range"; + tailf:substatement "tailf:cli-allow-wildcard"; + tailf:substatement "tailf:cli-autowizard"; + tailf:substatement "tailf:cli-boolean-no"; + tailf:substatement "tailf:cli-break-sequence-commands"; + tailf:substatement "tailf:cli-column-align"; + tailf:substatement "tailf:cli-column-stats"; + tailf:substatement "tailf:cli-column-width"; + tailf:substatement "tailf:cli-compact-stats"; + tailf:substatement "tailf:cli-compact-syntax"; + tailf:substatement "tailf:cli-completion-actionpoint"; + tailf:substatement "tailf:cli-custom-error"; + tailf:substatement "tailf:cli-custom-range"; + tailf:substatement "tailf:cli-custom-range-actionpoint"; + tailf:substatement "tailf:cli-custom-range-enumerator"; + tailf:substatement "tailf:cli-delayed-auto-commit"; + tailf:substatement "tailf:cli-delete-container-on-delete"; + tailf:substatement "tailf:cli-delete-when-empty"; + tailf:substatement "tailf:cli-diff-dependency" { + tailf:occurence "*"; + } + tailf:substatement "tailf:cli-disabled-info"; + tailf:substatement "tailf:cli-disallow-value"; + tailf:substatement "tailf:cli-display-empty-config"; + tailf:substatement "tailf:cli-display-separated"; + tailf:substatement "tailf:cli-drop-node-name"; + tailf:substatement "tailf:cli-no-keyword"; + tailf:substatement "tailf:cli-enforce-table"; + tailf:substatement "tailf:cli-embed-no-on-delete"; + tailf:substatement "tailf:cli-exit-command"; + tailf:substatement "tailf:cli-explicit-exit"; + tailf:substatement "tailf:cli-expose-key-name"; + tailf:substatement "tailf:cli-expose-ns-prefix"; + tailf:substatement "tailf:cli-flat-list-syntax"; + tailf:substatement "tailf:cli-flatten-container"; + tailf:substatement "tailf:cli-full-command"; + tailf:substatement "tailf:cli-full-no"; + tailf:substatement "tailf:cli-full-show-path"; + tailf:substatement "tailf:cli-hide-in-submode"; + tailf:substatement "tailf:cli-ignore-modified"; + tailf:substatement "tailf:cli-incomplete-command"; + tailf:substatement "tailf:cli-incomplete-no"; + tailf:substatement "tailf:cli-incomplete-show-path"; + tailf:substatement "tailf:cli-instance-info-leafs"; + tailf:substatement "tailf:cli-key-format"; + tailf:substatement "tailf:cli-list-syntax"; + tailf:substatement "tailf:cli-min-column-width"; + tailf:substatement "tailf:cli-mode-name"; + tailf:substatement "tailf:cli-mode-name-actionpoint"; + tailf:substatement "tailf:cli-multi-value"; + tailf:substatement "tailf:cli-multi-word-key"; + tailf:substatement "tailf:cli-multi-line-prompt"; + tailf:substatement "tailf:cli-no-key-completion"; + tailf:substatement "tailf:cli-no-match-completion"; + tailf:substatement "tailf:cli-no-name-on-delete"; + tailf:substatement "tailf:cli-no-value-on-delete"; + tailf:substatement "tailf:cli-oper-info"; + tailf:substatement "tailf:cli-optional-in-sequence"; + tailf:substatement "tailf:cli-prefix-key"; + tailf:substatement "tailf:cli-preformatted"; + tailf:substatement "tailf:cli-range-delimiters"; + tailf:substatement "tailf:cli-range-list-syntax"; + tailf:substatement "tailf:cli-recursive-delete"; + tailf:substatement "tailf:cli-remove-before-change"; + tailf:substatement "tailf:cli-reset-container"; + tailf:substatement "tailf:cli-run-template"; + tailf:substatement "tailf:cli-run-template-enter"; + tailf:substatement "tailf:cli-run-template-footer"; + tailf:substatement "tailf:cli-run-template-legend"; + tailf:substatement "tailf:cli-sequence-commands"; + tailf:substatement "tailf:cli-show-config"; + tailf:substatement "tailf:cli-show-no"; + tailf:substatement "tailf:cli-show-order-tag"; + tailf:substatement "tailf:cli-show-order-taglist"; + tailf:substatement "tailf:cli-show-template"; + tailf:substatement "tailf:cli-show-template-enter"; + tailf:substatement "tailf:cli-show-template-footer"; + tailf:substatement "tailf:cli-show-template-legend"; + tailf:substatement "tailf:cli-show-with-default"; + tailf:substatement "tailf:cli-strict-leafref"; + tailf:substatement "tailf:cli-suppress-key-abbreviation"; + tailf:substatement "tailf:cli-suppress-key-sort"; + tailf:substatement "tailf:cli-suppress-list-no"; + tailf:substatement "tailf:cli-suppress-mode"; + tailf:substatement "tailf:cli-suppress-no"; + tailf:substatement "tailf:cli-suppress-range"; + tailf:substatement "tailf:cli-suppress-shortenabled"; + tailf:substatement "tailf:cli-suppress-show-conf-path"; + tailf:substatement "tailf:cli-suppress-show-match"; + tailf:substatement "tailf:cli-suppress-show-path"; + tailf:substatement "tailf:cli-suppress-silent-no"; + tailf:substatement "tailf:cli-suppress-validation-warning-prompt"; + tailf:substatement "tailf:cli-suppress-wildcard"; + tailf:substatement "tailf:cli-table-footer"; + tailf:substatement "tailf:cli-table-legend"; + tailf:substatement "tailf:cli-trim-default"; + tailf:substatement "tailf:cli-value-display-template"; + tailf:substatement "tailf:display-when"; + tailf:substatement "tailf:hidden" { + tailf:occurence "*"; + } + tailf:substatement "tailf:inherit-set-hook"; + tailf:substatement "tailf:info"; + tailf:substatement "tailf:info-html"; + tailf:substatement "tailf:path" { + tailf:occurence "1"; + } + tailf:substatement "tailf:snmp-exclude-object"; + tailf:substatement "tailf:snmp-name" { + tailf:occurence "*"; + } + tailf:substatement "tailf:snmp-oid"; + tailf:substatement "tailf:sort-priority"; + description + "DEPRECATED: Use tailf:link instead. There are no plans to remove + tailf:symlink. + + This statement defines a 'symbolic link' from a node to some other node. + The argument is the name of the new node, and the mandatory substatement + 'tailf:path' points to the node which is linked to."; + } + + extension path { + argument path { + tailf:arg-type { + type string; + } + } + status deprecated; + tailf:occurence "1"; + tailf:use-in "tailf:symlink"; + description + "This statement specifies which node a symlink points to. + + The textual format of a symlink is an XPath absolute location path. If + the target lies within lists, all keys must be specified. + A key either has a value, or is a reference to a key in the path of the + source node, using the function current() as starting + point for an XPath location path. For example: + + /a/b[k1='paul'][k2=current()/../k]/c + "; + } + + /* + * Tail-f internal statements + */ + + extension internal { + tailf:use-in "tailf:callpoint"; + tailf:use-in "tailf:validate"; + tailf:use-in "tailf:actionpoint"; + description + "For internal ConfD / NCS use only."; + } + + extension junos-val-as-xml-tag { + tailf:use-in "leaf"; + description + "Internal extension to handle non-YANG JUNOS data models. + Use only for key enumeration leafs."; + } + + extension junos-val-with-prev-xml-tag { + tailf:use-in "leaf"; + description + "Internal extension to handle non-YANG JUNOS data models. + Use only for keys where previous key is marked with + 'tailf:junos-val-as-xml-tag'."; + } + + extension ned-ignore-compare-config { + tailf:use-in "leaf"; + description + "Typically used for ignoring device encrypted leafs + in the compare-config output."; + } + + extension xpath-root { + argument value { + tailf:arg-type { + type uint8; + } + } + tailf:use-in "must"; + tailf:use-in "when"; + tailf:use-in "path"; + tailf:use-in "tailf:display-when"; + tailf:use-in "tailf:cli-diff-dependency"; + tailf:use-in "tailf:cli-diff-before"; + tailf:use-in "tailf:cli-diff-delete-before"; + tailf:use-in "tailf:cli-diff-set-before"; + tailf:use-in "tailf:cli-diff-create-before"; + tailf:use-in "tailf:cli-diff-modify-before"; + tailf:use-in "tailf:cli-diff-after"; + tailf:use-in "tailf:cli-diff-delete-after"; + tailf:use-in "tailf:cli-diff-set-after"; + tailf:use-in "tailf:cli-diff-create-after"; + tailf:use-in "tailf:cli-diff-modify-after"; + description + "Internal extension to 'chroot' XPath expressions"; + } + + extension ncs-device-type { + argument type { + tailf:arg-type { + type string; + } + } + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "refine"; + tailf:use-in "module"; + description + "Internal extension to tell NCS what type of device the data model + is used for."; + } + + extension structure { + argument name { + tailf:arg-type { + type tailf:identifier; + } + } + tailf:use-in "module"; + tailf:use-in "submodule"; + tailf:occurence "*"; + + tailf:substatement "description"; + tailf:substatement "leaf" { + tailf:occurence "*"; + } + tailf:substatement "leaf-list" { + tailf:occurence "*"; + } + tailf:substatement "list" { + tailf:occurence "*"; + } + tailf:substatement "container" { + tailf:occurence "*"; + } + tailf:substatement "choice" { + tailf:occurence "*"; + } + tailf:substatement "uses" { + tailf:occurence "*"; + } + description + "Internal extension to define a data structure without any semantics + attached."; + } + + extension meta-data { + argument value { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:occurence "*"; + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "tailf:symlink"; + tailf:use-in "refine"; + tailf:substatement "tailf:meta-value" { + tailf:occurence "?"; + } + + description + "Extra meta information attached to the node. The instance data part + of this information is accessible using MAAPI. It is also printed + in communication with CLI NEDs, but is not visible to normal + users of the CLI. + + To CLI NEDs, the output will be printed as comments like this: + ! meta-data :: /ncs:devices/device{xyz}/config/xyz:AA :: A_STRING + + The schema information is available to the ConfD C-API through the + confd_cs_node struct, and to the JSON-RPC API through get-schema. + + Note: Can't be used on key leafs."; + } + + extension meta-value { + argument value { + tailf:arg-type { + type string; + } + } + tailf:use-in "tailf:meta-data"; + tailf:occurence "?"; + description + "This statement contains a string value for the meta data key. + + The output from the CLI to CLI NEDs will be similar to + comments like this: + ! meta-data :: /ncs:devices/device{xyz}/config/xyz:AA :: A_KEY :: A_VALUE + "; + } + + extension ned-data { + argument path-expression { + yin-element true; + tailf:arg-type { + type string; + } + } + tailf:occurence "*"; + tailf:use-in "container"; + tailf:use-in "list"; + tailf:use-in "leaf"; + tailf:use-in "leaf-list"; + tailf:use-in "refine"; + tailf:substatement "tailf:transaction" { + tailf:occurence "?"; + } + tailf:substatement "tailf:xpath-root" { + tailf:occurence "?"; + } + tailf:substatement "tailf:operation" { + tailf:occurence "*"; + } + description + "Dynamic meta information to be added by the NCS device manager. + + In the cases where NCS can't provide the complete 'to' and + 'from' transactions to the NED to read from (most notably when + using the commit queue) this annotation can be used to tell the + NCS device manager to save part of the 'to' and / or 'from' + transaction so that the NED will be able to read from these + parts as needed. + + The 'path-expression' will be used as an XPath filter to + indicate which data will be preserved. Use the 'transaction' + substatement to choose which transaction to apply the filter + on. The context node of the XPath filter is always the instance + data node corresponding to the schema node where the 'ned-data' + extension is added. + + Note that the filter will only be applied if the node that + has this annotation is in the diffset of the transaction. The + 'operation' substatement can be used to further limit when the + filter should be applied."; + } + + extension transaction { + argument direction { + yin-element true; + tailf:arg-type { + type enumeration { + enum from; + enum to; + enum both; + } + default to; + } + } + tailf:occurence "?"; + description + "Which transaction that the result of the XPath filter will be + applied to, when set to 'both' it will apply to both the 'to' + and the 'from' transaction."; + } + + extension operation { + argument op { + yin-element true; + tailf:arg-type { + type enumeration { + enum value_set; + enum created; + enum deleted; + enum modified; + enum moved; + } + } + } + tailf:occurence "*"; + description + "Only evaluate the XPath filter when the operation matches."; + } + + extension ned-default-handling { + argument mode { + tailf:arg-type { + type enumeration { + enum explicit; + enum report-all; + enum trim; + } + } + } + tailf:use-in "leaf"; + description + "This statement can only be used in NEDs for devices that have + irregular handling of defaults. It sets a special default + handling mode for the leaf, regardless of the device's native + default handling mode."; + } + +} diff --git a/explorer/src/main/resources/tailf-meta-extensions.yang b/explorer/src/main/resources/tailf-meta-extensions.yang new file mode 100644 index 0000000..664bb22 --- /dev/null +++ b/explorer/src/main/resources/tailf-meta-extensions.yang @@ -0,0 +1,153 @@ +submodule tailf-meta-extensions { + + belongs-to tailf-common { + prefix tailf; + } + + organization "Tail-f Systems"; + + description + "This submodule defines Tail-f YANG meta extensions statements."; + + revision 2017-03-08 { + description + "Released as part of ConfD-6.4 / NCS-4.4. + + Corrected the pattern for the tailf:tailf-oid typedef."; + } + + revision 2016-11-24 { + description + "Released as part of ConfD-6.3. + + Added tailf:identifier-ref."; + } + + revision 2013-11-07 { + description + "Released as part of ConfD-5.0. + + Added tailf:occurrence."; + } + + revision 2010-08-19 { + description + "Released as part of ConfD-3.3.1. + + Added tailf:snmp-identifier."; + } + + revision 2010-03-18 { + description + "Released as part of ConfD-3.2."; + } + + /* + * Types used to describe the extension statements' arguments. + */ + + typedef identifier { + type string { + pattern "[A-Za-z_][A-Za-z0-9_-]*"; + } + } + + typedef identifier-ref { + type string { + pattern "([A-Za-z_][A-Za-z0-9_-]*:)?[A-Za-z_][A-Za-z0-9_-]*"; + } + } + + typedef snmp-identifier { + type string { + pattern "[A-Za-z_][A-Za-z0-9_-]*(:[A-Za-z_][A-Za-z0-9_-]*)*"; + } + } + + typedef tailf-oid { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))' + + '|(2.(0|([1-9]\d*)))' + + '|([A-Za-z_][A-Za-z0-9_-]*))?' + + '(\.(0|([1-9]\d*)))+'; + } + } + + /* + * Descriptive meta extensions + */ + + extension use-in { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "extension"; + tailf:occurence "*"; + description + "Specifies in which statements a particular extension statement can be + used."; + } + + extension substatement { + argument name { + tailf:arg-type { + type string; + } + } + tailf:use-in "extension"; + tailf:occurence "*"; + + tailf:substatement "tailf:occurence"; + description + "Specifies which statements can occur as substatement to the + given statement."; + } + + extension arg-type { + tailf:use-in "argument"; + tailf:substatement "type" { + tailf:occurence "1"; + } + tailf:substatement "default"; + description + "Specifies the type of the argument."; + } + + extension occurence { + argument value { + tailf:arg-type { + type enumeration { + enum "?" { + description + "The extenstion may be given zero or one time. + This is the default."; + } + enum "*" { + description + "The extenstion may be given zero or multiple times."; + } + enum "+" { + description + "The extenstion must be given at least once."; + } + enum "1" { + description + "The extenstion must be given exactly once."; + } + } + } + } + tailf:use-in "extension"; + description + "Specifices how an extension statement may be used. + + If this statement is given as a substatement to 'extension', + it applies to all 'use-in' statements. + + If this statement is given as a substatement to 'tailf:substatement', + it applies to this substatement."; + } + +} diff --git a/explorer/src/main/webapp/VAADIN/themes/adtportal/adtportal.scss b/explorer/src/main/webapp/VAADIN/themes/adtportal/adtportal.scss new file mode 100644 index 0000000..a282372 --- /dev/null +++ b/explorer/src/main/webapp/VAADIN/themes/adtportal/adtportal.scss @@ -0,0 +1,36 @@ +$v-app-loading-text: "ANX Netconf Explorer"; +$v-background-color: #f4f4f4; +$v-app-background-color: #fff; +/* $valo-menu-background-color: darken($v-focus-color, 10%);*/ +$v-focus-color: #858587; +$v-gradient: v-linear 3%; + + +@import "../valo/valo.scss"; + +@mixin adtportal { + @include valo; + + .loginview { + background: unquote("linear-gradient(to bottom, #646464, #323232)"); + } + + .loginview .v-captiontext { + color: #ffffff; + } + + .loginview .welcome { + color: #ffffff; + font-size: 60px; + } + + .topbar { + background-color: #464646; + padding: 5px; + color: #ffffff; + } + + .topbar .topbartitle { + font-size: 20px; + } +} diff --git a/explorer/src/main/webapp/VAADIN/themes/adtportal/favicon.ico b/explorer/src/main/webapp/VAADIN/themes/adtportal/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..f39c4ec8356a82a0fcf179dd7446247f5b34249c GIT binary patch literal 1150 zcmZQzU<5(|0R|wcz>vYhz#zuJz@P!dKp~(AL>x$gfiO1%0|>*w{~-=mthn=^fnnx< z7!C4HNXTxu7>Ey(yLs~ioDC8K0gzr00Lj7FAbx%Q8MqlRahN$Ed5{>g9%MF14x}Fh zko6$5VftZWFdA78$REgjZ0-jupd!(jrjOM$LgFxadebn+l4>tZA36;)hgfl9)!{N1 PT|d3~3=E*OOg;txuMwW$ literal 0 HcmV?d00001 diff --git a/explorer/src/main/webapp/VAADIN/themes/adtportal/styles.scss b/explorer/src/main/webapp/VAADIN/themes/adtportal/styles.scss new file mode 100644 index 0000000..4d39181 --- /dev/null +++ b/explorer/src/main/webapp/VAADIN/themes/adtportal/styles.scss @@ -0,0 +1,9 @@ +@import "addons.scss"; +@import "adtportal.scss"; + +/* This file prefixes all rules with the theme name to avoid causing conflicts with other themes. */ +/* The actual styles should be defined in adtportal.scss */ +.adtportal { + @include addons; + @include adtportal; +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..6f4a430 --- /dev/null +++ b/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + com.cisco.stbarth.netconf + anx-root + pom + 0.1 + ANX root project + + + 3 + + + + anc + explorer + xrgrpc + + diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..53abe03 --- /dev/null +++ b/test.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec mvn -e -f explorer/pom.xml compile jetty:run diff --git a/xrgrpc/pom.xml b/xrgrpc/pom.xml new file mode 100644 index 0000000..a4368d7 --- /dev/null +++ b/xrgrpc/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + com.cisco.stbarth.netconf + xrgrpc + 0.1-SNAPSHOT + + 1.8 + 1.8 + + + + io.grpc + grpc-okhttp + 1.10.0 + + + io.grpc + grpc-protobuf + 1.10.0 + + + io.grpc + grpc-stub + 1.10.0 + + + diff --git a/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/XRGRPC.java b/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/XRGRPC.java new file mode 100644 index 0000000..b694040 --- /dev/null +++ b/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/XRGRPC.java @@ -0,0 +1,13121 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mdt_grpc_dialin.proto + +package com.cisco.stbarth.netconf.xrgrpc; + +public final class XRGRPC { + private XRGRPC() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code IOSXRExtensibleManagabilityService.CommitResult} + */ + public enum CommitResult + implements com.google.protobuf.ProtocolMessageEnum { + /** + * CHANGE = 0; + */ + CHANGE(0), + /** + * NO_CHANGE = 1; + */ + NO_CHANGE(1), + /** + * FAIL = 2; + */ + FAIL(2), + UNRECOGNIZED(-1), + ; + + /** + * CHANGE = 0; + */ + public static final int CHANGE_VALUE = 0; + /** + * NO_CHANGE = 1; + */ + public static final int NO_CHANGE_VALUE = 1; + /** + * FAIL = 2; + */ + public static final int FAIL_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CommitResult valueOf(int value) { + return forNumber(value); + } + + public static CommitResult forNumber(int value) { + switch (value) { + case 0: return CHANGE; + case 1: return NO_CHANGE; + case 2: return FAIL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + CommitResult> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CommitResult findValueByNumber(int number) { + return CommitResult.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.getDescriptor().getEnumTypes().get(0); + } + + private static final CommitResult[] VALUES = values(); + + public static CommitResult valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CommitResult(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:IOSXRExtensibleManagabilityService.CommitResult) + } + + public interface ConfigGetArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.ConfigGetArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ReqId = 1; + */ + long getReqId(); + + /** + * string yangpathjson = 2; + */ + java.lang.String getYangpathjson(); + /** + * string yangpathjson = 2; + */ + com.google.protobuf.ByteString + getYangpathjsonBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ConfigGetArgs} + */ + public static final class ConfigGetArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.ConfigGetArgs) + ConfigGetArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigGetArgs.newBuilder() to construct. + private ConfigGetArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigGetArgs() { + reqId_ = 0L; + yangpathjson_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigGetArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + reqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + yangpathjson_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs.Builder.class); + } + + public static final int REQID_FIELD_NUMBER = 1; + private long reqId_; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + + public static final int YANGPATHJSON_FIELD_NUMBER = 2; + private volatile java.lang.Object yangpathjson_; + /** + * string yangpathjson = 2; + */ + public java.lang.String getYangpathjson() { + java.lang.Object ref = yangpathjson_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangpathjson_ = s; + return s; + } + } + /** + * string yangpathjson = 2; + */ + public com.google.protobuf.ByteString + getYangpathjsonBytes() { + java.lang.Object ref = yangpathjson_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangpathjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (reqId_ != 0L) { + output.writeInt64(1, reqId_); + } + if (!getYangpathjsonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, yangpathjson_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, reqId_); + } + if (!getYangpathjsonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, yangpathjson_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs) obj; + + boolean result = true; + result = result && (getReqId() + == other.getReqId()); + result = result && getYangpathjson() + .equals(other.getYangpathjson()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (37 * hash) + YANGPATHJSON_FIELD_NUMBER; + hash = (53 * hash) + getYangpathjson().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ConfigGetArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.ConfigGetArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + reqId_ = 0L; + + yangpathjson_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs(this); + result.reqId_ = reqId_; + result.yangpathjson_ = yangpathjson_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs.getDefaultInstance()) return this; + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + if (!other.getYangpathjson().isEmpty()) { + yangpathjson_ = other.yangpathjson_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long reqId_ ; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 1; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 1; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object yangpathjson_ = ""; + /** + * string yangpathjson = 2; + */ + public java.lang.String getYangpathjson() { + java.lang.Object ref = yangpathjson_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangpathjson_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string yangpathjson = 2; + */ + public com.google.protobuf.ByteString + getYangpathjsonBytes() { + java.lang.Object ref = yangpathjson_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangpathjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string yangpathjson = 2; + */ + public Builder setYangpathjson( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + yangpathjson_ = value; + onChanged(); + return this; + } + /** + * string yangpathjson = 2; + */ + public Builder clearYangpathjson() { + + yangpathjson_ = getDefaultInstance().getYangpathjson(); + onChanged(); + return this; + } + /** + * string yangpathjson = 2; + */ + public Builder setYangpathjsonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + yangpathjson_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.ConfigGetArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.ConfigGetArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ConfigGetArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfigGetArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConfigGetReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.ConfigGetReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * string yangjson = 2; + */ + java.lang.String getYangjson(); + /** + * string yangjson = 2; + */ + com.google.protobuf.ByteString + getYangjsonBytes(); + + /** + * string errors = 3; + */ + java.lang.String getErrors(); + /** + * string errors = 3; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ConfigGetReply} + */ + public static final class ConfigGetReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.ConfigGetReply) + ConfigGetReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigGetReply.newBuilder() to construct. + private ConfigGetReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigGetReply() { + resReqId_ = 0L; + yangjson_ = ""; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigGetReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + yangjson_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int YANGJSON_FIELD_NUMBER = 2; + private volatile java.lang.Object yangjson_; + /** + * string yangjson = 2; + */ + public java.lang.String getYangjson() { + java.lang.Object ref = yangjson_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangjson_ = s; + return s; + } + } + /** + * string yangjson = 2; + */ + public com.google.protobuf.ByteString + getYangjsonBytes() { + java.lang.Object ref = yangjson_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERRORS_FIELD_NUMBER = 3; + private volatile java.lang.Object errors_; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!getYangjsonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, yangjson_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!getYangjsonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, yangjson_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getYangjson() + .equals(other.getYangjson()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + YANGJSON_FIELD_NUMBER; + hash = (53 * hash) + getYangjson().hashCode(); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ConfigGetReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.ConfigGetReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + yangjson_ = ""; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply(this); + result.resReqId_ = resReqId_; + result.yangjson_ = yangjson_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getYangjson().isEmpty()) { + yangjson_ = other.yangjson_; + onChanged(); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object yangjson_ = ""; + /** + * string yangjson = 2; + */ + public java.lang.String getYangjson() { + java.lang.Object ref = yangjson_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangjson_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string yangjson = 2; + */ + public com.google.protobuf.ByteString + getYangjsonBytes() { + java.lang.Object ref = yangjson_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string yangjson = 2; + */ + public Builder setYangjson( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + yangjson_ = value; + onChanged(); + return this; + } + /** + * string yangjson = 2; + */ + public Builder clearYangjson() { + + yangjson_ = getDefaultInstance().getYangjson(); + onChanged(); + return this; + } + /** + * string yangjson = 2; + */ + public Builder setYangjsonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + yangjson_ = value; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 3; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.ConfigGetReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.ConfigGetReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ConfigGetReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfigGetReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetOperArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.GetOperArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ReqId = 1; + */ + long getReqId(); + + /** + * string yangpathjson = 2; + */ + java.lang.String getYangpathjson(); + /** + * string yangpathjson = 2; + */ + com.google.protobuf.ByteString + getYangpathjsonBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.GetOperArgs} + */ + public static final class GetOperArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.GetOperArgs) + GetOperArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetOperArgs.newBuilder() to construct. + private GetOperArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetOperArgs() { + reqId_ = 0L; + yangpathjson_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetOperArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + reqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + yangpathjson_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs.Builder.class); + } + + public static final int REQID_FIELD_NUMBER = 1; + private long reqId_; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + + public static final int YANGPATHJSON_FIELD_NUMBER = 2; + private volatile java.lang.Object yangpathjson_; + /** + * string yangpathjson = 2; + */ + public java.lang.String getYangpathjson() { + java.lang.Object ref = yangpathjson_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangpathjson_ = s; + return s; + } + } + /** + * string yangpathjson = 2; + */ + public com.google.protobuf.ByteString + getYangpathjsonBytes() { + java.lang.Object ref = yangpathjson_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangpathjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (reqId_ != 0L) { + output.writeInt64(1, reqId_); + } + if (!getYangpathjsonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, yangpathjson_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, reqId_); + } + if (!getYangpathjsonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, yangpathjson_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs) obj; + + boolean result = true; + result = result && (getReqId() + == other.getReqId()); + result = result && getYangpathjson() + .equals(other.getYangpathjson()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (37 * hash) + YANGPATHJSON_FIELD_NUMBER; + hash = (53 * hash) + getYangpathjson().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.GetOperArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.GetOperArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + reqId_ = 0L; + + yangpathjson_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs(this); + result.reqId_ = reqId_; + result.yangpathjson_ = yangpathjson_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs.getDefaultInstance()) return this; + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + if (!other.getYangpathjson().isEmpty()) { + yangpathjson_ = other.yangpathjson_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long reqId_ ; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 1; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 1; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object yangpathjson_ = ""; + /** + * string yangpathjson = 2; + */ + public java.lang.String getYangpathjson() { + java.lang.Object ref = yangpathjson_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangpathjson_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string yangpathjson = 2; + */ + public com.google.protobuf.ByteString + getYangpathjsonBytes() { + java.lang.Object ref = yangpathjson_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangpathjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string yangpathjson = 2; + */ + public Builder setYangpathjson( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + yangpathjson_ = value; + onChanged(); + return this; + } + /** + * string yangpathjson = 2; + */ + public Builder clearYangpathjson() { + + yangpathjson_ = getDefaultInstance().getYangpathjson(); + onChanged(); + return this; + } + /** + * string yangpathjson = 2; + */ + public Builder setYangpathjsonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + yangpathjson_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.GetOperArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.GetOperArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GetOperArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetOperArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetOperReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.GetOperReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * string yangjson = 2; + */ + java.lang.String getYangjson(); + /** + * string yangjson = 2; + */ + com.google.protobuf.ByteString + getYangjsonBytes(); + + /** + * string errors = 3; + */ + java.lang.String getErrors(); + /** + * string errors = 3; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.GetOperReply} + */ + public static final class GetOperReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.GetOperReply) + GetOperReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetOperReply.newBuilder() to construct. + private GetOperReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetOperReply() { + resReqId_ = 0L; + yangjson_ = ""; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetOperReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + yangjson_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int YANGJSON_FIELD_NUMBER = 2; + private volatile java.lang.Object yangjson_; + /** + * string yangjson = 2; + */ + public java.lang.String getYangjson() { + java.lang.Object ref = yangjson_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangjson_ = s; + return s; + } + } + /** + * string yangjson = 2; + */ + public com.google.protobuf.ByteString + getYangjsonBytes() { + java.lang.Object ref = yangjson_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERRORS_FIELD_NUMBER = 3; + private volatile java.lang.Object errors_; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!getYangjsonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, yangjson_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!getYangjsonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, yangjson_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getYangjson() + .equals(other.getYangjson()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + YANGJSON_FIELD_NUMBER; + hash = (53 * hash) + getYangjson().hashCode(); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.GetOperReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.GetOperReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + yangjson_ = ""; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_GetOperReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply(this); + result.resReqId_ = resReqId_; + result.yangjson_ = yangjson_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getYangjson().isEmpty()) { + yangjson_ = other.yangjson_; + onChanged(); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object yangjson_ = ""; + /** + * string yangjson = 2; + */ + public java.lang.String getYangjson() { + java.lang.Object ref = yangjson_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangjson_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string yangjson = 2; + */ + public com.google.protobuf.ByteString + getYangjsonBytes() { + java.lang.Object ref = yangjson_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string yangjson = 2; + */ + public Builder setYangjson( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + yangjson_ = value; + onChanged(); + return this; + } + /** + * string yangjson = 2; + */ + public Builder clearYangjson() { + + yangjson_ = getDefaultInstance().getYangjson(); + onChanged(); + return this; + } + /** + * string yangjson = 2; + */ + public Builder setYangjsonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + yangjson_ = value; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 3; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.GetOperReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.GetOperReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GetOperReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetOperReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConfigArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.ConfigArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ReqId = 1; + */ + long getReqId(); + + /** + * string yangjson = 2; + */ + java.lang.String getYangjson(); + /** + * string yangjson = 2; + */ + com.google.protobuf.ByteString + getYangjsonBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ConfigArgs} + */ + public static final class ConfigArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.ConfigArgs) + ConfigArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigArgs.newBuilder() to construct. + private ConfigArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigArgs() { + reqId_ = 0L; + yangjson_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + reqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + yangjson_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.Builder.class); + } + + public static final int REQID_FIELD_NUMBER = 1; + private long reqId_; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + + public static final int YANGJSON_FIELD_NUMBER = 2; + private volatile java.lang.Object yangjson_; + /** + * string yangjson = 2; + */ + public java.lang.String getYangjson() { + java.lang.Object ref = yangjson_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangjson_ = s; + return s; + } + } + /** + * string yangjson = 2; + */ + public com.google.protobuf.ByteString + getYangjsonBytes() { + java.lang.Object ref = yangjson_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (reqId_ != 0L) { + output.writeInt64(1, reqId_); + } + if (!getYangjsonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, yangjson_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, reqId_); + } + if (!getYangjsonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, yangjson_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs) obj; + + boolean result = true; + result = result && (getReqId() + == other.getReqId()); + result = result && getYangjson() + .equals(other.getYangjson()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (37 * hash) + YANGJSON_FIELD_NUMBER; + hash = (53 * hash) + getYangjson().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ConfigArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.ConfigArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + reqId_ = 0L; + + yangjson_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs(this); + result.reqId_ = reqId_; + result.yangjson_ = yangjson_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.getDefaultInstance()) return this; + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + if (!other.getYangjson().isEmpty()) { + yangjson_ = other.yangjson_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long reqId_ ; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 1; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 1; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object yangjson_ = ""; + /** + * string yangjson = 2; + */ + public java.lang.String getYangjson() { + java.lang.Object ref = yangjson_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangjson_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string yangjson = 2; + */ + public com.google.protobuf.ByteString + getYangjsonBytes() { + java.lang.Object ref = yangjson_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string yangjson = 2; + */ + public Builder setYangjson( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + yangjson_ = value; + onChanged(); + return this; + } + /** + * string yangjson = 2; + */ + public Builder clearYangjson() { + + yangjson_ = getDefaultInstance().getYangjson(); + onChanged(); + return this; + } + /** + * string yangjson = 2; + */ + public Builder setYangjsonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + yangjson_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.ConfigArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.ConfigArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ConfigArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfigArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConfigReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.ConfigReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * string errors = 2; + */ + java.lang.String getErrors(); + /** + * string errors = 2; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ConfigReply} + */ + public static final class ConfigReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.ConfigReply) + ConfigReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigReply.newBuilder() to construct. + private ConfigReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigReply() { + resReqId_ = 0L; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int ERRORS_FIELD_NUMBER = 2; + private volatile java.lang.Object errors_; + /** + * string errors = 2; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 2; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ConfigReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.ConfigReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ConfigReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply(this); + result.resReqId_ = resReqId_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 2; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 2; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 2; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 2; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 2; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.ConfigReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.ConfigReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ConfigReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfigReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CliConfigArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CliConfigArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ReqId = 1; + */ + long getReqId(); + + /** + * string cli = 2; + */ + java.lang.String getCli(); + /** + * string cli = 2; + */ + com.google.protobuf.ByteString + getCliBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CliConfigArgs} + */ + public static final class CliConfigArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CliConfigArgs) + CliConfigArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CliConfigArgs.newBuilder() to construct. + private CliConfigArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CliConfigArgs() { + reqId_ = 0L; + cli_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CliConfigArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + reqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + cli_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs.Builder.class); + } + + public static final int REQID_FIELD_NUMBER = 1; + private long reqId_; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + + public static final int CLI_FIELD_NUMBER = 2; + private volatile java.lang.Object cli_; + /** + * string cli = 2; + */ + public java.lang.String getCli() { + java.lang.Object ref = cli_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cli_ = s; + return s; + } + } + /** + * string cli = 2; + */ + public com.google.protobuf.ByteString + getCliBytes() { + java.lang.Object ref = cli_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cli_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (reqId_ != 0L) { + output.writeInt64(1, reqId_); + } + if (!getCliBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cli_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, reqId_); + } + if (!getCliBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cli_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs) obj; + + boolean result = true; + result = result && (getReqId() + == other.getReqId()); + result = result && getCli() + .equals(other.getCli()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (37 * hash) + CLI_FIELD_NUMBER; + hash = (53 * hash) + getCli().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CliConfigArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CliConfigArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + reqId_ = 0L; + + cli_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs(this); + result.reqId_ = reqId_; + result.cli_ = cli_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs.getDefaultInstance()) return this; + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + if (!other.getCli().isEmpty()) { + cli_ = other.cli_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long reqId_ ; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 1; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 1; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object cli_ = ""; + /** + * string cli = 2; + */ + public java.lang.String getCli() { + java.lang.Object ref = cli_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cli_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string cli = 2; + */ + public com.google.protobuf.ByteString + getCliBytes() { + java.lang.Object ref = cli_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cli_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string cli = 2; + */ + public Builder setCli( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cli_ = value; + onChanged(); + return this; + } + /** + * string cli = 2; + */ + public Builder clearCli() { + + cli_ = getDefaultInstance().getCli(); + onChanged(); + return this; + } + /** + * string cli = 2; + */ + public Builder setCliBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cli_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CliConfigArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CliConfigArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CliConfigArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CliConfigArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CliConfigReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CliConfigReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * string errors = 2; + */ + java.lang.String getErrors(); + /** + * string errors = 2; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CliConfigReply} + */ + public static final class CliConfigReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CliConfigReply) + CliConfigReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use CliConfigReply.newBuilder() to construct. + private CliConfigReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CliConfigReply() { + resReqId_ = 0L; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CliConfigReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int ERRORS_FIELD_NUMBER = 2; + private volatile java.lang.Object errors_; + /** + * string errors = 2; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 2; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CliConfigReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CliConfigReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply(this); + result.resReqId_ = resReqId_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 2; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 2; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 2; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 2; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 2; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CliConfigReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CliConfigReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CliConfigReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CliConfigReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CommitReplaceArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CommitReplaceArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ReqId = 1; + */ + long getReqId(); + + /** + * string cli = 2; + */ + java.lang.String getCli(); + /** + * string cli = 2; + */ + com.google.protobuf.ByteString + getCliBytes(); + + /** + * string yangjson = 3; + */ + java.lang.String getYangjson(); + /** + * string yangjson = 3; + */ + com.google.protobuf.ByteString + getYangjsonBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitReplaceArgs} + */ + public static final class CommitReplaceArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CommitReplaceArgs) + CommitReplaceArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommitReplaceArgs.newBuilder() to construct. + private CommitReplaceArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CommitReplaceArgs() { + reqId_ = 0L; + cli_ = ""; + yangjson_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommitReplaceArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + reqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + cli_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + yangjson_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs.Builder.class); + } + + public static final int REQID_FIELD_NUMBER = 1; + private long reqId_; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + + public static final int CLI_FIELD_NUMBER = 2; + private volatile java.lang.Object cli_; + /** + * string cli = 2; + */ + public java.lang.String getCli() { + java.lang.Object ref = cli_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cli_ = s; + return s; + } + } + /** + * string cli = 2; + */ + public com.google.protobuf.ByteString + getCliBytes() { + java.lang.Object ref = cli_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cli_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int YANGJSON_FIELD_NUMBER = 3; + private volatile java.lang.Object yangjson_; + /** + * string yangjson = 3; + */ + public java.lang.String getYangjson() { + java.lang.Object ref = yangjson_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangjson_ = s; + return s; + } + } + /** + * string yangjson = 3; + */ + public com.google.protobuf.ByteString + getYangjsonBytes() { + java.lang.Object ref = yangjson_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (reqId_ != 0L) { + output.writeInt64(1, reqId_); + } + if (!getCliBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cli_); + } + if (!getYangjsonBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, yangjson_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, reqId_); + } + if (!getCliBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cli_); + } + if (!getYangjsonBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, yangjson_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs) obj; + + boolean result = true; + result = result && (getReqId() + == other.getReqId()); + result = result && getCli() + .equals(other.getCli()); + result = result && getYangjson() + .equals(other.getYangjson()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (37 * hash) + CLI_FIELD_NUMBER; + hash = (53 * hash) + getCli().hashCode(); + hash = (37 * hash) + YANGJSON_FIELD_NUMBER; + hash = (53 * hash) + getYangjson().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitReplaceArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CommitReplaceArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + reqId_ = 0L; + + cli_ = ""; + + yangjson_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs(this); + result.reqId_ = reqId_; + result.cli_ = cli_; + result.yangjson_ = yangjson_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs.getDefaultInstance()) return this; + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + if (!other.getCli().isEmpty()) { + cli_ = other.cli_; + onChanged(); + } + if (!other.getYangjson().isEmpty()) { + yangjson_ = other.yangjson_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long reqId_ ; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 1; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 1; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object cli_ = ""; + /** + * string cli = 2; + */ + public java.lang.String getCli() { + java.lang.Object ref = cli_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cli_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string cli = 2; + */ + public com.google.protobuf.ByteString + getCliBytes() { + java.lang.Object ref = cli_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cli_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string cli = 2; + */ + public Builder setCli( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cli_ = value; + onChanged(); + return this; + } + /** + * string cli = 2; + */ + public Builder clearCli() { + + cli_ = getDefaultInstance().getCli(); + onChanged(); + return this; + } + /** + * string cli = 2; + */ + public Builder setCliBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cli_ = value; + onChanged(); + return this; + } + + private java.lang.Object yangjson_ = ""; + /** + * string yangjson = 3; + */ + public java.lang.String getYangjson() { + java.lang.Object ref = yangjson_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + yangjson_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string yangjson = 3; + */ + public com.google.protobuf.ByteString + getYangjsonBytes() { + java.lang.Object ref = yangjson_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + yangjson_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string yangjson = 3; + */ + public Builder setYangjson( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + yangjson_ = value; + onChanged(); + return this; + } + /** + * string yangjson = 3; + */ + public Builder clearYangjson() { + + yangjson_ = getDefaultInstance().getYangjson(); + onChanged(); + return this; + } + /** + * string yangjson = 3; + */ + public Builder setYangjsonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + yangjson_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CommitReplaceArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CommitReplaceArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CommitReplaceArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitReplaceArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CommitReplaceReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CommitReplaceReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * string errors = 2; + */ + java.lang.String getErrors(); + /** + * string errors = 2; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitReplaceReply} + */ + public static final class CommitReplaceReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CommitReplaceReply) + CommitReplaceReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommitReplaceReply.newBuilder() to construct. + private CommitReplaceReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CommitReplaceReply() { + resReqId_ = 0L; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommitReplaceReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int ERRORS_FIELD_NUMBER = 2; + private volatile java.lang.Object errors_; + /** + * string errors = 2; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 2; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitReplaceReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CommitReplaceReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply(this); + result.resReqId_ = resReqId_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 2; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 2; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 2; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 2; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 2; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CommitReplaceReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CommitReplaceReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CommitReplaceReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitReplaceReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CommitMsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CommitMsg) + com.google.protobuf.MessageOrBuilder { + + /** + * string label = 1; + */ + java.lang.String getLabel(); + /** + * string label = 1; + */ + com.google.protobuf.ByteString + getLabelBytes(); + + /** + * string comment = 2; + */ + java.lang.String getComment(); + /** + * string comment = 2; + */ + com.google.protobuf.ByteString + getCommentBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitMsg} + */ + public static final class CommitMsg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CommitMsg) + CommitMsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommitMsg.newBuilder() to construct. + private CommitMsg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CommitMsg() { + label_ = ""; + comment_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommitMsg( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + comment_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitMsg_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitMsg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.Builder.class); + } + + public static final int LABEL_FIELD_NUMBER = 1; + private volatile java.lang.Object label_; + /** + * string label = 1; + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } + } + /** + * string label = 1; + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMENT_FIELD_NUMBER = 2; + private volatile java.lang.Object comment_; + /** + * string comment = 2; + */ + public java.lang.String getComment() { + java.lang.Object ref = comment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + comment_ = s; + return s; + } + } + /** + * string comment = 2; + */ + public com.google.protobuf.ByteString + getCommentBytes() { + java.lang.Object ref = comment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + comment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, label_); + } + if (!getCommentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, comment_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, label_); + } + if (!getCommentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, comment_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg) obj; + + boolean result = true; + result = result && getLabel() + .equals(other.getLabel()); + result = result && getComment() + .equals(other.getComment()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (37 * hash) + COMMENT_FIELD_NUMBER; + hash = (53 * hash) + getComment().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitMsg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CommitMsg) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitMsg_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitMsg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + label_ = ""; + + comment_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitMsg_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg(this); + result.label_ = label_; + result.comment_ = comment_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.getDefaultInstance()) return this; + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + if (!other.getComment().isEmpty()) { + comment_ = other.comment_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object label_ = ""; + /** + * string label = 1; + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string label = 1; + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string label = 1; + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + * string label = 1; + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + * string label = 1; + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + + private java.lang.Object comment_ = ""; + /** + * string comment = 2; + */ + public java.lang.String getComment() { + java.lang.Object ref = comment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + comment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string comment = 2; + */ + public com.google.protobuf.ByteString + getCommentBytes() { + java.lang.Object ref = comment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + comment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string comment = 2; + */ + public Builder setComment( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + comment_ = value; + onChanged(); + return this; + } + /** + * string comment = 2; + */ + public Builder clearComment() { + + comment_ = getDefaultInstance().getComment(); + onChanged(); + return this; + } + /** + * string comment = 2; + */ + public Builder setCommentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + comment_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CommitMsg) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CommitMsg) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CommitMsg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitMsg(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CommitArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CommitArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + boolean hasMsg(); + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg getMsg(); + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsgOrBuilder getMsgOrBuilder(); + + /** + * int64 ReqId = 2; + */ + long getReqId(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitArgs} + */ + public static final class CommitArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CommitArgs) + CommitArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommitArgs.newBuilder() to construct. + private CommitArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CommitArgs() { + reqId_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommitArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.Builder subBuilder = null; + if (msg_ != null) { + subBuilder = msg_.toBuilder(); + } + msg_ = input.readMessage(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(msg_); + msg_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + reqId_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs.Builder.class); + } + + public static final int MSG_FIELD_NUMBER = 1; + private com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg msg_; + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public boolean hasMsg() { + return msg_ != null; + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg getMsg() { + return msg_ == null ? com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.getDefaultInstance() : msg_; + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsgOrBuilder getMsgOrBuilder() { + return getMsg(); + } + + public static final int REQID_FIELD_NUMBER = 2; + private long reqId_; + /** + * int64 ReqId = 2; + */ + public long getReqId() { + return reqId_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (msg_ != null) { + output.writeMessage(1, getMsg()); + } + if (reqId_ != 0L) { + output.writeInt64(2, reqId_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (msg_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getMsg()); + } + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, reqId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs) obj; + + boolean result = true; + result = result && (hasMsg() == other.hasMsg()); + if (hasMsg()) { + result = result && getMsg() + .equals(other.getMsg()); + } + result = result && (getReqId() + == other.getReqId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMsg()) { + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + } + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CommitArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (msgBuilder_ == null) { + msg_ = null; + } else { + msg_ = null; + msgBuilder_ = null; + } + reqId_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs(this); + if (msgBuilder_ == null) { + result.msg_ = msg_; + } else { + result.msg_ = msgBuilder_.build(); + } + result.reqId_ = reqId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs.getDefaultInstance()) return this; + if (other.hasMsg()) { + mergeMsg(other.getMsg()); + } + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg msg_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.Builder, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsgOrBuilder> msgBuilder_; + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public boolean hasMsg() { + return msgBuilder_ != null || msg_ != null; + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg getMsg() { + if (msgBuilder_ == null) { + return msg_ == null ? com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.getDefaultInstance() : msg_; + } else { + return msgBuilder_.getMessage(); + } + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public Builder setMsg(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg value) { + if (msgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + msg_ = value; + onChanged(); + } else { + msgBuilder_.setMessage(value); + } + + return this; + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public Builder setMsg( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.Builder builderForValue) { + if (msgBuilder_ == null) { + msg_ = builderForValue.build(); + onChanged(); + } else { + msgBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public Builder mergeMsg(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg value) { + if (msgBuilder_ == null) { + if (msg_ != null) { + msg_ = + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.newBuilder(msg_).mergeFrom(value).buildPartial(); + } else { + msg_ = value; + } + onChanged(); + } else { + msgBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public Builder clearMsg() { + if (msgBuilder_ == null) { + msg_ = null; + onChanged(); + } else { + msg_ = null; + msgBuilder_ = null; + } + + return this; + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.Builder getMsgBuilder() { + + onChanged(); + return getMsgFieldBuilder().getBuilder(); + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsgOrBuilder getMsgOrBuilder() { + if (msgBuilder_ != null) { + return msgBuilder_.getMessageOrBuilder(); + } else { + return msg_ == null ? + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.getDefaultInstance() : msg_; + } + } + /** + * .IOSXRExtensibleManagabilityService.CommitMsg msg = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.Builder, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsgOrBuilder> + getMsgFieldBuilder() { + if (msgBuilder_ == null) { + msgBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsg.Builder, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitMsgOrBuilder>( + getMsg(), + getParentForChildren(), + isClean()); + msg_ = null; + } + return msgBuilder_; + } + + private long reqId_ ; + /** + * int64 ReqId = 2; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 2; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 2; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CommitArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CommitArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CommitArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CommitReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CommitReply) + com.google.protobuf.MessageOrBuilder { + + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + int getResultValue(); + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult getResult(); + + /** + * int64 ResReqId = 2; + */ + long getResReqId(); + + /** + * string errors = 3; + */ + java.lang.String getErrors(); + /** + * string errors = 3; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitReply} + */ + public static final class CommitReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CommitReply) + CommitReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommitReply.newBuilder() to construct. + private CommitReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CommitReply() { + result_ = 0; + resReqId_ = 0L; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommitReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + result_ = rawValue; + break; + } + case 16: { + + resReqId_ = input.readInt64(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply.Builder.class); + } + + public static final int RESULT_FIELD_NUMBER = 1; + private int result_; + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + public int getResultValue() { + return result_; + } + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult getResult() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult result = com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult.valueOf(result_); + return result == null ? com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult.UNRECOGNIZED : result; + } + + public static final int RESREQID_FIELD_NUMBER = 2; + private long resReqId_; + /** + * int64 ResReqId = 2; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int ERRORS_FIELD_NUMBER = 3; + private volatile java.lang.Object errors_; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (result_ != com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult.CHANGE.getNumber()) { + output.writeEnum(1, result_); + } + if (resReqId_ != 0L) { + output.writeInt64(2, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (result_ != com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult.CHANGE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, result_); + } + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply) obj; + + boolean result = true; + result = result && result_ == other.result_; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESULT_FIELD_NUMBER; + hash = (53 * hash) + result_; + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CommitReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CommitReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + result_ = 0; + + resReqId_ = 0L; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CommitReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply(this); + result.result_ = result_; + result.resReqId_ = resReqId_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply.getDefaultInstance()) return this; + if (other.result_ != 0) { + setResultValue(other.getResultValue()); + } + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int result_ = 0; + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + public int getResultValue() { + return result_; + } + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + public Builder setResultValue(int value) { + result_ = value; + onChanged(); + return this; + } + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult getResult() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult result = com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult.valueOf(result_); + return result == null ? com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult.UNRECOGNIZED : result; + } + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + public Builder setResult(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitResult value) { + if (value == null) { + throw new NullPointerException(); + } + + result_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .IOSXRExtensibleManagabilityService.CommitResult result = 1; + */ + public Builder clearResult() { + + result_ = 0; + onChanged(); + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 2; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 2; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 2; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 3; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CommitReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CommitReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CommitReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DiscardChangesArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.DiscardChangesArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ReqId = 1; + */ + long getReqId(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.DiscardChangesArgs} + */ + public static final class DiscardChangesArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.DiscardChangesArgs) + DiscardChangesArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use DiscardChangesArgs.newBuilder() to construct. + private DiscardChangesArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DiscardChangesArgs() { + reqId_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DiscardChangesArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + reqId_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs.Builder.class); + } + + public static final int REQID_FIELD_NUMBER = 1; + private long reqId_; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (reqId_ != 0L) { + output.writeInt64(1, reqId_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, reqId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs) obj; + + boolean result = true; + result = result && (getReqId() + == other.getReqId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.DiscardChangesArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.DiscardChangesArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + reqId_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs(this); + result.reqId_ = reqId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs.getDefaultInstance()) return this; + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long reqId_ ; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 1; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 1; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.DiscardChangesArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.DiscardChangesArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DiscardChangesArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DiscardChangesArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DiscardChangesReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.DiscardChangesReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * string errors = 2; + */ + java.lang.String getErrors(); + /** + * string errors = 2; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.DiscardChangesReply} + */ + public static final class DiscardChangesReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.DiscardChangesReply) + DiscardChangesReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use DiscardChangesReply.newBuilder() to construct. + private DiscardChangesReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DiscardChangesReply() { + resReqId_ = 0L; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DiscardChangesReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int ERRORS_FIELD_NUMBER = 2; + private volatile java.lang.Object errors_; + /** + * string errors = 2; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 2; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.DiscardChangesReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.DiscardChangesReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply(this); + result.resReqId_ = resReqId_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 2; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 2; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 2; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 2; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 2; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.DiscardChangesReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.DiscardChangesReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DiscardChangesReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DiscardChangesReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ShowCmdArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.ShowCmdArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ReqId = 1; + */ + long getReqId(); + + /** + * string cli = 2; + */ + java.lang.String getCli(); + /** + * string cli = 2; + */ + com.google.protobuf.ByteString + getCliBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ShowCmdArgs} + */ + public static final class ShowCmdArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.ShowCmdArgs) + ShowCmdArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShowCmdArgs.newBuilder() to construct. + private ShowCmdArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ShowCmdArgs() { + reqId_ = 0L; + cli_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ShowCmdArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + reqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + cli_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.Builder.class); + } + + public static final int REQID_FIELD_NUMBER = 1; + private long reqId_; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + + public static final int CLI_FIELD_NUMBER = 2; + private volatile java.lang.Object cli_; + /** + * string cli = 2; + */ + public java.lang.String getCli() { + java.lang.Object ref = cli_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cli_ = s; + return s; + } + } + /** + * string cli = 2; + */ + public com.google.protobuf.ByteString + getCliBytes() { + java.lang.Object ref = cli_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cli_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (reqId_ != 0L) { + output.writeInt64(1, reqId_); + } + if (!getCliBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cli_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, reqId_); + } + if (!getCliBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cli_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs) obj; + + boolean result = true; + result = result && (getReqId() + == other.getReqId()); + result = result && getCli() + .equals(other.getCli()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (37 * hash) + CLI_FIELD_NUMBER; + hash = (53 * hash) + getCli().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ShowCmdArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.ShowCmdArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + reqId_ = 0L; + + cli_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs(this); + result.reqId_ = reqId_; + result.cli_ = cli_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.getDefaultInstance()) return this; + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + if (!other.getCli().isEmpty()) { + cli_ = other.cli_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long reqId_ ; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 1; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 1; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object cli_ = ""; + /** + * string cli = 2; + */ + public java.lang.String getCli() { + java.lang.Object ref = cli_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cli_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string cli = 2; + */ + public com.google.protobuf.ByteString + getCliBytes() { + java.lang.Object ref = cli_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cli_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string cli = 2; + */ + public Builder setCli( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cli_ = value; + onChanged(); + return this; + } + /** + * string cli = 2; + */ + public Builder clearCli() { + + cli_ = getDefaultInstance().getCli(); + onChanged(); + return this; + } + /** + * string cli = 2; + */ + public Builder setCliBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cli_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.ShowCmdArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.ShowCmdArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ShowCmdArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ShowCmdArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ShowCmdTextReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.ShowCmdTextReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * string output = 2; + */ + java.lang.String getOutput(); + /** + * string output = 2; + */ + com.google.protobuf.ByteString + getOutputBytes(); + + /** + * string errors = 3; + */ + java.lang.String getErrors(); + /** + * string errors = 3; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ShowCmdTextReply} + */ + public static final class ShowCmdTextReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.ShowCmdTextReply) + ShowCmdTextReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShowCmdTextReply.newBuilder() to construct. + private ShowCmdTextReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ShowCmdTextReply() { + resReqId_ = 0L; + output_ = ""; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ShowCmdTextReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + output_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int OUTPUT_FIELD_NUMBER = 2; + private volatile java.lang.Object output_; + /** + * string output = 2; + */ + public java.lang.String getOutput() { + java.lang.Object ref = output_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + output_ = s; + return s; + } + } + /** + * string output = 2; + */ + public com.google.protobuf.ByteString + getOutputBytes() { + java.lang.Object ref = output_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + output_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERRORS_FIELD_NUMBER = 3; + private volatile java.lang.Object errors_; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!getOutputBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, output_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!getOutputBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, output_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getOutput() + .equals(other.getOutput()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getOutput().hashCode(); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ShowCmdTextReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.ShowCmdTextReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + output_ = ""; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply(this); + result.resReqId_ = resReqId_; + result.output_ = output_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getOutput().isEmpty()) { + output_ = other.output_; + onChanged(); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object output_ = ""; + /** + * string output = 2; + */ + public java.lang.String getOutput() { + java.lang.Object ref = output_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + output_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string output = 2; + */ + public com.google.protobuf.ByteString + getOutputBytes() { + java.lang.Object ref = output_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + output_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string output = 2; + */ + public Builder setOutput( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + output_ = value; + onChanged(); + return this; + } + /** + * string output = 2; + */ + public Builder clearOutput() { + + output_ = getDefaultInstance().getOutput(); + onChanged(); + return this; + } + /** + * string output = 2; + */ + public Builder setOutputBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + output_ = value; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 3; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.ShowCmdTextReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.ShowCmdTextReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ShowCmdTextReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ShowCmdTextReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ShowCmdJSONReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.ShowCmdJSONReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * string jsonoutput = 2; + */ + java.lang.String getJsonoutput(); + /** + * string jsonoutput = 2; + */ + com.google.protobuf.ByteString + getJsonoutputBytes(); + + /** + * string errors = 3; + */ + java.lang.String getErrors(); + /** + * string errors = 3; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ShowCmdJSONReply} + */ + public static final class ShowCmdJSONReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.ShowCmdJSONReply) + ShowCmdJSONReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShowCmdJSONReply.newBuilder() to construct. + private ShowCmdJSONReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ShowCmdJSONReply() { + resReqId_ = 0L; + jsonoutput_ = ""; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ShowCmdJSONReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + jsonoutput_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int JSONOUTPUT_FIELD_NUMBER = 2; + private volatile java.lang.Object jsonoutput_; + /** + * string jsonoutput = 2; + */ + public java.lang.String getJsonoutput() { + java.lang.Object ref = jsonoutput_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jsonoutput_ = s; + return s; + } + } + /** + * string jsonoutput = 2; + */ + public com.google.protobuf.ByteString + getJsonoutputBytes() { + java.lang.Object ref = jsonoutput_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + jsonoutput_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERRORS_FIELD_NUMBER = 3; + private volatile java.lang.Object errors_; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!getJsonoutputBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, jsonoutput_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!getJsonoutputBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, jsonoutput_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getJsonoutput() + .equals(other.getJsonoutput()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + JSONOUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getJsonoutput().hashCode(); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.ShowCmdJSONReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.ShowCmdJSONReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + jsonoutput_ = ""; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply(this); + result.resReqId_ = resReqId_; + result.jsonoutput_ = jsonoutput_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (!other.getJsonoutput().isEmpty()) { + jsonoutput_ = other.jsonoutput_; + onChanged(); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object jsonoutput_ = ""; + /** + * string jsonoutput = 2; + */ + public java.lang.String getJsonoutput() { + java.lang.Object ref = jsonoutput_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jsonoutput_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string jsonoutput = 2; + */ + public com.google.protobuf.ByteString + getJsonoutputBytes() { + java.lang.Object ref = jsonoutput_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + jsonoutput_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string jsonoutput = 2; + */ + public Builder setJsonoutput( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + jsonoutput_ = value; + onChanged(); + return this; + } + /** + * string jsonoutput = 2; + */ + public Builder clearJsonoutput() { + + jsonoutput_ = getDefaultInstance().getJsonoutput(); + onChanged(); + return this; + } + /** + * string jsonoutput = 2; + */ + public Builder setJsonoutputBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + jsonoutput_ = value; + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 3; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.ShowCmdJSONReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.ShowCmdJSONReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ShowCmdJSONReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ShowCmdJSONReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CreateSubsArgsOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CreateSubsArgs) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ReqId = 1; + */ + long getReqId(); + + /** + * int64 encode = 2; + */ + long getEncode(); + + /** + * string subidstr = 3; + */ + java.lang.String getSubidstr(); + /** + * string subidstr = 3; + */ + com.google.protobuf.ByteString + getSubidstrBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CreateSubsArgs} + */ + public static final class CreateSubsArgs extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CreateSubsArgs) + CreateSubsArgsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSubsArgs.newBuilder() to construct. + private CreateSubsArgs(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateSubsArgs() { + reqId_ = 0L; + encode_ = 0L; + subidstr_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateSubsArgs( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + reqId_ = input.readInt64(); + break; + } + case 16: { + + encode_ = input.readInt64(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + subidstr_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs.Builder.class); + } + + public static final int REQID_FIELD_NUMBER = 1; + private long reqId_; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + + public static final int ENCODE_FIELD_NUMBER = 2; + private long encode_; + /** + * int64 encode = 2; + */ + public long getEncode() { + return encode_; + } + + public static final int SUBIDSTR_FIELD_NUMBER = 3; + private volatile java.lang.Object subidstr_; + /** + * string subidstr = 3; + */ + public java.lang.String getSubidstr() { + java.lang.Object ref = subidstr_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subidstr_ = s; + return s; + } + } + /** + * string subidstr = 3; + */ + public com.google.protobuf.ByteString + getSubidstrBytes() { + java.lang.Object ref = subidstr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + subidstr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (reqId_ != 0L) { + output.writeInt64(1, reqId_); + } + if (encode_ != 0L) { + output.writeInt64(2, encode_); + } + if (!getSubidstrBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, subidstr_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, reqId_); + } + if (encode_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, encode_); + } + if (!getSubidstrBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, subidstr_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs) obj; + + boolean result = true; + result = result && (getReqId() + == other.getReqId()); + result = result && (getEncode() + == other.getEncode()); + result = result && getSubidstr() + .equals(other.getSubidstr()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqId()); + hash = (37 * hash) + ENCODE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getEncode()); + hash = (37 * hash) + SUBIDSTR_FIELD_NUMBER; + hash = (53 * hash) + getSubidstr().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CreateSubsArgs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CreateSubsArgs) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + reqId_ = 0L; + + encode_ = 0L; + + subidstr_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs(this); + result.reqId_ = reqId_; + result.encode_ = encode_; + result.subidstr_ = subidstr_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs.getDefaultInstance()) return this; + if (other.getReqId() != 0L) { + setReqId(other.getReqId()); + } + if (other.getEncode() != 0L) { + setEncode(other.getEncode()); + } + if (!other.getSubidstr().isEmpty()) { + subidstr_ = other.subidstr_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long reqId_ ; + /** + * int64 ReqId = 1; + */ + public long getReqId() { + return reqId_; + } + /** + * int64 ReqId = 1; + */ + public Builder setReqId(long value) { + + reqId_ = value; + onChanged(); + return this; + } + /** + * int64 ReqId = 1; + */ + public Builder clearReqId() { + + reqId_ = 0L; + onChanged(); + return this; + } + + private long encode_ ; + /** + * int64 encode = 2; + */ + public long getEncode() { + return encode_; + } + /** + * int64 encode = 2; + */ + public Builder setEncode(long value) { + + encode_ = value; + onChanged(); + return this; + } + /** + * int64 encode = 2; + */ + public Builder clearEncode() { + + encode_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object subidstr_ = ""; + /** + * string subidstr = 3; + */ + public java.lang.String getSubidstr() { + java.lang.Object ref = subidstr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subidstr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string subidstr = 3; + */ + public com.google.protobuf.ByteString + getSubidstrBytes() { + java.lang.Object ref = subidstr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + subidstr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string subidstr = 3; + */ + public Builder setSubidstr( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subidstr_ = value; + onChanged(); + return this; + } + /** + * string subidstr = 3; + */ + public Builder clearSubidstr() { + + subidstr_ = getDefaultInstance().getSubidstr(); + onChanged(); + return this; + } + /** + * string subidstr = 3; + */ + public Builder setSubidstrBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subidstr_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CreateSubsArgs) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CreateSubsArgs) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CreateSubsArgs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSubsArgs(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CreateSubsReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:IOSXRExtensibleManagabilityService.CreateSubsReply) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 ResReqId = 1; + */ + long getResReqId(); + + /** + * bytes data = 2; + */ + com.google.protobuf.ByteString getData(); + + /** + * string errors = 3; + */ + java.lang.String getErrors(); + /** + * string errors = 3; + */ + com.google.protobuf.ByteString + getErrorsBytes(); + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CreateSubsReply} + */ + public static final class CreateSubsReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:IOSXRExtensibleManagabilityService.CreateSubsReply) + CreateSubsReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSubsReply.newBuilder() to construct. + private CreateSubsReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateSubsReply() { + resReqId_ = 0L; + data_ = com.google.protobuf.ByteString.EMPTY; + errors_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateSubsReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + resReqId_ = input.readInt64(); + break; + } + case 18: { + + data_ = input.readBytes(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + errors_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply.Builder.class); + } + + public static final int RESREQID_FIELD_NUMBER = 1; + private long resReqId_; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + * bytes data = 2; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int ERRORS_FIELD_NUMBER = 3; + private volatile java.lang.Object errors_; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resReqId_ != 0L) { + output.writeInt64(1, resReqId_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + if (!getErrorsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, errors_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resReqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, resReqId_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + if (!getErrorsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, errors_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply)) { + return super.equals(obj); + } + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply other = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply) obj; + + boolean result = true; + result = result && (getResReqId() + == other.getResReqId()); + result = result && getData() + .equals(other.getData()); + result = result && getErrors() + .equals(other.getErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESREQID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResReqId()); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrors().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IOSXRExtensibleManagabilityService.CreateSubsReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:IOSXRExtensibleManagabilityService.CreateSubsReply) + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply.class, com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply.Builder.class); + } + + // Construct using com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resReqId_ = 0L; + + data_ = com.google.protobuf.ByteString.EMPTY; + + errors_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_descriptor; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply getDefaultInstanceForType() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply.getDefaultInstance(); + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply build() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply buildPartial() { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply result = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply(this); + result.resReqId_ = resReqId_; + result.data_ = data_; + result.errors_ = errors_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply) { + return mergeFrom((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply other) { + if (other == com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply.getDefaultInstance()) return this; + if (other.getResReqId() != 0L) { + setResReqId(other.getResReqId()); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (!other.getErrors().isEmpty()) { + errors_ = other.errors_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long resReqId_ ; + /** + * int64 ResReqId = 1; + */ + public long getResReqId() { + return resReqId_; + } + /** + * int64 ResReqId = 1; + */ + public Builder setResReqId(long value) { + + resReqId_ = value; + onChanged(); + return this; + } + /** + * int64 ResReqId = 1; + */ + public Builder clearResReqId() { + + resReqId_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes data = 2; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes data = 2; + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * bytes data = 2; + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.lang.Object errors_ = ""; + /** + * string errors = 3; + */ + public java.lang.String getErrors() { + java.lang.Object ref = errors_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errors_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string errors = 3; + */ + public com.google.protobuf.ByteString + getErrorsBytes() { + java.lang.Object ref = errors_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errors_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string errors = 3; + */ + public Builder setErrors( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errors_ = value; + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder clearErrors() { + + errors_ = getDefaultInstance().getErrors(); + onChanged(); + return this; + } + /** + * string errors = 3; + */ + public Builder setErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errors_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:IOSXRExtensibleManagabilityService.CreateSubsReply) + } + + // @@protoc_insertion_point(class_scope:IOSXRExtensibleManagabilityService.CreateSubsReply) + private static final com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply(); + } + + public static com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CreateSubsReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSubsReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_GetOperReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_GetOperReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_ConfigReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_ConfigReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CommitMsg_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CommitMsg_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CommitArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CommitArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CommitReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CommitReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025mdt_grpc_dialin.proto\022\"IOSXRExtensible" + + "ManagabilityService\"4\n\rConfigGetArgs\022\r\n\005" + + "ReqId\030\001 \001(\003\022\024\n\014yangpathjson\030\002 \001(\t\"D\n\016Con" + + "figGetReply\022\020\n\010ResReqId\030\001 \001(\003\022\020\n\010yangjso" + + "n\030\002 \001(\t\022\016\n\006errors\030\003 \001(\t\"2\n\013GetOperArgs\022\r" + + "\n\005ReqId\030\001 \001(\003\022\024\n\014yangpathjson\030\002 \001(\t\"B\n\014G" + + "etOperReply\022\020\n\010ResReqId\030\001 \001(\003\022\020\n\010yangjso" + + "n\030\002 \001(\t\022\016\n\006errors\030\003 \001(\t\"-\n\nConfigArgs\022\r\n" + + "\005ReqId\030\001 \001(\003\022\020\n\010yangjson\030\002 \001(\t\"/\n\013Config" + + "Reply\022\020\n\010ResReqId\030\001 \001(\003\022\016\n\006errors\030\002 \001(\t\"" + + "+\n\rCliConfigArgs\022\r\n\005ReqId\030\001 \001(\003\022\013\n\003cli\030\002" + + " \001(\t\"2\n\016CliConfigReply\022\020\n\010ResReqId\030\001 \001(\003" + + "\022\016\n\006errors\030\002 \001(\t\"A\n\021CommitReplaceArgs\022\r\n" + + "\005ReqId\030\001 \001(\003\022\013\n\003cli\030\002 \001(\t\022\020\n\010yangjson\030\003 " + + "\001(\t\"6\n\022CommitReplaceReply\022\020\n\010ResReqId\030\001 " + + "\001(\003\022\016\n\006errors\030\002 \001(\t\"+\n\tCommitMsg\022\r\n\005labe" + + "l\030\001 \001(\t\022\017\n\007comment\030\002 \001(\t\"W\n\nCommitArgs\022:" + + "\n\003msg\030\001 \001(\0132-.IOSXRExtensibleManagabilit" + + "yService.CommitMsg\022\r\n\005ReqId\030\002 \001(\003\"q\n\013Com" + + "mitReply\022@\n\006result\030\001 \001(\01620.IOSXRExtensib" + + "leManagabilityService.CommitResult\022\020\n\010Re" + + "sReqId\030\002 \001(\003\022\016\n\006errors\030\003 \001(\t\"#\n\022DiscardC" + + "hangesArgs\022\r\n\005ReqId\030\001 \001(\003\"7\n\023DiscardChan" + + "gesReply\022\020\n\010ResReqId\030\001 \001(\003\022\016\n\006errors\030\002 \001" + + "(\t\")\n\013ShowCmdArgs\022\r\n\005ReqId\030\001 \001(\003\022\013\n\003cli\030" + + "\002 \001(\t\"D\n\020ShowCmdTextReply\022\020\n\010ResReqId\030\001 " + + "\001(\003\022\016\n\006output\030\002 \001(\t\022\016\n\006errors\030\003 \001(\t\"H\n\020S" + + "howCmdJSONReply\022\020\n\010ResReqId\030\001 \001(\003\022\022\n\njso" + + "noutput\030\002 \001(\t\022\016\n\006errors\030\003 \001(\t\"A\n\016CreateS" + + "ubsArgs\022\r\n\005ReqId\030\001 \001(\003\022\016\n\006encode\030\002 \001(\003\022\020" + + "\n\010subidstr\030\003 \001(\t\"A\n\017CreateSubsReply\022\020\n\010R" + + "esReqId\030\001 \001(\003\022\014\n\004data\030\002 \001(\014\022\016\n\006errors\030\003 " + + "\001(\t*3\n\014CommitResult\022\n\n\006CHANGE\020\000\022\r\n\tNO_CH" + + "ANGE\020\001\022\010\n\004FAIL\020\0022\306\t\n\016gRPCConfigOper\022v\n\tG" + + "etConfig\0221.IOSXRExtensibleManagabilitySe" + + "rvice.ConfigGetArgs\0322.IOSXRExtensibleMan" + + "agabilityService.ConfigGetReply\"\0000\001\022p\n\013M" + + "ergeConfig\022..IOSXRExtensibleManagability" + + "Service.ConfigArgs\032/.IOSXRExtensibleMana" + + "gabilityService.ConfigReply\"\000\022q\n\014DeleteC" + + "onfig\022..IOSXRExtensibleManagabilityServi" + + "ce.ConfigArgs\032/.IOSXRExtensibleManagabil" + + "ityService.ConfigReply\"\000\022r\n\rReplaceConfi" + + "g\022..IOSXRExtensibleManagabilityService.C" + + "onfigArgs\032/.IOSXRExtensibleManagabilityS" + + "ervice.ConfigReply\"\000\022t\n\tCliConfig\0221.IOSX" + + "RExtensibleManagabilityService.CliConfig" + + "Args\0322.IOSXRExtensibleManagabilityServic" + + "e.CliConfigReply\"\000\022\200\001\n\rCommitReplace\0225.I" + + "OSXRExtensibleManagabilityService.Commit" + + "ReplaceArgs\0326.IOSXRExtensibleManagabilit" + + "yService.CommitReplaceReply\"\000\022q\n\014CommitC" + + "onfig\022..IOSXRExtensibleManagabilityServi" + + "ce.CommitArgs\032/.IOSXRExtensibleManagabil" + + "ityService.CommitReply\"\000\022\211\001\n\024ConfigDisca" + + "rdChanges\0226.IOSXRExtensibleManagabilityS" + + "ervice.DiscardChangesArgs\0327.IOSXRExtensi" + + "bleManagabilityService.DiscardChangesRep" + + "ly\"\000\022p\n\007GetOper\022/.IOSXRExtensibleManagab" + + "ilityService.GetOperArgs\0320.IOSXRExtensib" + + "leManagabilityService.GetOperReply\"\0000\001\022y" + + "\n\nCreateSubs\0222.IOSXRExtensibleManagabili" + + "tyService.CreateSubsArgs\0323.IOSXRExtensib" + + "leManagabilityService.CreateSubsReply\"\0000" + + "\0012\212\002\n\010gRPCExec\022~\n\021ShowCmdTextOutput\022/.IO" + + "SXRExtensibleManagabilityService.ShowCmd" + + "Args\0324.IOSXRExtensibleManagabilityServic" + + "e.ShowCmdTextReply\"\0000\001\022~\n\021ShowCmdJSONOut" + + "put\022/.IOSXRExtensibleManagabilityService" + + ".ShowCmdArgs\0324.IOSXRExtensibleManagabili" + + "tyService.ShowCmdJSONReply\"\0000\001B\'\n\035com.ci" + + "sco.stbarth.netconf.anxB\006XRGRPCb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_ConfigGetArgs_descriptor, + new java.lang.String[] { "ReqId", "Yangpathjson", }); + internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_ConfigGetReply_descriptor, + new java.lang.String[] { "ResReqId", "Yangjson", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_GetOperArgs_descriptor, + new java.lang.String[] { "ReqId", "Yangpathjson", }); + internal_static_IOSXRExtensibleManagabilityService_GetOperReply_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_IOSXRExtensibleManagabilityService_GetOperReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_GetOperReply_descriptor, + new java.lang.String[] { "ResReqId", "Yangjson", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_ConfigArgs_descriptor, + new java.lang.String[] { "ReqId", "Yangjson", }); + internal_static_IOSXRExtensibleManagabilityService_ConfigReply_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_IOSXRExtensibleManagabilityService_ConfigReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_ConfigReply_descriptor, + new java.lang.String[] { "ResReqId", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CliConfigArgs_descriptor, + new java.lang.String[] { "ReqId", "Cli", }); + internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CliConfigReply_descriptor, + new java.lang.String[] { "ResReqId", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceArgs_descriptor, + new java.lang.String[] { "ReqId", "Cli", "Yangjson", }); + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CommitReplaceReply_descriptor, + new java.lang.String[] { "ResReqId", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_CommitMsg_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_IOSXRExtensibleManagabilityService_CommitMsg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CommitMsg_descriptor, + new java.lang.String[] { "Label", "Comment", }); + internal_static_IOSXRExtensibleManagabilityService_CommitArgs_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_IOSXRExtensibleManagabilityService_CommitArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CommitArgs_descriptor, + new java.lang.String[] { "Msg", "ReqId", }); + internal_static_IOSXRExtensibleManagabilityService_CommitReply_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_IOSXRExtensibleManagabilityService_CommitReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CommitReply_descriptor, + new java.lang.String[] { "Result", "ResReqId", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesArgs_descriptor, + new java.lang.String[] { "ReqId", }); + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_DiscardChangesReply_descriptor, + new java.lang.String[] { "ResReqId", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_ShowCmdArgs_descriptor, + new java.lang.String[] { "ReqId", "Cli", }); + internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_ShowCmdTextReply_descriptor, + new java.lang.String[] { "ResReqId", "Output", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_ShowCmdJSONReply_descriptor, + new java.lang.String[] { "ResReqId", "Jsonoutput", "Errors", }); + internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CreateSubsArgs_descriptor, + new java.lang.String[] { "ReqId", "Encode", "Subidstr", }); + internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_IOSXRExtensibleManagabilityService_CreateSubsReply_descriptor, + new java.lang.String[] { "ResReqId", "Data", "Errors", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/XRGRPCClient.java b/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/XRGRPCClient.java new file mode 100644 index 0000000..919ab1f --- /dev/null +++ b/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/XRGRPCClient.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2018 Cisco Systems + * + * Author: Steven Barth + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cisco.stbarth.netconf.xrgrpc; + +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import java.util.function.Consumer; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs; +import com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply; +import com.cisco.stbarth.netconf.xrgrpc.gRPCConfigOperGrpc.gRPCConfigOperStub; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.okhttp.OkHttpChannelBuilder; +import io.grpc.stub.MetadataUtils; +import io.grpc.stub.StreamObserver; + +public class XRGRPCClient implements AutoCloseable { + private ManagedChannel channel; + private gRPCConfigOperStub stub; + private long requestID = 0; + + public enum SubscriptionEncoding { + GPB(2), GPBKV(3), JSON(4); + private final int value; + + SubscriptionEncoding(int value) { + this.value = value; + } + + int getValue() { + return value; + } + } + + public enum XRGRPCClientSecurity { + PLAINTEXT, TLS, TLS_UNVERIFIED; + } + + public class XRException extends Exception { + XRException(String message) { + super(message); + } + } + + public XRGRPCClient(String host, int port, String username, String password, XRGRPCClientSecurity security) { + OkHttpChannelBuilder channelBuilder = OkHttpChannelBuilder.forAddress(host, port); + + switch (security) { + case PLAINTEXT: + channelBuilder.usePlaintext(true); + break; + + case TLS_UNVERIFIED: + TrustManager[] trustAllCerts = new TrustManager[] { + new X509TrustManager() { + public void checkClientTrusted(X509Certificate[] certs, String authType) { + + } + + public void checkServerTrusted(X509Certificate[] certs, String authType) { + + } + + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + } + }; + + SSLContext sc; + try { + sc = SSLContext.getInstance("TLSv1"); + sc.init(null, trustAllCerts, new java.security.SecureRandom()); + channelBuilder.sslSocketFactory(sc.getSocketFactory()); + } catch (NoSuchAlgorithmException | KeyManagementException e) { + e.printStackTrace(); + } + + case TLS: + channelBuilder.useTransportSecurity(); + break; + } + + Metadata headers = new Metadata(); + headers.put(Metadata.Key.of("username", Metadata.ASCII_STRING_MARSHALLER), username); + headers.put(Metadata.Key.of("password", Metadata.ASCII_STRING_MARSHALLER), password); + + channel = channelBuilder.build(); + stub = MetadataUtils.attachHeaders(gRPCConfigOperGrpc.newStub(channel), headers); + } + + public void createSubscription(String subscription, SubscriptionEncoding encoding, + Consumer telemetryConsumer, Consumer terminationConsumer) { + CreateSubsArgs arg = CreateSubsArgs.newBuilder().setReqId(++requestID) + .setEncode(encoding.getValue()).setSubidstr(subscription).build(); + StreamObserver observer = new StreamObserver() { + private Throwable terminationException = null; + + @Override + public void onNext(CreateSubsReply value) { + if (!value.getData().isEmpty()) + telemetryConsumer.accept(value.getData().toByteArray()); + + if (!value.getErrors().isEmpty()) + terminationException = new XRException(value.getErrors()); + } + + @Override + public void onError(Throwable t) { + terminationConsumer.accept(t); + } + + @Override + public void onCompleted() { + terminationConsumer.accept(terminationException); + } + }; + stub.createSubs(arg, observer); + } + + @Override + public void close() throws Exception { + channel.shutdownNow(); + } +} diff --git a/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/gRPCConfigOperGrpc.java b/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/gRPCConfigOperGrpc.java new file mode 100644 index 0000000..44170be --- /dev/null +++ b/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/gRPCConfigOperGrpc.java @@ -0,0 +1,1018 @@ +package com.cisco.stbarth.netconf.xrgrpc; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: mdt_grpc_dialin.proto") +public final class gRPCConfigOperGrpc { + + private gRPCConfigOperGrpc() {} + + public static final String SERVICE_NAME = "IOSXRExtensibleManagabilityService.gRPCConfigOper"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetConfigMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_CONFIG = getGetConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetConfigMethod() { + return getGetConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetConfigMethodHelper() { + io.grpc.MethodDescriptor getGetConfigMethod; + if ((getGetConfigMethod = gRPCConfigOperGrpc.getGetConfigMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getGetConfigMethod = gRPCConfigOperGrpc.getGetConfigMethod) == null) { + gRPCConfigOperGrpc.getGetConfigMethod = getGetConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "GetConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("GetConfig")) + .build(); + } + } + } + return getGetConfigMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getMergeConfigMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_MERGE_CONFIG = getMergeConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getMergeConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getMergeConfigMethod() { + return getMergeConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor getMergeConfigMethodHelper() { + io.grpc.MethodDescriptor getMergeConfigMethod; + if ((getMergeConfigMethod = gRPCConfigOperGrpc.getMergeConfigMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getMergeConfigMethod = gRPCConfigOperGrpc.getMergeConfigMethod) == null) { + gRPCConfigOperGrpc.getMergeConfigMethod = getMergeConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "MergeConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("MergeConfig")) + .build(); + } + } + } + return getMergeConfigMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteConfigMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_CONFIG = getDeleteConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteConfigMethod() { + return getDeleteConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteConfigMethodHelper() { + io.grpc.MethodDescriptor getDeleteConfigMethod; + if ((getDeleteConfigMethod = gRPCConfigOperGrpc.getDeleteConfigMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getDeleteConfigMethod = gRPCConfigOperGrpc.getDeleteConfigMethod) == null) { + gRPCConfigOperGrpc.getDeleteConfigMethod = getDeleteConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "DeleteConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("DeleteConfig")) + .build(); + } + } + } + return getDeleteConfigMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getReplaceConfigMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_REPLACE_CONFIG = getReplaceConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getReplaceConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getReplaceConfigMethod() { + return getReplaceConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor getReplaceConfigMethodHelper() { + io.grpc.MethodDescriptor getReplaceConfigMethod; + if ((getReplaceConfigMethod = gRPCConfigOperGrpc.getReplaceConfigMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getReplaceConfigMethod = gRPCConfigOperGrpc.getReplaceConfigMethod) == null) { + gRPCConfigOperGrpc.getReplaceConfigMethod = getReplaceConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "ReplaceConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("ReplaceConfig")) + .build(); + } + } + } + return getReplaceConfigMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCliConfigMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CLI_CONFIG = getCliConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCliConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCliConfigMethod() { + return getCliConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCliConfigMethodHelper() { + io.grpc.MethodDescriptor getCliConfigMethod; + if ((getCliConfigMethod = gRPCConfigOperGrpc.getCliConfigMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getCliConfigMethod = gRPCConfigOperGrpc.getCliConfigMethod) == null) { + gRPCConfigOperGrpc.getCliConfigMethod = getCliConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "CliConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("CliConfig")) + .build(); + } + } + } + return getCliConfigMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCommitReplaceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_COMMIT_REPLACE = getCommitReplaceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCommitReplaceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCommitReplaceMethod() { + return getCommitReplaceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCommitReplaceMethodHelper() { + io.grpc.MethodDescriptor getCommitReplaceMethod; + if ((getCommitReplaceMethod = gRPCConfigOperGrpc.getCommitReplaceMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getCommitReplaceMethod = gRPCConfigOperGrpc.getCommitReplaceMethod) == null) { + gRPCConfigOperGrpc.getCommitReplaceMethod = getCommitReplaceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "CommitReplace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("CommitReplace")) + .build(); + } + } + } + return getCommitReplaceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCommitConfigMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_COMMIT_CONFIG = getCommitConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCommitConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCommitConfigMethod() { + return getCommitConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCommitConfigMethodHelper() { + io.grpc.MethodDescriptor getCommitConfigMethod; + if ((getCommitConfigMethod = gRPCConfigOperGrpc.getCommitConfigMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getCommitConfigMethod = gRPCConfigOperGrpc.getCommitConfigMethod) == null) { + gRPCConfigOperGrpc.getCommitConfigMethod = getCommitConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "CommitConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("CommitConfig")) + .build(); + } + } + } + return getCommitConfigMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getConfigDiscardChangesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CONFIG_DISCARD_CHANGES = getConfigDiscardChangesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getConfigDiscardChangesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getConfigDiscardChangesMethod() { + return getConfigDiscardChangesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getConfigDiscardChangesMethodHelper() { + io.grpc.MethodDescriptor getConfigDiscardChangesMethod; + if ((getConfigDiscardChangesMethod = gRPCConfigOperGrpc.getConfigDiscardChangesMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getConfigDiscardChangesMethod = gRPCConfigOperGrpc.getConfigDiscardChangesMethod) == null) { + gRPCConfigOperGrpc.getConfigDiscardChangesMethod = getConfigDiscardChangesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "ConfigDiscardChanges")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("ConfigDiscardChanges")) + .build(); + } + } + } + return getConfigDiscardChangesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetOperMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_OPER = getGetOperMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetOperMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetOperMethod() { + return getGetOperMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetOperMethodHelper() { + io.grpc.MethodDescriptor getGetOperMethod; + if ((getGetOperMethod = gRPCConfigOperGrpc.getGetOperMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getGetOperMethod = gRPCConfigOperGrpc.getGetOperMethod) == null) { + gRPCConfigOperGrpc.getGetOperMethod = getGetOperMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "GetOper")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("GetOper")) + .build(); + } + } + } + return getGetOperMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateSubsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_SUBS = getCreateSubsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateSubsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateSubsMethod() { + return getCreateSubsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateSubsMethodHelper() { + io.grpc.MethodDescriptor getCreateSubsMethod; + if ((getCreateSubsMethod = gRPCConfigOperGrpc.getCreateSubsMethod) == null) { + synchronized (gRPCConfigOperGrpc.class) { + if ((getCreateSubsMethod = gRPCConfigOperGrpc.getCreateSubsMethod) == null) { + gRPCConfigOperGrpc.getCreateSubsMethod = getCreateSubsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCConfigOper", "CreateSubs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCConfigOperMethodDescriptorSupplier("CreateSubs")) + .build(); + } + } + } + return getCreateSubsMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static gRPCConfigOperStub newStub(io.grpc.Channel channel) { + return new gRPCConfigOperStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static gRPCConfigOperBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new gRPCConfigOperBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static gRPCConfigOperFutureStub newFutureStub( + io.grpc.Channel channel) { + return new gRPCConfigOperFutureStub(channel); + } + + /** + */ + public static abstract class gRPCConfigOperImplBase implements io.grpc.BindableService { + + /** + */ + public void getConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetConfigMethodHelper(), responseObserver); + } + + /** + */ + public void mergeConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getMergeConfigMethodHelper(), responseObserver); + } + + /** + */ + public void deleteConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteConfigMethodHelper(), responseObserver); + } + + /** + */ + public void replaceConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getReplaceConfigMethodHelper(), responseObserver); + } + + /** + */ + public void cliConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCliConfigMethodHelper(), responseObserver); + } + + /** + */ + public void commitReplace(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCommitReplaceMethodHelper(), responseObserver); + } + + /** + *

+     * Do we need implicit or explicit commit
+     * 
+ */ + public void commitConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCommitConfigMethodHelper(), responseObserver); + } + + /** + */ + public void configDiscardChanges(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getConfigDiscardChangesMethodHelper(), responseObserver); + } + + /** + *
+     * Get only returns oper data
+     * 
+     * 
+ */ + public void getOper(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetOperMethodHelper(), responseObserver); + } + + /** + *
+     * Get Telemetry Data
+     * 
+ */ + public void createSubs(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateSubsMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetConfigMethodHelper(), + asyncServerStreamingCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetReply>( + this, METHODID_GET_CONFIG))) + .addMethod( + getMergeConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply>( + this, METHODID_MERGE_CONFIG))) + .addMethod( + getDeleteConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply>( + this, METHODID_DELETE_CONFIG))) + .addMethod( + getReplaceConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply>( + this, METHODID_REPLACE_CONFIG))) + .addMethod( + getCliConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply>( + this, METHODID_CLI_CONFIG))) + .addMethod( + getCommitReplaceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply>( + this, METHODID_COMMIT_REPLACE))) + .addMethod( + getCommitConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply>( + this, METHODID_COMMIT_CONFIG))) + .addMethod( + getConfigDiscardChangesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply>( + this, METHODID_CONFIG_DISCARD_CHANGES))) + .addMethod( + getGetOperMethodHelper(), + asyncServerStreamingCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperReply>( + this, METHODID_GET_OPER))) + .addMethod( + getCreateSubsMethodHelper(), + asyncServerStreamingCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsReply>( + this, METHODID_CREATE_SUBS))) + .build(); + } + } + + /** + */ + public static final class gRPCConfigOperStub extends io.grpc.stub.AbstractStub { + private gRPCConfigOperStub(io.grpc.Channel channel) { + super(channel); + } + + private gRPCConfigOperStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected gRPCConfigOperStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new gRPCConfigOperStub(channel, callOptions); + } + + /** + */ + public void getConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getGetConfigMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void mergeConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getMergeConfigMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteConfigMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void replaceConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getReplaceConfigMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void cliConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCliConfigMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void commitReplace(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCommitReplaceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Do we need implicit or explicit commit
+     * 
+ */ + public void commitConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCommitConfigMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void configDiscardChanges(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getConfigDiscardChangesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get only returns oper data
+     * 
+     * 
+ */ + public void getOper(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getGetOperMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get Telemetry Data
+     * 
+ */ + public void createSubs(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getCreateSubsMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class gRPCConfigOperBlockingStub extends io.grpc.stub.AbstractStub { + private gRPCConfigOperBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private gRPCConfigOperBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected gRPCConfigOperBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new gRPCConfigOperBlockingStub(channel, callOptions); + } + + /** + */ + public java.util.Iterator getConfig( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs request) { + return blockingServerStreamingCall( + getChannel(), getGetConfigMethodHelper(), getCallOptions(), request); + } + + /** + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply mergeConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request) { + return blockingUnaryCall( + getChannel(), getMergeConfigMethodHelper(), getCallOptions(), request); + } + + /** + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply deleteConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request) { + return blockingUnaryCall( + getChannel(), getDeleteConfigMethodHelper(), getCallOptions(), request); + } + + /** + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigReply replaceConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request) { + return blockingUnaryCall( + getChannel(), getReplaceConfigMethodHelper(), getCallOptions(), request); + } + + /** + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigReply cliConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs request) { + return blockingUnaryCall( + getChannel(), getCliConfigMethodHelper(), getCallOptions(), request); + } + + /** + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceReply commitReplace(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs request) { + return blockingUnaryCall( + getChannel(), getCommitReplaceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Do we need implicit or explicit commit
+     * 
+ */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReply commitConfig(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs request) { + return blockingUnaryCall( + getChannel(), getCommitConfigMethodHelper(), getCallOptions(), request); + } + + /** + */ + public com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesReply configDiscardChanges(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs request) { + return blockingUnaryCall( + getChannel(), getConfigDiscardChangesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Get only returns oper data
+     * 
+     * 
+ */ + public java.util.Iterator getOper( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs request) { + return blockingServerStreamingCall( + getChannel(), getGetOperMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Get Telemetry Data
+     * 
+ */ + public java.util.Iterator createSubs( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs request) { + return blockingServerStreamingCall( + getChannel(), getCreateSubsMethodHelper(), getCallOptions(), request); + } + } + + /** + */ + public static final class gRPCConfigOperFutureStub extends io.grpc.stub.AbstractStub { + private gRPCConfigOperFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private gRPCConfigOperFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected gRPCConfigOperFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new gRPCConfigOperFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture mergeConfig( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request) { + return futureUnaryCall( + getChannel().newCall(getMergeConfigMethodHelper(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteConfig( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request) { + return futureUnaryCall( + getChannel().newCall(getDeleteConfigMethodHelper(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture replaceConfig( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs request) { + return futureUnaryCall( + getChannel().newCall(getReplaceConfigMethodHelper(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture cliConfig( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs request) { + return futureUnaryCall( + getChannel().newCall(getCliConfigMethodHelper(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture commitReplace( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs request) { + return futureUnaryCall( + getChannel().newCall(getCommitReplaceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Do we need implicit or explicit commit
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture commitConfig( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs request) { + return futureUnaryCall( + getChannel().newCall(getCommitConfigMethodHelper(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture configDiscardChanges( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs request) { + return futureUnaryCall( + getChannel().newCall(getConfigDiscardChangesMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_CONFIG = 0; + private static final int METHODID_MERGE_CONFIG = 1; + private static final int METHODID_DELETE_CONFIG = 2; + private static final int METHODID_REPLACE_CONFIG = 3; + private static final int METHODID_CLI_CONFIG = 4; + private static final int METHODID_COMMIT_REPLACE = 5; + private static final int METHODID_COMMIT_CONFIG = 6; + private static final int METHODID_CONFIG_DISCARD_CHANGES = 7; + private static final int METHODID_GET_OPER = 8; + private static final int METHODID_CREATE_SUBS = 9; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final gRPCConfigOperImplBase serviceImpl; + private final int methodId; + + MethodHandlers(gRPCConfigOperImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_CONFIG: + serviceImpl.getConfig((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigGetArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_MERGE_CONFIG: + serviceImpl.mergeConfig((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CONFIG: + serviceImpl.deleteConfig((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPLACE_CONFIG: + serviceImpl.replaceConfig((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ConfigArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CLI_CONFIG: + serviceImpl.cliConfig((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CliConfigArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_COMMIT_REPLACE: + serviceImpl.commitReplace((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitReplaceArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_COMMIT_CONFIG: + serviceImpl.commitConfig((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CommitArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CONFIG_DISCARD_CHANGES: + serviceImpl.configDiscardChanges((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.DiscardChangesArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_OPER: + serviceImpl.getOper((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.GetOperArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SUBS: + serviceImpl.createSubs((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.CreateSubsArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class gRPCConfigOperBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + gRPCConfigOperBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("gRPCConfigOper"); + } + } + + private static final class gRPCConfigOperFileDescriptorSupplier + extends gRPCConfigOperBaseDescriptorSupplier { + gRPCConfigOperFileDescriptorSupplier() {} + } + + private static final class gRPCConfigOperMethodDescriptorSupplier + extends gRPCConfigOperBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + gRPCConfigOperMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (gRPCConfigOperGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new gRPCConfigOperFileDescriptorSupplier()) + .addMethod(getGetConfigMethodHelper()) + .addMethod(getMergeConfigMethodHelper()) + .addMethod(getDeleteConfigMethodHelper()) + .addMethod(getReplaceConfigMethodHelper()) + .addMethod(getCliConfigMethodHelper()) + .addMethod(getCommitReplaceMethodHelper()) + .addMethod(getCommitConfigMethodHelper()) + .addMethod(getConfigDiscardChangesMethodHelper()) + .addMethod(getGetOperMethodHelper()) + .addMethod(getCreateSubsMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/gRPCExecGrpc.java b/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/gRPCExecGrpc.java new file mode 100644 index 0000000..2bd0fda --- /dev/null +++ b/xrgrpc/src/main/java/com/cisco/stbarth/netconf/xrgrpc/gRPCExecGrpc.java @@ -0,0 +1,361 @@ +package com.cisco.stbarth.netconf.xrgrpc; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: mdt_grpc_dialin.proto") +public final class gRPCExecGrpc { + + private gRPCExecGrpc() {} + + public static final String SERVICE_NAME = "IOSXRExtensibleManagabilityService.gRPCExec"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getShowCmdTextOutputMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_SHOW_CMD_TEXT_OUTPUT = getShowCmdTextOutputMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getShowCmdTextOutputMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getShowCmdTextOutputMethod() { + return getShowCmdTextOutputMethodHelper(); + } + + private static io.grpc.MethodDescriptor getShowCmdTextOutputMethodHelper() { + io.grpc.MethodDescriptor getShowCmdTextOutputMethod; + if ((getShowCmdTextOutputMethod = gRPCExecGrpc.getShowCmdTextOutputMethod) == null) { + synchronized (gRPCExecGrpc.class) { + if ((getShowCmdTextOutputMethod = gRPCExecGrpc.getShowCmdTextOutputMethod) == null) { + gRPCExecGrpc.getShowCmdTextOutputMethod = getShowCmdTextOutputMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCExec", "ShowCmdTextOutput")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCExecMethodDescriptorSupplier("ShowCmdTextOutput")) + .build(); + } + } + } + return getShowCmdTextOutputMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getShowCmdJSONOutputMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_SHOW_CMD_JSONOUTPUT = getShowCmdJSONOutputMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getShowCmdJSONOutputMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getShowCmdJSONOutputMethod() { + return getShowCmdJSONOutputMethodHelper(); + } + + private static io.grpc.MethodDescriptor getShowCmdJSONOutputMethodHelper() { + io.grpc.MethodDescriptor getShowCmdJSONOutputMethod; + if ((getShowCmdJSONOutputMethod = gRPCExecGrpc.getShowCmdJSONOutputMethod) == null) { + synchronized (gRPCExecGrpc.class) { + if ((getShowCmdJSONOutputMethod = gRPCExecGrpc.getShowCmdJSONOutputMethod) == null) { + gRPCExecGrpc.getShowCmdJSONOutputMethod = getShowCmdJSONOutputMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName( + "IOSXRExtensibleManagabilityService.gRPCExec", "ShowCmdJSONOutput")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply.getDefaultInstance())) + .setSchemaDescriptor(new gRPCExecMethodDescriptorSupplier("ShowCmdJSONOutput")) + .build(); + } + } + } + return getShowCmdJSONOutputMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static gRPCExecStub newStub(io.grpc.Channel channel) { + return new gRPCExecStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static gRPCExecBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new gRPCExecBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static gRPCExecFutureStub newFutureStub( + io.grpc.Channel channel) { + return new gRPCExecFutureStub(channel); + } + + /** + */ + public static abstract class gRPCExecImplBase implements io.grpc.BindableService { + + /** + *
+     * Exec commands
+     * 
+ */ + public void showCmdTextOutput(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getShowCmdTextOutputMethodHelper(), responseObserver); + } + + /** + */ + public void showCmdJSONOutput(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getShowCmdJSONOutputMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getShowCmdTextOutputMethodHelper(), + asyncServerStreamingCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdTextReply>( + this, METHODID_SHOW_CMD_TEXT_OUTPUT))) + .addMethod( + getShowCmdJSONOutputMethodHelper(), + asyncServerStreamingCall( + new MethodHandlers< + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs, + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdJSONReply>( + this, METHODID_SHOW_CMD_JSONOUTPUT))) + .build(); + } + } + + /** + */ + public static final class gRPCExecStub extends io.grpc.stub.AbstractStub { + private gRPCExecStub(io.grpc.Channel channel) { + super(channel); + } + + private gRPCExecStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected gRPCExecStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new gRPCExecStub(channel, callOptions); + } + + /** + *
+     * Exec commands
+     * 
+ */ + public void showCmdTextOutput(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getShowCmdTextOutputMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void showCmdJSONOutput(com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getShowCmdJSONOutputMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class gRPCExecBlockingStub extends io.grpc.stub.AbstractStub { + private gRPCExecBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private gRPCExecBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected gRPCExecBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new gRPCExecBlockingStub(channel, callOptions); + } + + /** + *
+     * Exec commands
+     * 
+ */ + public java.util.Iterator showCmdTextOutput( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs request) { + return blockingServerStreamingCall( + getChannel(), getShowCmdTextOutputMethodHelper(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator showCmdJSONOutput( + com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs request) { + return blockingServerStreamingCall( + getChannel(), getShowCmdJSONOutputMethodHelper(), getCallOptions(), request); + } + } + + /** + */ + public static final class gRPCExecFutureStub extends io.grpc.stub.AbstractStub { + private gRPCExecFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private gRPCExecFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected gRPCExecFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new gRPCExecFutureStub(channel, callOptions); + } + } + + private static final int METHODID_SHOW_CMD_TEXT_OUTPUT = 0; + private static final int METHODID_SHOW_CMD_JSONOUTPUT = 1; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final gRPCExecImplBase serviceImpl; + private final int methodId; + + MethodHandlers(gRPCExecImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SHOW_CMD_TEXT_OUTPUT: + serviceImpl.showCmdTextOutput((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SHOW_CMD_JSONOUTPUT: + serviceImpl.showCmdJSONOutput((com.cisco.stbarth.netconf.xrgrpc.XRGRPC.ShowCmdArgs) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class gRPCExecBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + gRPCExecBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.cisco.stbarth.netconf.xrgrpc.XRGRPC.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("gRPCExec"); + } + } + + private static final class gRPCExecFileDescriptorSupplier + extends gRPCExecBaseDescriptorSupplier { + gRPCExecFileDescriptorSupplier() {} + } + + private static final class gRPCExecMethodDescriptorSupplier + extends gRPCExecBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + gRPCExecMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (gRPCExecGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new gRPCExecFileDescriptorSupplier()) + .addMethod(getShowCmdTextOutputMethodHelper()) + .addMethod(getShowCmdJSONOutputMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/xrgrpc/src/main/proto/mdt_grpc_dialin.proto b/xrgrpc/src/main/proto/mdt_grpc_dialin.proto new file mode 100644 index 0000000..6db7ab7 --- /dev/null +++ b/xrgrpc/src/main/proto/mdt_grpc_dialin.proto @@ -0,0 +1,166 @@ +syntax = "proto3"; +option java_package = "com.cisco.stbarth.grpc.agc"; +option java_outer_classname = "XRGRPC"; + +// Package implements gRPC Model Driven Telemetry service +package IOSXRExtensibleManagabilityService; + +service gRPCConfigOper { + + // Configuration related commands + + rpc GetConfig(ConfigGetArgs) returns(stream ConfigGetReply) {}; + + rpc MergeConfig(ConfigArgs) returns(ConfigReply) {}; + + rpc DeleteConfig(ConfigArgs) returns(ConfigReply) {}; + + rpc ReplaceConfig(ConfigArgs) returns(ConfigReply) {}; + + rpc CliConfig(CliConfigArgs) returns(CliConfigReply) {}; + + rpc CommitReplace(CommitReplaceArgs) returns (CommitReplaceReply) {}; + + // Do we need implicit or explicit commit + // + rpc CommitConfig(CommitArgs) returns(CommitReply) {}; + + rpc ConfigDiscardChanges(DiscardChangesArgs) returns(DiscardChangesReply) {}; + + // Get only returns oper data + // + rpc GetOper(GetOperArgs) returns(stream GetOperReply) {}; + // Do we need "Get" also to give combined oper and config? + + // Get Telemetry Data + rpc CreateSubs(CreateSubsArgs) returns(stream CreateSubsReply) {}; +} + +// +// Should we seperate Exec from Config/Oper? +// + +service gRPCExec { +// Exec commands + rpc ShowCmdTextOutput(ShowCmdArgs) returns(stream ShowCmdTextReply) {}; + rpc ShowCmdJSONOutput(ShowCmdArgs) returns(stream ShowCmdJSONReply) {}; + + +} + +message ConfigGetArgs { + int64 ReqId = 1; + string yangpathjson = 2; +} + +message ConfigGetReply { + int64 ResReqId = 1; + string yangjson = 2; + string errors = 3; +} + +message GetOperArgs { + int64 ReqId = 1; + string yangpathjson = 2; +} + +message GetOperReply { + int64 ResReqId = 1; + string yangjson = 2; + string errors = 3; +} + +message ConfigArgs { + int64 ReqId = 1; + string yangjson = 2; + +} + +message ConfigReply { + int64 ResReqId = 1; + string errors = 2; +} + +message CliConfigArgs { + int64 ReqId = 1; + string cli = 2; +} + +message CliConfigReply { + int64 ResReqId = 1; + string errors = 2; +} + + +message CommitReplaceArgs { + int64 ReqId = 1; + string cli = 2; + string yangjson = 3; +} + +message CommitReplaceReply { + int64 ResReqId = 1; + string errors = 2; +} + +message CommitMsg { + string label = 1; + string comment = 2; +} + +enum CommitResult { + CHANGE = 0; + NO_CHANGE = 1; + FAIL = 2; +} + +message CommitArgs { + CommitMsg msg = 1; + int64 ReqId = 2; +} + +message CommitReply { + CommitResult result = 1; + int64 ResReqId = 2; + string errors = 3; +} + + +message DiscardChangesArgs { + int64 ReqId = 1; +} + +message DiscardChangesReply { + int64 ResReqId = 1; + string errors = 2; +} + + +message ShowCmdArgs { + int64 ReqId = 1; + string cli = 2; +} + +message ShowCmdTextReply { + int64 ResReqId =1; + string output = 2; + string errors = 3; +} +message ShowCmdJSONReply { + int64 ResReqId =1; + string jsonoutput = 2; + string errors = 3; +} + +message CreateSubsArgs { + int64 ReqId = 1; + int64 encode = 2; + string subidstr = 3; +} + +message CreateSubsReply { + int64 ResReqId = 1; + bytes data = 2; + string errors = 3; +} +